diff options
269 files changed, 0 insertions, 48956 deletions
@@ -22,9 +22,6 @@ <ProjectsToClean Include=" $(SolutionPath); - projecttemplates\projecttemplates.proj; - vsi\vsi.proj; - vsix\vsix.proj; samples\samples.proj; "> <Properties>TargetFrameworkVersion=v4.5</Properties> diff --git a/projecttemplates/MvcRelyingParty.vsixmanifest b/projecttemplates/MvcRelyingParty.vsixmanifest deleted file mode 100644 index 11cfbec..0000000 --- a/projecttemplates/MvcRelyingParty.vsixmanifest +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0"?> -<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010"> - <Identifier Id="DotNetOpenAuth.MvcRelyingParty.15E8EC96-BDC3-47E2-8BB1-0483E9D16705"> - <Name>ASP.NET MVC 2 OpenID web site (C#)</Name> - <Author>DotNetOpenAuth</Author> - <Version>$version$</Version> - <Description>Resources for developing applications that use OpenID, OAuth, and InfoCard.</Description> - <Locale>1033</Locale> - <License>LICENSE.txt</License> - <GettingStartedGuide>http://www.dotnetopenauth.net/ProjectTemplateGettingStarted</GettingStartedGuide> - <Icon>VSIXProject_small.png</Icon> - <PreviewImage>VSIXProject_large.png</PreviewImage> - <InstalledByMsi>false</InstalledByMsi> - <SupportedProducts> - <VisualStudio Version="10.0"> - <Edition>Pro</Edition> - <Edition>Premium</Edition> - <Edition>Ultimate</Edition> - </VisualStudio> - <VisualStudio Version="11.0"> - <Edition>Pro</Edition> - <Edition>Premium</Edition> - <Edition>Ultimate</Edition> - </VisualStudio> - </SupportedProducts> - <SupportedFrameworkRuntimeEdition MinVersion="3.5" MaxVersion="4.5" /> - </Identifier> - <References /> - <Content> - <ProjectTemplate>PT</ProjectTemplate> - </Content> -</Vsix> diff --git a/projecttemplates/MvcRelyingParty.vstemplate b/projecttemplates/MvcRelyingParty.vstemplate deleted file mode 100644 index b599a75..0000000 --- a/projecttemplates/MvcRelyingParty.vstemplate +++ /dev/null @@ -1,22 +0,0 @@ -<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="ProjectGroup"> - <TemplateData> - <Name>ASP.NET MVC OpenID-InfoCard RP</Name> - <RequiredFrameworkVersion>3.5</RequiredFrameworkVersion> - <Description>An ASP.NET MVC web site that accepts OpenID logins and acts as an OAuth service provider.</Description> - <ProjectType>CSharp</ProjectType> - <NumberOfParentCategoriesToRollUp>2</NumberOfParentCategoriesToRollUp> - <SortOrder>1000</SortOrder> - <CreateNewFolder>true</CreateNewFolder> - <DefaultName>WebRPApplication</DefaultName> - <ProvideDefaultName>true</ProvideDefaultName> - <LocationField>Enabled</LocationField> - <EnableLocationBrowseButton>true</EnableLocationBrowseButton> - <Icon>__TemplateIcon.ico</Icon> - </TemplateData> - <TemplateContent> - <ProjectCollection> - <ProjectTemplateLink ProjectName="$projectname$">MvcRelyingParty\MvcRelyingParty.vstemplate</ProjectTemplateLink> - <ProjectTemplateLink ProjectName="RelyingPartyLogic">RelyingPartyLogic\RelyingPartyLogic.vstemplate</ProjectTemplateLink> - </ProjectCollection> - </TemplateContent> -</VSTemplate>
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Code/Extensions.cs b/projecttemplates/MvcRelyingParty/Code/Extensions.cs deleted file mode 100644 index 09437b0..0000000 --- a/projecttemplates/MvcRelyingParty/Code/Extensions.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace MvcRelyingParty { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Threading; - using System.Threading.Tasks; - using System.Web; - using System.Web.Mvc; - - internal static class Extensions { - internal static Uri ActionFull(this UrlHelper urlHelper, string actionName) { - return new Uri(HttpContext.Current.Request.Url, urlHelper.Action(actionName)); - } - - internal static Uri ActionFull(this UrlHelper urlHelper, string actionName, string controllerName) { - return new Uri(HttpContext.Current.Request.Url, urlHelper.Action(actionName, controllerName)); - } - - internal static Task ToApm(this Task task, AsyncCallback callback, object state) { - if (task == null) { - throw new ArgumentNullException("task"); - } - - var tcs = new TaskCompletionSource<object>(state); - task.ContinueWith( - t => { - if (t.IsFaulted) { - tcs.TrySetException(t.Exception.InnerExceptions); - } else if (t.IsCanceled) { - tcs.TrySetCanceled(); - } else { - tcs.TrySetResult(null); - } - - if (callback != null) { - callback(tcs.Task); - } - }, - CancellationToken.None, - TaskContinuationOptions.None, - TaskScheduler.Default); - - return tcs.Task; - } - } -} diff --git a/projecttemplates/MvcRelyingParty/Code/FormsAuthenticationService.cs b/projecttemplates/MvcRelyingParty/Code/FormsAuthenticationService.cs deleted file mode 100644 index 471c3250..0000000 --- a/projecttemplates/MvcRelyingParty/Code/FormsAuthenticationService.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace MvcRelyingParty { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - using System.Web.Security; - using DotNetOpenAuth.OpenId; - - /// <summary> - /// Forms authentication interface to facilitate login/logout functionality. - /// </summary> - /// <remarks> - /// The FormsAuthentication type is sealed and contains static members, so it is difficult to - /// unit test code that calls its members. The interface and helper class below demonstrate - /// how to create an abstract wrapper around such a type in order to make the AccountController - /// code unit testable. - /// </remarks> - public interface IFormsAuthentication { - void SignIn(Identifier claimedIdentifier, bool createPersistentCookie); - - void SignOut(); - } - - /// <summary> - /// The standard FormsAuthentication behavior to use for the live site. - /// </summary> - public class FormsAuthenticationService : IFormsAuthentication { - public void SignIn(Identifier claimedIdentifier, bool createPersistentCookie) { - FormsAuthentication.SetAuthCookie(claimedIdentifier, createPersistentCookie); - } - - public void SignOut() { - FormsAuthentication.SignOut(); - } - } -} diff --git a/projecttemplates/MvcRelyingParty/Code/HttpHeaderAttribute.cs b/projecttemplates/MvcRelyingParty/Code/HttpHeaderAttribute.cs deleted file mode 100644 index e52d8eb..0000000 --- a/projecttemplates/MvcRelyingParty/Code/HttpHeaderAttribute.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace MvcRelyingParty { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - using System.Web.Mvc; - - /// <summary> - /// Represents an attribute that is used to add HTTP Headers to a Controller Action response. - /// </summary> - public class HttpHeaderAttribute : ActionFilterAttribute { - /// <summary> - /// Initializes a new instance of the <see cref="HttpHeaderAttribute"/> class. - /// </summary> - /// <param name="name">The HTTP header name.</param> - /// <param name="value">The HTTP header value.</param> - public HttpHeaderAttribute(string name, string value) { - this.Name = name; - this.Value = value; - } - - /// <summary> - /// Gets or sets the name of the HTTP Header. - /// </summary> - public string Name { get; set; } - - /// <summary> - /// Gets or sets the value of the HTTP Header. - /// </summary> - public string Value { get; set; } - - /// <summary> - /// Called by the MVC framework after the action result executes. - /// </summary> - /// <param name="filterContext">The filter context.</param> - public override void OnResultExecuted(ResultExecutedContext filterContext) { - filterContext.HttpContext.Response.AppendHeader(this.Name, this.Value); - base.OnResultExecuted(filterContext); - } - } -}
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Code/OpenIdRelyingPartyService.cs b/projecttemplates/MvcRelyingParty/Code/OpenIdRelyingPartyService.cs deleted file mode 100644 index 0506286..0000000 --- a/projecttemplates/MvcRelyingParty/Code/OpenIdRelyingPartyService.cs +++ /dev/null @@ -1,107 +0,0 @@ -namespace MvcRelyingParty { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Threading; - using System.Threading.Tasks; - using System.Web; - using System.Web.Mvc; - using DotNetOpenAuth.Messaging; - using DotNetOpenAuth.OpenId; - using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration; - using DotNetOpenAuth.OpenId.RelyingParty; - using Validation; - - public interface IOpenIdRelyingParty { - Channel Channel { get; } - - Task<IAuthenticationRequest> CreateRequestAsync(Identifier userSuppliedIdentifier, Realm realm, Uri returnTo, Uri privacyPolicy, CancellationToken cancellationToken = default(CancellationToken)); - - Task<IEnumerable<IAuthenticationRequest>> CreateRequestsAsync(Identifier userSuppliedIdentifier, Realm realm, Uri returnTo, Uri privacyPolicy, CancellationToken cancellationToken = default(CancellationToken)); - - Task<ActionResult> AjaxDiscoveryAsync(Identifier userSuppliedIdentifier, Realm realm, Uri returnTo, Uri privacyPolicy, CancellationToken cancellationToken = default(CancellationToken)); - - Task<string> PreloadDiscoveryResultsAsync(Realm realm, Uri returnTo, Uri privacyPolicy, CancellationToken cancellationToken = default(CancellationToken), params Identifier[] identifiers); - - Task<ActionResult> ProcessAjaxOpenIdResponseAsync(HttpRequestBase request, CancellationToken cancellationToken = default(CancellationToken)); - - Task<IAuthenticationResponse> GetResponseAsync(HttpRequestBase request, CancellationToken cancellationToken = default(CancellationToken)); - } - - /// <summary> - /// A wrapper around the standard <see cref="OpenIdRelyingParty"/> class. - /// </summary> - public class OpenIdRelyingPartyService : IOpenIdRelyingParty { - /// <summary> - /// The OpenID relying party to use for logging users in. - /// </summary> - /// <remarks> - /// This is static because it is thread-safe and is more expensive - /// to create than we want to run through for every single page request. - /// </remarks> - private static OpenIdAjaxRelyingParty relyingParty = new OpenIdAjaxRelyingParty(); - - /// <summary> - /// Initializes a new instance of the <see cref="OpenIdRelyingPartyService"/> class. - /// </summary> - public OpenIdRelyingPartyService() { - } - - #region IOpenIdRelyingParty Members - - public Channel Channel { - get { return relyingParty.Channel; } - } - - public async Task<IAuthenticationRequest> CreateRequestAsync(Identifier userSuppliedIdentifier, Realm realm, Uri returnTo, Uri privacyPolicy, CancellationToken cancellationToken = default(CancellationToken)) { - return (await this.CreateRequestsAsync(userSuppliedIdentifier, realm, returnTo, privacyPolicy, cancellationToken)).First(); - } - - public async Task<IEnumerable<IAuthenticationRequest>> CreateRequestsAsync(Identifier userSuppliedIdentifier, Realm realm, Uri returnTo, Uri privacyPolicy, CancellationToken cancellationToken = default(CancellationToken)) { - Requires.NotNull(userSuppliedIdentifier, "userSuppliedIdentifier"); - Requires.NotNull(realm, "realm"); - Requires.NotNull(returnTo, "returnTo"); - - var requests = (await relyingParty.CreateRequestsAsync(userSuppliedIdentifier, realm, returnTo, cancellationToken)).ToList(); - - foreach (IAuthenticationRequest request in requests) { - // Ask for the user's email, not because we necessarily need it to do our work, - // but so we can display something meaningful to the user as their "username" - // when they log in with a PPID from Google, for example. - request.AddExtension(new ClaimsRequest { - Email = DemandLevel.Require, - FullName = DemandLevel.Request, - PolicyUrl = privacyPolicy, - }); - } - - return requests; - } - - public async Task<ActionResult> AjaxDiscoveryAsync(Identifier userSuppliedIdentifier, Realm realm, Uri returnTo, Uri privacyPolicy, CancellationToken cancellationToken = default(CancellationToken)) { - return (await relyingParty.AsAjaxDiscoveryResultAsync( - await this.CreateRequestsAsync(userSuppliedIdentifier, realm, returnTo, privacyPolicy, cancellationToken), - cancellationToken)).AsActionResult(); - } - - public async Task<string> PreloadDiscoveryResultsAsync(Realm realm, Uri returnTo, Uri privacyPolicy, CancellationToken cancellationToken = default(CancellationToken), params Identifier[] identifiers) { - var results = new List<IAuthenticationRequest>(); - foreach (var id in identifiers) { - var discoveryResult = await this.CreateRequestsAsync(id, realm, returnTo, privacyPolicy, cancellationToken); - results.AddRange(discoveryResult); - } - - return await relyingParty.AsAjaxPreloadedDiscoveryResultAsync(results, cancellationToken); - } - - public async Task<ActionResult> ProcessAjaxOpenIdResponseAsync(HttpRequestBase request, CancellationToken cancellationToken = default(CancellationToken)) { - return (await relyingParty.ProcessResponseFromPopupAsync(request, cancellationToken)).AsActionResult(); - } - - public Task<IAuthenticationResponse> GetResponseAsync(HttpRequestBase request, CancellationToken cancellationToken = default(CancellationToken)) { - return relyingParty.GetResponseAsync(request, cancellationToken); - } - - #endregion - } -} diff --git a/projecttemplates/MvcRelyingParty/Content/Site.css b/projecttemplates/MvcRelyingParty/Content/Site.css deleted file mode 100644 index 186a158..0000000 --- a/projecttemplates/MvcRelyingParty/Content/Site.css +++ /dev/null @@ -1,327 +0,0 @@ -/*---------------------------------------------------------- -The base color for this template is #5c87b2. If you'd like -to use a different color start by replacing all instances of -#5c87b2 with your new color. -----------------------------------------------------------*/ -body -{ - background-color: #5c87b2; - font-size: .75em; - font-family: Verdana, Helvetica, Sans-Serif; - margin: 0; - padding: 0; - color: #696969; -} - -a:link -{ - color: #034af3; - text-decoration: underline; -} -a:visited -{ - color: #505abc; -} -a:hover -{ - color: #1d60ff; - text-decoration: none; -} -a:active -{ - color: #12eb87; -} - -p, ul -{ - margin-bottom: 20px; - line-height: 1.6em; -} - -/* HEADINGS -----------------------------------------------------------*/ -h1, h2, h3, h4, h5, h6 -{ - font-size: 1.5em; - color: #000; - font-family: Arial, Helvetica, sans-serif; -} - -h1 -{ - font-size: 2em; - padding-bottom: 0; - margin-bottom: 0; -} -h2 -{ - padding: 0 0 10px 0; -} -h3 -{ - font-size: 1.2em; -} -h4 -{ - font-size: 1.1em; -} -h5, h6 -{ - font-size: 1em; -} - -/* this rule styles <h2> tags that are the -first child of the left and right table columns */ -.rightColumn > h1, .rightColumn > h2, .leftColumn > h1, .leftColumn > h2 -{ - margin-top: 0; -} - -/* PRIMARY LAYOUT ELEMENTS -----------------------------------------------------------*/ - -/* you can specify a greater or lesser percentage for the -page width. Or, you can specify an exact pixel width. */ -.page -{ - width: 90%; - margin-left: auto; - margin-right: auto; -} - -#header -{ - position: relative; - margin-bottom: 0px; - color: #000; - padding: 0; -} - -#header h1 -{ - font-weight: bold; - padding: 5px 0; - margin: 0; - color: #fff; - border: none; - line-height: 2em; - font-family: Arial, Helvetica, sans-serif; - font-size: 32px !important; -} - -#main -{ - padding: 30px 30px 15px 30px; - background-color: #fff; - margin-bottom: 30px; - _height: 1px; /* only IE6 applies CSS properties starting with an underscrore */ -} - -#footer -{ - color: #999; - padding: 10px 0; - text-align: center; - line-height: normal; - margin: 0; - font-size: .9em; -} - -/* TAB MENU -----------------------------------------------------------*/ -ul#menu -{ - border-bottom: 1px #5C87B2 solid; - padding: 0 0 2px; - position: relative; - margin: 0; - text-align: right; -} - -ul#menu li -{ - display: inline; - list-style: none; -} - -ul#menu li#greeting -{ - padding: 10px 20px; - font-weight: bold; - text-decoration: none; - line-height: 2.8em; - color: #fff; -} - -ul#menu li a -{ - padding: 10px 20px; - font-weight: bold; - text-decoration: none; - line-height: 2.8em; - background-color: #e8eef4; - color: #034af3; -} - -ul#menu li a:hover -{ - background-color: #fff; - text-decoration: none; -} - -ul#menu li a:active -{ - background-color: #a6e2a6; - text-decoration: none; -} - -ul#menu li.selected a -{ - background-color: #fff; - color: #000; -} - -/* FORM LAYOUT ELEMENTS -----------------------------------------------------------*/ - -fieldset -{ - margin: 1em 0; - padding: 1em; - border: 1px solid #CCC; -} - -fieldset p -{ - margin: 2px 12px 10px 10px; -} - -fieldset label -{ - display: block; -} - -fieldset label.inline -{ - display: inline; -} - -legend -{ - font-size: 1.1em; - font-weight: 600; - padding: 2px 4px 8px 4px; -} - -input[type="text"] -{ - width: 200px; - border: 1px solid #CCC; -} - -input[type="password"] -{ - width: 200px; - border: 1px solid #CCC; -} - -/* TABLE -----------------------------------------------------------*/ - -table -{ - border: solid 1px #e8eef4; - border-collapse: collapse; -} - -table td -{ - padding: 5px; - border: solid 1px #e8eef4; -} - -table th -{ - padding: 6px 5px; - text-align: left; - background-color: #e8eef4; - border: solid 1px #e8eef4; -} - -/* MISC -----------------------------------------------------------*/ -.clear -{ - clear: both; -} - -.error -{ - color:Red; -} - -#menucontainer -{ - margin-top:40px; -} - -div#title -{ - display:block; - float:left; - text-align:left; -} - -#logindisplay -{ - font-size:1.1em; - display:block; - text-align:right; - margin:10px; - color:White; -} - -#logindisplay a:link -{ - color: white; - text-decoration: underline; -} - -#logindisplay a:visited -{ - color: white; - text-decoration: underline; -} - -#logindisplay a:hover -{ - color: white; - text-decoration: none; -} - -.field-validation-error -{ - color: #ff0000; -} - -.input-validation-error -{ - border: 1px solid #ff0000; - background-color: #ffeeee; -} - -.validation-summary-errors -{ - font-weight: bold; - color: #ff0000; -} - -ul.AuthTokens li.OpenID -{ - list-style-image: url(../../content/images/openid_login.png); -} - -ul.AuthTokens li.InfoCard -{ - list-style-image: url(../../content/images/infocard_23x16.png); -} diff --git a/projecttemplates/MvcRelyingParty/Content/images/google.gif b/projecttemplates/MvcRelyingParty/Content/images/google.gif Binary files differdeleted file mode 100644 index 1b6cd07..0000000 --- a/projecttemplates/MvcRelyingParty/Content/images/google.gif +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/images/infocard_23x16.png b/projecttemplates/MvcRelyingParty/Content/images/infocard_23x16.png Binary files differdeleted file mode 100644 index 9dbea9f..0000000 --- a/projecttemplates/MvcRelyingParty/Content/images/infocard_23x16.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/images/myopenid.png b/projecttemplates/MvcRelyingParty/Content/images/myopenid.png Binary files differdeleted file mode 100644 index 204caae..0000000 --- a/projecttemplates/MvcRelyingParty/Content/images/myopenid.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/images/openid.png b/projecttemplates/MvcRelyingParty/Content/images/openid.png Binary files differdeleted file mode 100644 index bf25c16..0000000 --- a/projecttemplates/MvcRelyingParty/Content/images/openid.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/images/openid_login.png b/projecttemplates/MvcRelyingParty/Content/images/openid_login.png Binary files differdeleted file mode 100644 index caebd58..0000000 --- a/projecttemplates/MvcRelyingParty/Content/images/openid_login.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/images/verisign.gif b/projecttemplates/MvcRelyingParty/Content/images/verisign.gif Binary files differdeleted file mode 100644 index faa6aaa..0000000 --- a/projecttemplates/MvcRelyingParty/Content/images/verisign.gif +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/images/yahoo.gif b/projecttemplates/MvcRelyingParty/Content/images/yahoo.gif Binary files differdeleted file mode 100644 index 42adbfa..0000000 --- a/projecttemplates/MvcRelyingParty/Content/images/yahoo.gif +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/images/yahoo_login.png b/projecttemplates/MvcRelyingParty/Content/images/yahoo_login.png Binary files differdeleted file mode 100644 index 476fa64..0000000 --- a/projecttemplates/MvcRelyingParty/Content/images/yahoo_login.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/loginpopup.css b/projecttemplates/MvcRelyingParty/Content/loginpopup.css deleted file mode 100644 index 89e1b38..0000000 --- a/projecttemplates/MvcRelyingParty/Content/loginpopup.css +++ /dev/null @@ -1,23 +0,0 @@ -body -{ - font-family: Verdana; - font-size: 10pt; - background-color: White; - margin: 10px; -} -/* -body > div.wrapper -{ - width: 355px; - height: 235px; -} -*/ -Div#NotMyComputerDiv -{ - display: none; -} - -.helpDoc -{ - font-size: 80%; -}
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_flat_55_999999_40x100.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_flat_55_999999_40x100.png Binary files differdeleted file mode 100644 index 6b6de7d..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_flat_55_999999_40x100.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_flat_75_aaaaaa_40x100.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_flat_75_aaaaaa_40x100.png Binary files differdeleted file mode 100644 index 5b5dab2..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_flat_75_aaaaaa_40x100.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_glass_45_0078ae_1x400.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_glass_45_0078ae_1x400.png Binary files differdeleted file mode 100644 index 3dac650..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_glass_45_0078ae_1x400.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_glass_55_f8da4e_1x400.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_glass_55_f8da4e_1x400.png Binary files differdeleted file mode 100644 index b383704..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_glass_55_f8da4e_1x400.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_glass_75_79c9ec_1x400.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_glass_75_79c9ec_1x400.png Binary files differdeleted file mode 100644 index d384e42..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_glass_75_79c9ec_1x400.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_gloss-wave_45_e14f1c_500x100.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_gloss-wave_45_e14f1c_500x100.png Binary files differdeleted file mode 100644 index b9851ba..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_gloss-wave_45_e14f1c_500x100.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_gloss-wave_50_6eac2c_500x100.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_gloss-wave_50_6eac2c_500x100.png Binary files differdeleted file mode 100644 index 76dac56..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_gloss-wave_50_6eac2c_500x100.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_gloss-wave_75_2191c0_500x100.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_gloss-wave_75_2191c0_500x100.png Binary files differdeleted file mode 100644 index eeacf69..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_gloss-wave_75_2191c0_500x100.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_inset-hard_100_fcfdfd_1x100.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_inset-hard_100_fcfdfd_1x100.png Binary files differdeleted file mode 100644 index 38c3833..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_0078ae_256x240.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_0078ae_256x240.png Binary files differdeleted file mode 100644 index 58f96f8..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_0078ae_256x240.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_056b93_256x240.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_056b93_256x240.png Binary files differdeleted file mode 100644 index 8e6103d..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_056b93_256x240.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_d8e7f3_256x240.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_d8e7f3_256x240.png Binary files differdeleted file mode 100644 index 2c8aac4..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_d8e7f3_256x240.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_e0fdff_256x240.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_e0fdff_256x240.png Binary files differdeleted file mode 100644 index d985a26..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_e0fdff_256x240.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_f5e175_256x240.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_f5e175_256x240.png Binary files differdeleted file mode 100644 index 7862520..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_f5e175_256x240.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_f7a50d_256x240.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_f7a50d_256x240.png Binary files differdeleted file mode 100644 index c5297f8..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_f7a50d_256x240.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_fcd113_256x240.png b/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_fcd113_256x240.png Binary files differdeleted file mode 100644 index 68dcff5..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/images/ui-icons_fcd113_256x240.png +++ /dev/null diff --git a/projecttemplates/MvcRelyingParty/Content/theme/ui.accordion.css b/projecttemplates/MvcRelyingParty/Content/theme/ui.accordion.css deleted file mode 100644 index c84ad4e..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/ui.accordion.css +++ /dev/null @@ -1,9 +0,0 @@ -/* Accordion -----------------------------------*/ -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion li {display: inline;} -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } -.ui-accordion .ui-accordion-content-active { display: block; }
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Content/theme/ui.all.css b/projecttemplates/MvcRelyingParty/Content/theme/ui.all.css deleted file mode 100644 index 543e4c3..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/ui.all.css +++ /dev/null @@ -1,2 +0,0 @@ -@import "ui.base.css"; -@import "ui.theme.css"; diff --git a/projecttemplates/MvcRelyingParty/Content/theme/ui.base.css b/projecttemplates/MvcRelyingParty/Content/theme/ui.base.css deleted file mode 100644 index dadf378..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/ui.base.css +++ /dev/null @@ -1,9 +0,0 @@ -@import url("ui.core.css"); - -@import url("ui.accordion.css"); -@import url("ui.datepicker.css"); -@import url("ui.dialog.css"); -@import url("ui.progressbar.css"); -@import url("ui.resizable.css"); -@import url("ui.slider.css"); -@import url("ui.tabs.css"); diff --git a/projecttemplates/MvcRelyingParty/Content/theme/ui.core.css b/projecttemplates/MvcRelyingParty/Content/theme/ui.core.css deleted file mode 100644 index d832ad7..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/ui.core.css +++ /dev/null @@ -1,37 +0,0 @@ -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Content/theme/ui.datepicker.css b/projecttemplates/MvcRelyingParty/Content/theme/ui.datepicker.css deleted file mode 100644 index 92986c9..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/ui.datepicker.css +++ /dev/null @@ -1,62 +0,0 @@ -/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:left; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Content/theme/ui.dialog.css b/projecttemplates/MvcRelyingParty/Content/theme/ui.dialog.css deleted file mode 100644 index f10f409..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/ui.dialog.css +++ /dev/null @@ -1,13 +0,0 @@ -/* Dialog -----------------------------------*/ -.ui-dialog { position: relative; padding: .2em; width: 300px; } -.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; }
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Content/theme/ui.progressbar.css b/projecttemplates/MvcRelyingParty/Content/theme/ui.progressbar.css deleted file mode 100644 index bc0939e..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/ui.progressbar.css +++ /dev/null @@ -1,4 +0,0 @@ -/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Content/theme/ui.resizable.css b/projecttemplates/MvcRelyingParty/Content/theme/ui.resizable.css deleted file mode 100644 index 44efeb2..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/ui.resizable.css +++ /dev/null @@ -1,13 +0,0 @@ -/* Resizable -----------------------------------*/ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Content/theme/ui.slider.css b/projecttemplates/MvcRelyingParty/Content/theme/ui.slider.css deleted file mode 100644 index 0792a48..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/ui.slider.css +++ /dev/null @@ -1,17 +0,0 @@ -/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: 1%; display: block; border: 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Content/theme/ui.tabs.css b/projecttemplates/MvcRelyingParty/Content/theme/ui.tabs.css deleted file mode 100644 index 70ed3ef..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/ui.tabs.css +++ /dev/null @@ -1,9 +0,0 @@ -/* Tabs -----------------------------------*/ -.ui-tabs {padding: .2em;} -.ui-tabs .ui-tabs-nav { padding: .2em .2em 0 .2em; position: relative; } -.ui-tabs .ui-tabs-nav li { float: left; border-bottom: 0 !important; margin: 0 .2em -1px 0; padding: 0; list-style: none; } -.ui-tabs .ui-tabs-nav li a { display:block; text-decoration: none; padding: .5em 1em; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: .1em; border-bottom: 0; } -.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border: 0; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; }
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Content/theme/ui.theme.css b/projecttemplates/MvcRelyingParty/Content/theme/ui.theme.css deleted file mode 100644 index 84f7fed..0000000 --- a/projecttemplates/MvcRelyingParty/Content/theme/ui.theme.css +++ /dev/null @@ -1,243 +0,0 @@ - - -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://ui.jquery.com/themeroller/?tr=&ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=2191c0&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=75&borderColorHeader=4297d7&fcHeader=eaf5f7&iconColorHeader=d8e7f3&bgColorContent=fcfdfd&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=a6c9e2&fcContent=222222&iconColorContent=0078ae&bgColorDefault=0078ae&bgTextureDefault=02_glass.png&bgImgOpacityDefault=45&borderColorDefault=77d5f7&fcDefault=ffffff&iconColorDefault=e0fdff&bgColorHover=79c9ec&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=448dae&fcHover=026890&iconColorHover=056b93&bgColorActive=6eac2c&bgTextureActive=12_gloss_wave.png&bgImgOpacityActive=50&borderColorActive=acdd4a&fcActive=ffffff&iconColorActive=f5e175&bgColorHighlight=f8da4e&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcd113&fcHighlight=915608&iconColorHighlight=f7a50d&bgColorError=e14f1c&bgTextureError=12_gloss_wave.png&bgImgOpacityError=45&borderColorError=cd0a0a&fcError=ffffff&iconColorError=fcd113&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=75&opacityOverlay=30&bgColorShadow=999999&bgTextureShadow=01_flat.png&bgImgOpacityShadow=55&opacityShadow=45&thicknessShadow=0px&offsetTopShadow=5px&offsetLeftShadow=5px&cornerRadiusShadow=5px -*/ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } -.ui-widget-header { border: 1px solid #4297d7; background: #2191c0 url(images/ui-bg_gloss-wave_75_2191c0_500x100.png) 50% 50% repeat-x; color: #eaf5f7; font-weight: bold; } -.ui-widget-header a { color: #eaf5f7; } -.ui-widget-content { border: 1px solid #a6c9e2; background: #fcfdfd url(images/ui-bg_inset-hard_100_fcfdfd_1x100.png) 50% bottom repeat-x; color: #222222; } -.ui-widget-content a { color: #222222; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #77d5f7; background: #0078ae url(images/ui-bg_glass_45_0078ae_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; outline: none; } -.ui-state-default a { color: #ffffff; text-decoration: none; outline: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #448dae; background: #79c9ec url(images/ui-bg_glass_75_79c9ec_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #026890; outline: none; } -.ui-state-hover a { color: #026890; text-decoration: none; outline: none; } -.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #acdd4a; background: #6eac2c url(images/ui-bg_gloss-wave_50_6eac2c_500x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; outline: none; } -.ui-state-active a { color: #ffffff; outline: none; text-decoration: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcd113; background: #f8da4e url(images/ui-bg_glass_55_f8da4e_1x400.png) 50% 50% repeat-x; color: #915608; } -.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #e14f1c url(images/ui-bg_gloss-wave_45_e14f1c_500x100.png) 50% top repeat-x; color: #ffffff; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #ffffff; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_0078ae_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_0078ae_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_d8e7f3_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_e0fdff_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_056b93_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_f5e175_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_f7a50d_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_fcd113_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; } -.ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; } -.ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; } -.ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; } -.ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; } -.ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; } -.ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; } - -/* Overlays */ -.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_75_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } -.ui-widget-shadow { margin: 5px 0 0 5px; padding: 0px; background: #999999 url(images/ui-bg_flat_55_999999_40x100.png) 50% 50% repeat-x; opacity: .45;filter:Alpha(Opacity=45); -moz-border-radius: 5px; -webkit-border-radius: 5px; }
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Controllers/AccountController.cs b/projecttemplates/MvcRelyingParty/Controllers/AccountController.cs deleted file mode 100644 index bf45838..0000000 --- a/projecttemplates/MvcRelyingParty/Controllers/AccountController.cs +++ /dev/null @@ -1,132 +0,0 @@ -namespace MvcRelyingParty.Controllers { - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Linq; - using System.Net; - using System.Security.Principal; - using System.Threading.Tasks; - using System.Web; - using System.Web.Mvc; - using System.Web.Security; - using System.Web.UI; - using DotNetOpenAuth.Messaging; - using DotNetOpenAuth.OAuth; - using DotNetOpenAuth.OAuth.Messages; - using DotNetOpenAuth.OpenId; - using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration; - using DotNetOpenAuth.OpenId.RelyingParty; - using MvcRelyingParty.Models; - using RelyingPartyLogic; - - [HandleError] - public class AccountController : Controller { - [Authorize] - public ActionResult Edit() { - return View(GetAccountInfoModel()); - } - - /// <summary> - /// Updates the user's account information. - /// </summary> - /// <param name="firstName">The first name.</param> - /// <param name="lastName">The last name.</param> - /// <param name="emailAddress">The email address.</param> - /// <returns>An updated view showing the new profile.</returns> - /// <remarks> - /// This action accepts PUT because this operation is idempotent in nature. - /// </remarks> - [Authorize, AcceptVerbs(HttpVerbs.Put), ValidateAntiForgeryToken] - public ActionResult Update(string firstName, string lastName, string emailAddress) { - Database.LoggedInUser.FirstName = firstName; - Database.LoggedInUser.LastName = lastName; - - if (Database.LoggedInUser.EmailAddress != emailAddress) { - Database.LoggedInUser.EmailAddress = emailAddress; - Database.LoggedInUser.EmailAddressVerified = false; - } - - return PartialView("EditFields", GetAccountInfoModel()); - } - - [Authorize, AcceptVerbs(HttpVerbs.Get | HttpVerbs.Post)] - [HttpHeader("x-frame-options", "SAMEORIGIN")] // mitigates clickjacking - public async Task<ActionResult> Authorize() { - var pendingRequest = await OAuthServiceProvider.AuthorizationServer.ReadAuthorizationRequestAsync(Request, Response.ClientDisconnectedToken); - if (pendingRequest == null) { - throw new HttpException((int)HttpStatusCode.BadRequest, "Missing authorization request."); - } - - var requestingClient = Database.DataContext.Clients.First(c => c.ClientIdentifier == pendingRequest.ClientIdentifier); - - // Consider auto-approving if safe to do so. - if (((OAuthAuthorizationServer)OAuthServiceProvider.AuthorizationServer.AuthorizationServerServices).CanBeAutoApproved(pendingRequest)) { - var approval = OAuthServiceProvider.AuthorizationServer.PrepareApproveAuthorizationRequest(pendingRequest, HttpContext.User.Identity.Name); - var response = await OAuthServiceProvider.AuthorizationServer.Channel.PrepareResponseAsync(approval, Response.ClientDisconnectedToken); - return response.AsActionResult(); - } - - var model = new AccountAuthorizeModel { - ClientApp = requestingClient.Name, - Scope = pendingRequest.Scope, - AuthorizationRequest = pendingRequest, - }; - - return View(model); - } - - [Authorize, AcceptVerbs(HttpVerbs.Post), ValidateAntiForgeryToken] - public async Task<ActionResult> AuthorizeResponse(bool isApproved) { - var pendingRequest = await OAuthServiceProvider.AuthorizationServer.ReadAuthorizationRequestAsync(Request, Response.ClientDisconnectedToken); - if (pendingRequest == null) { - throw new HttpException((int)HttpStatusCode.BadRequest, "Missing authorization request."); - } - var requestingClient = Database.DataContext.Clients.First(c => c.ClientIdentifier == pendingRequest.ClientIdentifier); - - IDirectedProtocolMessage response; - if (isApproved) { - Database.LoggedInUser.ClientAuthorizations.Add( - new ClientAuthorization() { - Client = requestingClient, - Scope = string.Join(" ", pendingRequest.Scope.ToArray()), - User = Database.LoggedInUser, - CreatedOnUtc = DateTime.UtcNow.CutToSecond(), - }); - response = OAuthServiceProvider.AuthorizationServer.PrepareApproveAuthorizationRequest(pendingRequest, HttpContext.User.Identity.Name); - } else { - response = OAuthServiceProvider.AuthorizationServer.PrepareRejectAuthorizationRequest(pendingRequest); - } - - var responseMessage = await OAuthServiceProvider.AuthorizationServer.Channel.PrepareResponseAsync(response, Response.ClientDisconnectedToken); - return responseMessage.AsActionResult(); - } - - [Authorize, AcceptVerbs(HttpVerbs.Delete)] // ValidateAntiForgeryToken would be GREAT here, but it's not a FORM POST operation so that doesn't work. - public ActionResult RevokeAuthorization(int authorizationId) { - var tokenEntity = Database.DataContext.ClientAuthorizations.Where(auth => auth.User.UserId == Database.LoggedInUser.UserId && auth.AuthorizationId == authorizationId).FirstOrDefault(); - if (tokenEntity == null) { - throw new ArgumentOutOfRangeException("id", "The logged in user does not have a token with this name to revoke."); - } - - Database.DataContext.DeleteObject(tokenEntity); - Database.DataContext.SaveChanges(); // make changes now so the model we fill up reflects the change - - return PartialView("AuthorizedApps", GetAccountInfoModel()); - } - - private static AccountInfoModel GetAccountInfoModel() { - var authorizedApps = from auth in Database.DataContext.ClientAuthorizations - where auth.User.UserId == Database.LoggedInUser.UserId - select new AccountInfoModel.AuthorizedApp { AppName = auth.Client.Name, AuthorizationId = auth.AuthorizationId, Scope = auth.Scope }; - Database.LoggedInUser.AuthenticationTokens.Load(); - var model = new AccountInfoModel { - FirstName = Database.LoggedInUser.FirstName, - LastName = Database.LoggedInUser.LastName, - EmailAddress = Database.LoggedInUser.EmailAddress, - AuthorizedApps = authorizedApps.ToList(), - AuthenticationTokens = Database.LoggedInUser.AuthenticationTokens.ToList(), - }; - return model; - } - } -} diff --git a/projecttemplates/MvcRelyingParty/Controllers/AuthController.cs b/projecttemplates/MvcRelyingParty/Controllers/AuthController.cs deleted file mode 100644 index 926c254..0000000 --- a/projecttemplates/MvcRelyingParty/Controllers/AuthController.cs +++ /dev/null @@ -1,226 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="AuthController.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace MvcRelyingParty.Controllers { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Threading.Tasks; - using System.Web; - using System.Web.Mvc; - using DotNetOpenAuth.Messaging; - using DotNetOpenAuth.OpenId; - using DotNetOpenAuth.OpenId.RelyingParty; - using RelyingPartyLogic; - - public class AuthController : Controller { - /// <summary> - /// Initializes a new instance of the <see cref="AuthController"/> class. - /// </summary> - /// <remarks> - /// This constructor is used by the MVC framework to instantiate the controller using - /// the default forms authentication and OpenID services. - /// </remarks> - public AuthController() - : this(null, null) { - } - - /// <summary> - /// Initializes a new instance of the <see cref="AuthController"/> class. - /// </summary> - /// <param name="formsAuth">The forms auth.</param> - /// <param name="relyingParty">The relying party.</param> - /// <remarks> - /// This constructor is not used by the MVC framework but is instead provided for ease - /// of unit testing this type. - /// </remarks> - public AuthController(IFormsAuthentication formsAuth, IOpenIdRelyingParty relyingParty) { - this.FormsAuth = formsAuth ?? new FormsAuthenticationService(); - this.RelyingParty = relyingParty ?? new OpenIdRelyingPartyService(); - } - - /// <summary> - /// Gets the forms authentication module to use. - /// </summary> - public IFormsAuthentication FormsAuth { get; private set; } - - /// <summary> - /// Gets the OpenID relying party to use for logging users in. - /// </summary> - public IOpenIdRelyingParty RelyingParty { get; private set; } - - private Uri PrivacyPolicyUrl { - get { - return Url.ActionFull("PrivacyPolicy", "Home"); - } - } - - /// <summary> - /// Performs discovery on a given identifier. - /// </summary> - /// <param name="identifier">The identifier on which to perform discovery.</param> - /// <returns>The JSON result of discovery.</returns> - public Task<ActionResult> Discover(string identifier) { - if (!this.Request.IsAjaxRequest()) { - throw new InvalidOperationException(); - } - - return this.RelyingParty.AjaxDiscoveryAsync( - identifier, - Realm.AutoDetect, - Url.ActionFull("PopUpReturnTo"), - this.PrivacyPolicyUrl, - Response.ClientDisconnectedToken); - } - - /// <summary> - /// Prepares a web page to help the user supply his login information. - /// </summary> - /// <returns>The action result.</returns> - public async Task<ActionResult> LogOn() { - await this.PreloadDiscoveryResultsAsync(); - return View(); - } - - /// <summary> - /// Prepares a web page to help the user supply his login information. - /// </summary> - /// <returns>The action result.</returns> - public async Task<ActionResult> LogOnPopUp() { - await this.PreloadDiscoveryResultsAsync(); - return View(); - } - - /// <summary> - /// Handles the positive assertion that comes from Providers to Javascript running in the browser. - /// </summary> - /// <returns>The action result.</returns> - /// <remarks> - /// This method instructs ASP.NET MVC to <i>not</i> validate input - /// because some OpenID positive assertions messages otherwise look like - /// hack attempts and result in errors when validation is turned on. - /// </remarks> - [AcceptVerbs(HttpVerbs.Get | HttpVerbs.Post), ValidateInput(false)] - public Task<ActionResult> PopUpReturnTo() { - return this.RelyingParty.ProcessAjaxOpenIdResponseAsync(this.Request, this.Response.ClientDisconnectedToken); - } - - /// <summary> - /// Handles the positive assertion that comes from Providers. - /// </summary> - /// <param name="openid_openidAuthData">The positive assertion obtained via AJAX.</param> - /// <returns>The action result.</returns> - /// <remarks> - /// This method instructs ASP.NET MVC to <i>not</i> validate input - /// because some OpenID positive assertions messages otherwise look like - /// hack attempts and result in errors when validation is turned on. - /// </remarks> - [AcceptVerbs(HttpVerbs.Post), ValidateInput(false)] - public async Task<ActionResult> LogOnPostAssertion(string openid_openidAuthData) { - IAuthenticationResponse response; - if (!string.IsNullOrEmpty(openid_openidAuthData)) { - // Always say it's a GET since the payload is all in the URL, even the large ones. - var auth = new Uri(openid_openidAuthData); - HttpRequestBase clientResponseInfo = HttpRequestInfo.Create("GET", auth, headers: Request.Headers); - response = await this.RelyingParty.GetResponseAsync(clientResponseInfo, Response.ClientDisconnectedToken); - } else { - response = await this.RelyingParty.GetResponseAsync(Request, Response.ClientDisconnectedToken); - } - if (response != null) { - switch (response.Status) { - case AuthenticationStatus.Authenticated: - var token = RelyingPartyLogic.User.ProcessUserLogin(response); - this.FormsAuth.SignIn(token.ClaimedIdentifier, false); - string returnUrl = Request.Form["returnUrl"]; - if (!string.IsNullOrEmpty(returnUrl)) { - return Redirect(returnUrl); - } else { - return RedirectToAction("Index", "Home"); - } - case AuthenticationStatus.Canceled: - ModelState.AddModelError("OpenID", "It looks like you canceled login at your OpenID Provider."); - break; - case AuthenticationStatus.Failed: - ModelState.AddModelError("OpenID", response.Exception.Message); - break; - } - } - - // If we're to this point, login didn't complete successfully. - // Show the LogOn view again to show the user any errors and - // give another chance to complete login. - return View("LogOn"); - } - - [Authorize, AcceptVerbs(HttpVerbs.Post), ValidateAntiForgeryToken, ValidateInput(false)] - public async Task<ActionResult> AddAuthenticationToken(string openid_openidAuthData) { - IAuthenticationResponse response; - if (!string.IsNullOrEmpty(openid_openidAuthData)) { - var auth = new Uri(openid_openidAuthData); - var headers = new WebHeaderCollection(); - foreach (string header in Request.Headers) { - headers[header] = Request.Headers[header]; - } - - // Always say it's a GET since the payload is all in the URL, even the large ones. - HttpRequestBase clientResponseInfo = HttpRequestInfo.Create("GET", auth, headers: headers); - response = await this.RelyingParty.GetResponseAsync(clientResponseInfo, Response.ClientDisconnectedToken); - } else { - response = await this.RelyingParty.GetResponseAsync(Request, Response.ClientDisconnectedToken); - } - if (response != null) { - switch (response.Status) { - case AuthenticationStatus.Authenticated: - string identifierString = response.ClaimedIdentifier; - var existing = Database.DataContext.AuthenticationTokens.Include("User").FirstOrDefault(token => token.ClaimedIdentifier == identifierString); - if (existing == null) { - Database.LoggedInUser.AuthenticationTokens.Add(new AuthenticationToken { - ClaimedIdentifier = response.ClaimedIdentifier, - FriendlyIdentifier = response.FriendlyIdentifierForDisplay, - }); - Database.DataContext.SaveChanges(); - } else { - if (existing.User != Database.LoggedInUser) { - // The supplied token is already bound to a different user account. - // TODO: communicate the problem to the user. - } - } - break; - default: - break; - } - } - - return RedirectToAction("Edit", "Account"); - } - - /// <summary> - /// Logs the user out of the site and redirects the browser to our home page. - /// </summary> - /// <returns>The action result.</returns> - public ActionResult LogOff() { - this.FormsAuth.SignOut(); - return RedirectToAction("Index", "Home"); - } - - /// <summary> - /// Preloads discovery results for the OP buttons we display on the selector in the ViewData. - /// </summary> - /// <returns> - /// A task that completes with the asynchronous operation. - /// </returns> - private async Task PreloadDiscoveryResultsAsync() { - this.ViewData["PreloadedDiscoveryResults"] = this.RelyingParty.PreloadDiscoveryResultsAsync( - Realm.AutoDetect, - Url.ActionFull("PopUpReturnTo"), - this.PrivacyPolicyUrl, - Response.ClientDisconnectedToken, - "https://me.yahoo.com/", - "https://www.google.com/accounts/o8/id"); - } - } -} diff --git a/projecttemplates/MvcRelyingParty/Controllers/HomeController.cs b/projecttemplates/MvcRelyingParty/Controllers/HomeController.cs deleted file mode 100644 index 0bf7ab3..0000000 --- a/projecttemplates/MvcRelyingParty/Controllers/HomeController.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace MvcRelyingParty.Controllers { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - using System.Web.Mvc; - - [HandleError] - public class HomeController : Controller { - public ActionResult Index() { - ViewData["Message"] = "Welcome to ASP.NET MVC with OpenID RP + OAuth SP support!"; - - return View(); - } - - public ActionResult About() { - return View(); - } - - public ActionResult PrivacyPolicy() { - return View(); - } - } -} diff --git a/projecttemplates/MvcRelyingParty/Default.aspx b/projecttemplates/MvcRelyingParty/Default.aspx deleted file mode 100644 index da3195d..0000000 --- a/projecttemplates/MvcRelyingParty/Default.aspx +++ /dev/null @@ -1,3 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MvcRelyingParty._Default" %> - -<%-- Please do not delete this file. It is used to ensure that ASP.NET MVC is activated by IIS when a user makes a "/" request to the server. --%> diff --git a/projecttemplates/MvcRelyingParty/Default.aspx.cs b/projecttemplates/MvcRelyingParty/Default.aspx.cs deleted file mode 100644 index e9077cf..0000000 --- a/projecttemplates/MvcRelyingParty/Default.aspx.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace MvcRelyingParty { - using System.Web; - using System.Web.Mvc; - using System.Web.UI; - - public partial class _Default : Page { - public void Page_Load(object sender, System.EventArgs e) { - // Change the current path so that the Routing handler can correctly interpret - // the request, then restore the original path so that the OutputCache module - // can correctly process the response (if caching is enabled). - string originalPath = Request.Path; - HttpContext.Current.RewritePath(Request.ApplicationPath, false); - IHttpHandler httpHandler = new MvcHttpHandler(); - httpHandler.ProcessRequest(HttpContext.Current); - HttpContext.Current.RewritePath(originalPath, false); - } - } -} diff --git a/projecttemplates/MvcRelyingParty/Getting Started.htm b/projecttemplates/MvcRelyingParty/Getting Started.htm deleted file mode 100644 index 6c8741c..0000000 --- a/projecttemplates/MvcRelyingParty/Getting Started.htm +++ /dev/null @@ -1,22 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <title>Getting started</title> -</head> -<body> - <p> - Your OpenID and InfoCard relying party web site is nearly ready to go. You just - need to create your SQL database where user accounts will be stored. <b>Just build and - start your web site</b> and visit <b>Setup.aspx</b>. You'll get further instructions - there. - </p> - <p> - Creating your database is almost totally automated, so it should be a piece of cake. - <b>Note</b> however that creating the database requires Modify permissions in your web - site's App_Data directory for the security account that creates databases on your - computer. If you get a permissions or file write error from setup.aspx, try - temporarily adding Everyone: Modify permissions to your App_Data folder just long - enough to create your database. - </p> -</body> -</html> diff --git a/projecttemplates/MvcRelyingParty/Global.asax b/projecttemplates/MvcRelyingParty/Global.asax deleted file mode 100644 index 2b562e5..0000000 --- a/projecttemplates/MvcRelyingParty/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="MvcRelyingParty.MvcApplication" Language="C#" %> diff --git a/projecttemplates/MvcRelyingParty/Global.asax.cs b/projecttemplates/MvcRelyingParty/Global.asax.cs deleted file mode 100644 index 44c66b5..0000000 --- a/projecttemplates/MvcRelyingParty/Global.asax.cs +++ /dev/null @@ -1,51 +0,0 @@ -namespace MvcRelyingParty { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - using System.Web.Mvc; - using System.Web.Routing; - - //// Note: For instructions on enabling IIS6 or IIS7 classic mode, - //// visit http://go.microsoft.com/?LinkId=9394801 - - public class MvcApplication : System.Web.HttpApplication { - /// <summary> - /// The logger for this web site to use. - /// </summary> - private static log4net.ILog logger = log4net.LogManager.GetLogger("MvcRelyingParty"); - - public static log4net.ILog Logger { - get { return logger; } - } - - public static void RegisterRoutes(RouteCollection routes) { - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - - routes.MapRoute( - "Default", - "{controller}/{action}/{id}", - new { controller = "Home", action = "Index", id = string.Empty }); - routes.MapRoute( - "OpenIdDiscover", - "Auth/Discover"); - } - - protected void Application_Start() { - log4net.Config.XmlConfigurator.Configure(); - Logger.Info("Web application starting..."); - RegisterRoutes(RouteTable.Routes); - } - - protected void Application_Error(object sender, EventArgs e) { - Logger.Error("An unhandled exception occurred in ASP.NET processing for page " + HttpContext.Current.Request.Path, Server.GetLastError()); - } - - protected void Application_End(object sender, EventArgs e) { - Logger.Info("Web application shutting down..."); - - // this would be automatic, but in partial trust scenarios it is not. - log4net.LogManager.Shutdown(); - } - } -}
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Models/AccountAuthorizeModel.cs b/projecttemplates/MvcRelyingParty/Models/AccountAuthorizeModel.cs deleted file mode 100644 index 686d481..0000000 --- a/projecttemplates/MvcRelyingParty/Models/AccountAuthorizeModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace MvcRelyingParty.Models { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - - using DotNetOpenAuth.OAuth2.Messages; - - public class AccountAuthorizeModel { - public string ClientApp { get; set; } - - public HashSet<string> Scope { get; set; } - - public EndUserAuthorizationRequest AuthorizationRequest { get; set; } - } -} diff --git a/projecttemplates/MvcRelyingParty/Models/AccountInfoModel.cs b/projecttemplates/MvcRelyingParty/Models/AccountInfoModel.cs deleted file mode 100644 index 6e005c4..0000000 --- a/projecttemplates/MvcRelyingParty/Models/AccountInfoModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace MvcRelyingParty.Models { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - using RelyingPartyLogic; - - public class AccountInfoModel { - public string FirstName { get; set; } - - public string LastName { get; set; } - - public string EmailAddress { get; set; } - - public IList<AuthorizedApp> AuthorizedApps { get; set; } - - public IList<AuthenticationToken> AuthenticationTokens { get; set; } - - public class AuthorizedApp { - public int AuthorizationId { get; set; } - - public string AppName { get; set; } - - public string Scope { get; set; } - } - } -} diff --git a/projecttemplates/MvcRelyingParty/MvcRelyingParty.csproj b/projecttemplates/MvcRelyingParty/MvcRelyingParty.csproj deleted file mode 100644 index 703f1c7..0000000 --- a/projecttemplates/MvcRelyingParty/MvcRelyingParty.csproj +++ /dev/null @@ -1,282 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))' != '' " /> - <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> - <PropertyGroup> - <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> - <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> - <IISExpressSSLPort /> - <IISExpressAnonymousAuthentication /> - <IISExpressWindowsAuthentication /> - <IISExpressUseClassicPipelineMode /> - <TargetFrameworkProfile /> - <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\src\</SolutionDir> - </PropertyGroup> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{152B7BAB-E884-4A59-8067-440971A682B3}</ProjectGuid> - <ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>MvcRelyingParty</RootNamespace> - <AssemblyName>MvcRelyingParty</AssemblyName> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> - <MvcBuildViews>false</MvcBuildViews> - <UseIISExpress>false</UseIISExpress> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> - </PropertyGroup> - <ItemGroup> - <Reference Include="log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\src\packages\log4net.2.0.0\lib\net40-full\log4net.dll</HintPath> - </Reference> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Data.DataSetExtensions" /> - <Reference Include="System.Data.Entity"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - </Reference> - <Reference Include="System.Net.Http" /> - <Reference Include="System.Net.Http.WebRequest" /> - <Reference Include="System.Web.ApplicationServices" /> - <Reference Include="System.Web.DynamicData" /> - <Reference Include="System.Web.Entity" /> - <Reference Include="System.Web.Extensions" /> - <Reference Include="System.Web.Mvc" /> - <Reference Include="System.Drawing" /> - <Reference Include="System.Web" /> - <Reference Include="System.Web.Abstractions" /> - <Reference Include="System.Web.Routing" /> - <Reference Include="System.Xml" /> - <Reference Include="System.Configuration" /> - <Reference Include="System.Web.Services" /> - <Reference Include="System.EnterpriseServices" /> - <Reference Include="System.Web.Mobile" /> - <Reference Include="System.Xml.Linq" /> - <Reference Include="Validation, Version=2.0.0.0, Culture=neutral, PublicKeyToken=2fc06f0d701809a7, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\src\packages\Validation.2.0.2.13022\lib\portable-windows8+net40+sl5+windowsphone8\Validation.dll</HintPath> - </Reference> - </ItemGroup> - <ItemGroup> - <Compile Include="Code\Extensions.cs" /> - <Compile Include="Code\FormsAuthenticationService.cs" /> - <Compile Include="Code\HttpHeaderAttribute.cs" /> - <Compile Include="Code\OpenIdRelyingPartyService.cs" /> - <Compile Include="Controllers\AccountController.cs" /> - <Compile Include="Controllers\AuthController.cs" /> - <Compile Include="Controllers\HomeController.cs" /> - <Compile Include="Default.aspx.cs"> - <DependentUpon>Default.aspx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="Global.asax.cs"> - <DependentUpon>Global.asax</DependentUpon> - </Compile> - <Compile Include="Models\AccountAuthorizeModel.cs" /> - <Compile Include="Models\AccountInfoModel.cs" /> - <Compile Include="OAuthTokenEndpoint.ashx.cs"> - <DependentUpon>OAuthTokenEndpoint.ashx</DependentUpon> - </Compile> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="Setup.aspx.cs"> - <DependentUpon>Setup.aspx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="Setup.aspx.designer.cs"> - <DependentUpon>Setup.aspx</DependentUpon> - </Compile> - </ItemGroup> - <ItemGroup> - <Content Include="Content\images\google.gif" /> - <Content Include="Content\images\myopenid.png" /> - <Content Include="Content\images\openid.png" /> - <Content Include="Content\images\openid_login.png" /> - <Content Include="Content\images\verisign.gif" /> - <Content Include="Content\images\yahoo.gif" /> - <Content Include="Content\images\yahoo_login.png" /> - <Content Include="Content\loginpopup.css" /> - <Content Include="Content\theme\images\ui-bg_flat_55_999999_40x100.png" /> - <Content Include="Content\theme\images\ui-bg_flat_75_aaaaaa_40x100.png" /> - <Content Include="Content\theme\images\ui-bg_glass_45_0078ae_1x400.png" /> - <Content Include="Content\theme\images\ui-bg_glass_55_f8da4e_1x400.png" /> - <Content Include="Content\theme\images\ui-bg_glass_75_79c9ec_1x400.png" /> - <Content Include="Content\theme\images\ui-bg_gloss-wave_45_e14f1c_500x100.png" /> - <Content Include="Content\theme\images\ui-bg_gloss-wave_50_6eac2c_500x100.png" /> - <Content Include="Content\theme\images\ui-bg_gloss-wave_75_2191c0_500x100.png" /> - <Content Include="Content\theme\images\ui-bg_inset-hard_100_fcfdfd_1x100.png" /> - <Content Include="Content\theme\images\ui-icons_0078ae_256x240.png" /> - <Content Include="Content\theme\images\ui-icons_056b93_256x240.png" /> - <Content Include="Content\theme\images\ui-icons_d8e7f3_256x240.png" /> - <Content Include="Content\theme\images\ui-icons_e0fdff_256x240.png" /> - <Content Include="Content\theme\images\ui-icons_f5e175_256x240.png" /> - <Content Include="Content\theme\images\ui-icons_f7a50d_256x240.png" /> - <Content Include="Content\theme\images\ui-icons_fcd113_256x240.png" /> - <Content Include="Content\theme\ui.accordion.css" /> - <Content Include="Content\theme\ui.all.css" /> - <Content Include="Content\theme\ui.base.css" /> - <Content Include="Content\theme\ui.core.css" /> - <Content Include="Content\theme\ui.datepicker.css" /> - <Content Include="Content\theme\ui.dialog.css" /> - <Content Include="Content\theme\ui.progressbar.css" /> - <Content Include="Content\theme\ui.resizable.css" /> - <Content Include="Content\theme\ui.slider.css" /> - <Content Include="Content\theme\ui.tabs.css" /> - <Content Include="Content\theme\ui.theme.css" /> - <Content Include="Default.aspx" /> - <Content Include="Getting Started.htm" /> - <Content Include="Global.asax" /> - <Content Include="Scripts\jquery-ui-personalized-1.6rc6.js" /> - <Content Include="Scripts\jquery-ui-personalized-1.6rc6.min.js" /> - <Content Include="Scripts\jquery.cookie.js" /> - <Content Include="Scripts\LoginLink.js" /> - <Content Include="Setup.aspx" /> - <Content Include="Views\Auth\LogOnScripts.ascx" /> - <Content Include="Views\Auth\LogOn.aspx" /> - <Content Include="Views\Auth\LogOnContent.ascx" /> - <Content Include="Views\Account\EditFields.ascx" /> - <Content Include="Views\Account\Edit.aspx" /> - <Content Include="Views\Home\PrivacyPolicy.aspx" /> - <Content Include="Web.config" /> - <Content Include="Content\Site.css" /> - <Content Include="Scripts\jquery-1.3.2.js" /> - <Content Include="Scripts\jquery-1.3.2.min.js" /> - <Content Include="Scripts\jquery-1.3.2-vsdoc.js" /> - <Content Include="Scripts\jquery-1.3.2.min-vsdoc.js" /> - <Content Include="Scripts\MicrosoftAjax.js" /> - <Content Include="Scripts\MicrosoftAjax.debug.js" /> - <Content Include="Scripts\MicrosoftMvcAjax.js" /> - <Content Include="Scripts\MicrosoftMvcAjax.debug.js" /> - <Content Include="Views\Auth\LogOnPopup.aspx" /> - <Content Include="Views\Home\About.aspx" /> - <Content Include="Views\Home\Index.aspx" /> - <Content Include="Views\Shared\Error.aspx" /> - <Content Include="Views\Shared\LogOnUserControl.ascx" /> - <Content Include="Views\Shared\Site.Master" /> - <Content Include="Views\Web.config" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\..\samples\DotNetOpenAuth.ApplicationBlock\DotNetOpenAuth.ApplicationBlock.csproj"> - <Project>{aa78d112-d889-414b-a7d4-467b34c7b663}</Project> - <Name>DotNetOpenAuth.ApplicationBlock</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.InfoCard.UI\DotNetOpenAuth.InfoCard.UI.csproj"> - <Project>{E040EB58-B4D2-457B-A023-AE6EF3BD34DE}</Project> - <Name>DotNetOpenAuth.InfoCard.UI</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.InfoCard\DotNetOpenAuth.InfoCard.csproj"> - <Project>{408D10B8-34BA-4CBD-B7AA-FEB1907ABA4C}</Project> - <Name>DotNetOpenAuth.InfoCard</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.Core\DotNetOpenAuth.Core.csproj"> - <Project>{60426312-6AE5-4835-8667-37EDEA670222}</Project> - <Name>DotNetOpenAuth.Core</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth2.AuthorizationServer\DotNetOpenAuth.OAuth2.AuthorizationServer.csproj"> - <Project>{99BB7543-EA16-43EE-A7BC-D7A25A3B22F6}</Project> - <Name>DotNetOpenAuth.OAuth2.AuthorizationServer</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth2.ClientAuthorization\DotNetOpenAuth.OAuth2.ClientAuthorization.csproj"> - <Project>{CCF3728A-B3D7-404A-9BC6-75197135F2D7}</Project> - <Name>DotNetOpenAuth.OAuth2.ClientAuthorization</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth2.ResourceServer\DotNetOpenAuth.OAuth2.ResourceServer.csproj"> - <Project>{A1A3150A-7B0E-4A34-8E35-045296CD3C76}</Project> - <Name>DotNetOpenAuth.OAuth2.ResourceServer</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth2\DotNetOpenAuth.OAuth2.csproj"> - <Project>{56459A6C-6BA2-4BAC-A9C0-27E3BD961FA6}</Project> - <Name>DotNetOpenAuth.OAuth2</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth\DotNetOpenAuth.OAuth.csproj"> - <Project>{A288FCC8-6FCF-46DA-A45E-5F9281556361}</Project> - <Name>DotNetOpenAuth.OAuth</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OpenId.RelyingParty.UI\DotNetOpenAuth.OpenId.RelyingParty.UI.csproj"> - <Project>{1ED8D424-F8AB-4050-ACEB-F27F4F909484}</Project> - <Name>DotNetOpenAuth.OpenId.RelyingParty.UI</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OpenId.RelyingParty\DotNetOpenAuth.OpenId.RelyingParty.csproj"> - <Project>{F458AB60-BA1C-43D9-8CEF-EC01B50BE87B}</Project> - <Name>DotNetOpenAuth.OpenId.RelyingParty</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OpenId.UI\DotNetOpenAuth.OpenId.UI.csproj"> - <Project>{75E13AAE-7D51-4421-ABFD-3F3DC91F576E}</Project> - <Name>DotNetOpenAuth.OpenId.UI</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OpenId\DotNetOpenAuth.OpenId.csproj"> - <Project>{3896A32A-E876-4C23-B9B8-78E17D134CD3}</Project> - <Name>DotNetOpenAuth.OpenId</Name> - </ProjectReference> - <ProjectReference Include="..\RelyingPartyLogic\RelyingPartyLogic.csproj"> - <Project>{17932639-1F50-48AF-B0A5-E2BF832F82CC}</Project> - <Name>RelyingPartyLogic</Name> - </ProjectReference> - </ItemGroup> - <ItemGroup> - <Content Include="Content\images\infocard_23x16.png" /> - <Content Include="Views\Account\AuthenticationTokens.ascx" /> - <Content Include="Views\Account\Authorize.aspx" /> - <Content Include="Views\Account\AuthorizedApps.ascx" /> - </ItemGroup> - <ItemGroup> - <Folder Include="App_Data\" /> - </ItemGroup> - <ItemGroup> - <Content Include="OAuthTokenEndpoint.ashx" /> - </ItemGroup> - <ItemGroup> - <Content Include="packages.config" /> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> - <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /> - <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> --> - <Target Name="AfterBuild" Condition="'$(MvcBuildViews)'=='true'"> - <AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)" /> - </Target> - <ProjectExtensions> - <VisualStudio> - <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> - <WebProjectProperties> - <UseIIS>False</UseIIS> - <AutoAssignPort>True</AutoAssignPort> - <DevelopmentServerPort>18916</DevelopmentServerPort> - <DevelopmentServerVPath>/</DevelopmentServerVPath> - <IISUrl> - </IISUrl> - <NTLMAuthentication>False</NTLMAuthentication> - <UseCustomServer>False</UseCustomServer> - <CustomServerUrl> - </CustomServerUrl> - <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> - </WebProjectProperties> - </FlavorProperties> - </VisualStudio> - </ProjectExtensions> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " /> - <Import Project="$(SolutionDir)\.nuget\nuget.targets" /> -</Project>
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/MvcRelyingParty.vstemplate b/projecttemplates/MvcRelyingParty/MvcRelyingParty.vstemplate deleted file mode 100644 index 2b608eb..0000000 --- a/projecttemplates/MvcRelyingParty/MvcRelyingParty.vstemplate +++ /dev/null @@ -1,13 +0,0 @@ -<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project"> - <TemplateData> - <Name>ASP.NET MVC OpenID-InfoCard RP</Name> - <Description>An ASP.NET MVC web site that accepts OpenID and InfoCard logins and acts as an OAuth service provider.</Description> - <ProjectType>CSharp</ProjectType> - <Icon>__TemplateIcon.ico</Icon> - </TemplateData> - <TemplateContent> - <Project File="MvcRelyingParty.csproj" ReplaceParameters="true"> - <ProjectItem OpenInWebBrowser="true">Getting Started.htm</ProjectItem> - </Project> - </TemplateContent> -</VSTemplate>
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/OAuthTokenEndpoint.ashx b/projecttemplates/MvcRelyingParty/OAuthTokenEndpoint.ashx deleted file mode 100644 index dc12aeb..0000000 --- a/projecttemplates/MvcRelyingParty/OAuthTokenEndpoint.ashx +++ /dev/null @@ -1 +0,0 @@ -<%@ WebHandler Language="C#" CodeBehind="OAuthTokenEndpoint.ashx.cs" Class="MvcRelyingParty.OAuthTokenEndpoint" %> diff --git a/projecttemplates/MvcRelyingParty/OAuthTokenEndpoint.ashx.cs b/projecttemplates/MvcRelyingParty/OAuthTokenEndpoint.ashx.cs deleted file mode 100644 index 190c1f8..0000000 --- a/projecttemplates/MvcRelyingParty/OAuthTokenEndpoint.ashx.cs +++ /dev/null @@ -1,46 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="OAuthTokenEndpoint.ashx.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace MvcRelyingParty { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Net.Http; - using System.Threading.Tasks; - using System.Web; - using System.Web.SessionState; - using DotNetOpenAuth.ApplicationBlock; - using DotNetOpenAuth.Messaging; - using DotNetOpenAuth.OAuth2; - using RelyingPartyLogic; - - /// <summary> - /// An OAuth 2.0 token endpoint. - /// </summary> - public class OAuthTokenEndpoint : HttpAsyncHandlerBase, IRequiresSessionState { - /// <summary> - /// Initializes a new instance of the <see cref="OAuthTokenEndpoint"/> class. - /// </summary> - public OAuthTokenEndpoint() { - } - - /// <summary> - /// Gets a value indicating whether another request can use the <see cref="T:System.Web.IHttpHandler"/> instance. - /// </summary> - /// <returns> - /// true if the <see cref="T:System.Web.IHttpHandler"/> instance is reusable; otherwise, false. - /// </returns> - public override bool IsReusable { - get { return true; } - } - - protected override async Task ProcessRequestAsync(HttpContext context) { - var serviceProvider = OAuthServiceProvider.AuthorizationServer; - var response = await serviceProvider.HandleTokenRequestAsync(new HttpRequestWrapper(context.Request), context.Response.ClientDisconnectedToken); - await response.SendAsync(new HttpContextWrapper(context), context.Response.ClientDisconnectedToken); - } - } -} diff --git a/projecttemplates/MvcRelyingParty/Properties/AssemblyInfo.cs b/projecttemplates/MvcRelyingParty/Properties/AssemblyInfo.cs deleted file mode 100644 index 50e9b20..0000000 --- a/projecttemplates/MvcRelyingParty/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MvcRelyingParty")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft IT")] -[assembly: AssemblyProduct("MvcRelyingParty")] -[assembly: AssemblyCopyright("Copyright © Microsoft IT 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("1f0f4283-5e2a-46af-bf01-19cb9a51e98a")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/projecttemplates/MvcRelyingParty/Scripts/LoginLink.js b/projecttemplates/MvcRelyingParty/Scripts/LoginLink.js deleted file mode 100644 index f76c1c9..0000000 --- a/projecttemplates/MvcRelyingParty/Scripts/LoginLink.js +++ /dev/null @@ -1,61 +0,0 @@ -$(function() { - var loginContent = '/Auth/LogOnPopup'; - var popupWindowName = 'openidlogin'; - var popupWidth = 365; - var popupHeight = 205; // use 205 for 1 row of OP buttons, or 273 for 2 rows - var iframe; - - { - var div = window.document.createElement('div'); - div.style.padding = 0; - div.id = 'loginDialog'; - - iframe = window.document.createElement('iframe'); - iframe.src = "about:blank"; // don't set the actual page yet, since FireFox & Chrome will refresh it when the iframe is moved in the DOM anyway. - iframe.frameBorder = 0; - iframe.width = popupWidth; - iframe.height = popupHeight; - div.appendChild(iframe); - - window.document.body.appendChild(div); - } - - $(document).ready(function() { - $("#loginDialog").dialog({ - bgiframe: true, - modal: true, - title: 'Login or register', - resizable: false, - hide: 'clip', - width: popupWidth, - height: popupHeight + 50, - buttons: {}, - closeOnEscape: true, - autoOpen: false, - close: function(event, ui) { - // Clear the URL so Chrome/Firefox don't refresh the iframe when it's hidden. - iframe.src = "about:blank"; - }, - open: function(event, ui) { - iframe.src = loginContent; - }, - focus: function(event, ui) { - // var box = $('#openid_identifier')[0]; - // if (box.style.display != 'none') { - // box.focus(); - // } - } - }); - - $('.loginPopupLink').click(function() { - $("#loginDialog").dialog('open'); - }); - $('.loginWindowLink').click(function() { - if (window.showModalDialog) { - window.showModalDialog(loginContent, popupWindowName, 'status:0;resizable:1;scroll:1;center:1;dialogHeight:' + popupHeight + 'px;dialogWidth:' + popupWidth + 'px'); - } else { - window.open(loginContent, popupWindowName, 'modal=yes,status=0,location=1,toolbar=0,menubar=0,resizable=0,scrollbars=0,height=' + popupHeight + 'px,width=' + popupWidth + 'px'); - } - }); - }); -}); diff --git a/projecttemplates/MvcRelyingParty/Scripts/MicrosoftAjax.debug.js b/projecttemplates/MvcRelyingParty/Scripts/MicrosoftAjax.debug.js deleted file mode 100644 index 7b7de62..0000000 --- a/projecttemplates/MvcRelyingParty/Scripts/MicrosoftAjax.debug.js +++ /dev/null @@ -1,6850 +0,0 @@ -// Name: MicrosoftAjax.debug.js -// Assembly: System.Web.Extensions -// Version: 3.5.0.0 -// FileVersion: 3.5.30729.1 -//----------------------------------------------------------------------- -// Copyright (C) Microsoft Corporation. All rights reserved. -//----------------------------------------------------------------------- -// MicrosoftAjax.js -// Microsoft AJAX Framework. - -Function.__typeName = 'Function'; -Function.__class = true; -Function.createCallback = function Function$createCallback(method, context) { - /// <summary locid="M:J#Function.createCallback" /> - /// <param name="method" type="Function"></param> - /// <param name="context" mayBeNull="true"></param> - /// <returns type="Function"></returns> - var e = Function._validateParams(arguments, [ - {name: "method", type: Function}, - {name: "context", mayBeNull: true} - ]); - if (e) throw e; - return function() { - var l = arguments.length; - if (l > 0) { - var args = []; - for (var i = 0; i < l; i++) { - args[i] = arguments[i]; - } - args[l] = context; - return method.apply(this, args); - } - return method.call(this, context); - } -} -Function.createDelegate = function Function$createDelegate(instance, method) { - /// <summary locid="M:J#Function.createDelegate" /> - /// <param name="instance" mayBeNull="true"></param> - /// <param name="method" type="Function"></param> - /// <returns type="Function"></returns> - var e = Function._validateParams(arguments, [ - {name: "instance", mayBeNull: true}, - {name: "method", type: Function} - ]); - if (e) throw e; - return function() { - return method.apply(instance, arguments); - } -} -Function.emptyFunction = Function.emptyMethod = function Function$emptyMethod() { - /// <summary locid="M:J#Function.emptyMethod" /> - if (arguments.length !== 0) throw Error.parameterCount(); -} -Function._validateParams = function Function$_validateParams(params, expectedParams) { - var e; - e = Function._validateParameterCount(params, expectedParams); - if (e) { - e.popStackFrame(); - return e; - } - for (var i=0; i < params.length; i++) { - var expectedParam = expectedParams[Math.min(i, expectedParams.length - 1)]; - var paramName = expectedParam.name; - if (expectedParam.parameterArray) { - paramName += "[" + (i - expectedParams.length + 1) + "]"; - } - e = Function._validateParameter(params[i], expectedParam, paramName); - if (e) { - e.popStackFrame(); - return e; - } - } - return null; -} -Function._validateParameterCount = function Function$_validateParameterCount(params, expectedParams) { - var maxParams = expectedParams.length; - var minParams = 0; - for (var i=0; i < expectedParams.length; i++) { - if (expectedParams[i].parameterArray) { - maxParams = Number.MAX_VALUE; - } - else if (!expectedParams[i].optional) { - minParams++; - } - } - if (params.length < minParams || params.length > maxParams) { - var e = Error.parameterCount(); - e.popStackFrame(); - return e; - } - return null; -} -Function._validateParameter = function Function$_validateParameter(param, expectedParam, paramName) { - var e; - var expectedType = expectedParam.type; - var expectedInteger = !!expectedParam.integer; - var expectedDomElement = !!expectedParam.domElement; - var mayBeNull = !!expectedParam.mayBeNull; - e = Function._validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName); - if (e) { - e.popStackFrame(); - return e; - } - var expectedElementType = expectedParam.elementType; - var elementMayBeNull = !!expectedParam.elementMayBeNull; - if (expectedType === Array && typeof(param) !== "undefined" && param !== null && - (expectedElementType || !elementMayBeNull)) { - var expectedElementInteger = !!expectedParam.elementInteger; - var expectedElementDomElement = !!expectedParam.elementDomElement; - for (var i=0; i < param.length; i++) { - var elem = param[i]; - e = Function._validateParameterType(elem, expectedElementType, - expectedElementInteger, expectedElementDomElement, elementMayBeNull, - paramName + "[" + i + "]"); - if (e) { - e.popStackFrame(); - return e; - } - } - } - return null; -} -Function._validateParameterType = function Function$_validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName) { - var e; - if (typeof(param) === "undefined") { - if (mayBeNull) { - return null; - } - else { - e = Error.argumentUndefined(paramName); - e.popStackFrame(); - return e; - } - } - if (param === null) { - if (mayBeNull) { - return null; - } - else { - e = Error.argumentNull(paramName); - e.popStackFrame(); - return e; - } - } - if (expectedType && expectedType.__enum) { - if (typeof(param) !== 'number') { - e = Error.argumentType(paramName, Object.getType(param), expectedType); - e.popStackFrame(); - return e; - } - if ((param % 1) === 0) { - var values = expectedType.prototype; - if (!expectedType.__flags || (param === 0)) { - for (var i in values) { - if (values[i] === param) return null; - } - } - else { - var v = param; - for (var i in values) { - var vali = values[i]; - if (vali === 0) continue; - if ((vali & param) === vali) { - v -= vali; - } - if (v === 0) return null; - } - } - } - e = Error.argumentOutOfRange(paramName, param, String.format(Sys.Res.enumInvalidValue, param, expectedType.getName())); - e.popStackFrame(); - return e; - } - if (expectedDomElement) { - var val; - if (typeof(param.nodeType) !== 'number') { - var doc = param.ownerDocument || param.document || param; - if (doc != param) { - var w = doc.defaultView || doc.parentWindow; - val = (w != param) && !(w.document && param.document && (w.document === param.document)); - } - else { - val = (typeof(doc.body) === 'undefined'); - } - } - else { - val = (param.nodeType === 3); - } - if (val) { - e = Error.argument(paramName, Sys.Res.argumentDomElement); - e.popStackFrame(); - return e; - } - } - if (expectedType && !expectedType.isInstanceOfType(param)) { - e = Error.argumentType(paramName, Object.getType(param), expectedType); - e.popStackFrame(); - return e; - } - if (expectedType === Number && expectedInteger) { - if ((param % 1) !== 0) { - e = Error.argumentOutOfRange(paramName, param, Sys.Res.argumentInteger); - e.popStackFrame(); - return e; - } - } - return null; -} - -Error.__typeName = 'Error'; -Error.__class = true; -Error.create = function Error$create(message, errorInfo) { - /// <summary locid="M:J#Error.create" /> - /// <param name="message" type="String" optional="true" mayBeNull="true"></param> - /// <param name="errorInfo" optional="true" mayBeNull="true"></param> - /// <returns type="Error"></returns> - var e = Function._validateParams(arguments, [ - {name: "message", type: String, mayBeNull: true, optional: true}, - {name: "errorInfo", mayBeNull: true, optional: true} - ]); - if (e) throw e; - var e = new Error(message); - e.message = message; - if (errorInfo) { - for (var v in errorInfo) { - e[v] = errorInfo[v]; - } - } - e.popStackFrame(); - return e; -} -Error.argument = function Error$argument(paramName, message) { - /// <summary locid="M:J#Error.argument" /> - /// <param name="paramName" type="String" optional="true" mayBeNull="true"></param> - /// <param name="message" type="String" optional="true" mayBeNull="true"></param> - /// <returns></returns> - var e = Function._validateParams(arguments, [ - {name: "paramName", type: String, mayBeNull: true, optional: true}, - {name: "message", type: String, mayBeNull: true, optional: true} - ]); - if (e) throw e; - var displayMessage = "Sys.ArgumentException: " + (message ? message : Sys.Res.argument); - if (paramName) { - displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); - } - var e = Error.create(displayMessage, { name: "Sys.ArgumentException", paramName: paramName }); - e.popStackFrame(); - return e; -} -Error.argumentNull = function Error$argumentNull(paramName, message) { - /// <summary locid="M:J#Error.argumentNull" /> - /// <param name="paramName" type="String" optional="true" mayBeNull="true"></param> - /// <param name="message" type="String" optional="true" mayBeNull="true"></param> - /// <returns></returns> - var e = Function._validateParams(arguments, [ - {name: "paramName", type: String, mayBeNull: true, optional: true}, - {name: "message", type: String, mayBeNull: true, optional: true} - ]); - if (e) throw e; - var displayMessage = "Sys.ArgumentNullException: " + (message ? message : Sys.Res.argumentNull); - if (paramName) { - displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); - } - var e = Error.create(displayMessage, { name: "Sys.ArgumentNullException", paramName: paramName }); - e.popStackFrame(); - return e; -} -Error.argumentOutOfRange = function Error$argumentOutOfRange(paramName, actualValue, message) { - /// <summary locid="M:J#Error.argumentOutOfRange" /> - /// <param name="paramName" type="String" optional="true" mayBeNull="true"></param> - /// <param name="actualValue" optional="true" mayBeNull="true"></param> - /// <param name="message" type="String" optional="true" mayBeNull="true"></param> - /// <returns></returns> - var e = Function._validateParams(arguments, [ - {name: "paramName", type: String, mayBeNull: true, optional: true}, - {name: "actualValue", mayBeNull: true, optional: true}, - {name: "message", type: String, mayBeNull: true, optional: true} - ]); - if (e) throw e; - var displayMessage = "Sys.ArgumentOutOfRangeException: " + (message ? message : Sys.Res.argumentOutOfRange); - if (paramName) { - displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); - } - if (typeof(actualValue) !== "undefined" && actualValue !== null) { - displayMessage += "\n" + String.format(Sys.Res.actualValue, actualValue); - } - var e = Error.create(displayMessage, { - name: "Sys.ArgumentOutOfRangeException", - paramName: paramName, - actualValue: actualValue - }); - e.popStackFrame(); - return e; -} -Error.argumentType = function Error$argumentType(paramName, actualType, expectedType, message) { - /// <summary locid="M:J#Error.argumentType" /> - /// <param name="paramName" type="String" optional="true" mayBeNull="true"></param> - /// <param name="actualType" type="Type" optional="true" mayBeNull="true"></param> - /// <param name="expectedType" type="Type" optional="true" mayBeNull="true"></param> - /// <param name="message" type="String" optional="true" mayBeNull="true"></param> - /// <returns></returns> - var e = Function._validateParams(arguments, [ - {name: "paramName", type: String, mayBeNull: true, optional: true}, - {name: "actualType", type: Type, mayBeNull: true, optional: true}, - {name: "expectedType", type: Type, mayBeNull: true, optional: true}, - {name: "message", type: String, mayBeNull: true, optional: true} - ]); - if (e) throw e; - var displayMessage = "Sys.ArgumentTypeException: "; - if (message) { - displayMessage += message; - } - else if (actualType && expectedType) { - displayMessage += - String.format(Sys.Res.argumentTypeWithTypes, actualType.getName(), expectedType.getName()); - } - else { - displayMessage += Sys.Res.argumentType; - } - if (paramName) { - displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); - } - var e = Error.create(displayMessage, { - name: "Sys.ArgumentTypeException", - paramName: paramName, - actualType: actualType, - expectedType: expectedType - }); - e.popStackFrame(); - return e; -} -Error.argumentUndefined = function Error$argumentUndefined(paramName, message) { - /// <summary locid="M:J#Error.argumentUndefined" /> - /// <param name="paramName" type="String" optional="true" mayBeNull="true"></param> - /// <param name="message" type="String" optional="true" mayBeNull="true"></param> - /// <returns></returns> - var e = Function._validateParams(arguments, [ - {name: "paramName", type: String, mayBeNull: true, optional: true}, - {name: "message", type: String, mayBeNull: true, optional: true} - ]); - if (e) throw e; - var displayMessage = "Sys.ArgumentUndefinedException: " + (message ? message : Sys.Res.argumentUndefined); - if (paramName) { - displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); - } - var e = Error.create(displayMessage, { name: "Sys.ArgumentUndefinedException", paramName: paramName }); - e.popStackFrame(); - return e; -} -Error.format = function Error$format(message) { - /// <summary locid="M:J#Error.format" /> - /// <param name="message" type="String" optional="true" mayBeNull="true"></param> - /// <returns></returns> - var e = Function._validateParams(arguments, [ - {name: "message", type: String, mayBeNull: true, optional: true} - ]); - if (e) throw e; - var displayMessage = "Sys.FormatException: " + (message ? message : Sys.Res.format); - var e = Error.create(displayMessage, {name: 'Sys.FormatException'}); - e.popStackFrame(); - return e; -} -Error.invalidOperation = function Error$invalidOperation(message) { - /// <summary locid="M:J#Error.invalidOperation" /> - /// <param name="message" type="String" optional="true" mayBeNull="true"></param> - /// <returns></returns> - var e = Function._validateParams(arguments, [ - {name: "message", type: String, mayBeNull: true, optional: true} - ]); - if (e) throw e; - var displayMessage = "Sys.InvalidOperationException: " + (message ? message : Sys.Res.invalidOperation); - var e = Error.create(displayMessage, {name: 'Sys.InvalidOperationException'}); - e.popStackFrame(); - return e; -} -Error.notImplemented = function Error$notImplemented(message) { - /// <summary locid="M:J#Error.notImplemented" /> - /// <param name="message" type="String" optional="true" mayBeNull="true"></param> - /// <returns></returns> - var e = Function._validateParams(arguments, [ - {name: "message", type: String, mayBeNull: true, optional: true} - ]); - if (e) throw e; - var displayMessage = "Sys.NotImplementedException: " + (message ? message : Sys.Res.notImplemented); - var e = Error.create(displayMessage, {name: 'Sys.NotImplementedException'}); - e.popStackFrame(); - return e; -} -Error.parameterCount = function Error$parameterCount(message) { - /// <summary locid="M:J#Error.parameterCount" /> - /// <param name="message" type="String" optional="true" mayBeNull="true"></param> - /// <returns></returns> - var e = Function._validateParams(arguments, [ - {name: "message", type: String, mayBeNull: true, optional: true} - ]); - if (e) throw e; - var displayMessage = "Sys.ParameterCountException: " + (message ? message : Sys.Res.parameterCount); - var e = Error.create(displayMessage, {name: 'Sys.ParameterCountException'}); - e.popStackFrame(); - return e; -} -Error.prototype.popStackFrame = function Error$popStackFrame() { - /// <summary locid="M:J#checkParam" /> - if (arguments.length !== 0) throw Error.parameterCount(); - if (typeof(this.stack) === "undefined" || this.stack === null || - typeof(this.fileName) === "undefined" || this.fileName === null || - typeof(this.lineNumber) === "undefined" || this.lineNumber === null) { - return; - } - var stackFrames = this.stack.split("\n"); - var currentFrame = stackFrames[0]; - var pattern = this.fileName + ":" + this.lineNumber; - while(typeof(currentFrame) !== "undefined" && - currentFrame !== null && - currentFrame.indexOf(pattern) === -1) { - stackFrames.shift(); - currentFrame = stackFrames[0]; - } - var nextFrame = stackFrames[1]; - if (typeof(nextFrame) === "undefined" || nextFrame === null) { - return; - } - var nextFrameParts = nextFrame.match(/@(.*):(\d+)$/); - if (typeof(nextFrameParts) === "undefined" || nextFrameParts === null) { - return; - } - this.fileName = nextFrameParts[1]; - this.lineNumber = parseInt(nextFrameParts[2]); - stackFrames.shift(); - this.stack = stackFrames.join("\n"); -} - -Object.__typeName = 'Object'; -Object.__class = true; -Object.getType = function Object$getType(instance) { - /// <summary locid="M:J#Object.getType" /> - /// <param name="instance"></param> - /// <returns type="Type"></returns> - var e = Function._validateParams(arguments, [ - {name: "instance"} - ]); - if (e) throw e; - var ctor = instance.constructor; - if (!ctor || (typeof(ctor) !== "function") || !ctor.__typeName || (ctor.__typeName === 'Object')) { - return Object; - } - return ctor; -} -Object.getTypeName = function Object$getTypeName(instance) { - /// <summary locid="M:J#Object.getTypeName" /> - /// <param name="instance"></param> - /// <returns type="String"></returns> - var e = Function._validateParams(arguments, [ - {name: "instance"} - ]); - if (e) throw e; - return Object.getType(instance).getName(); -} - -String.__typeName = 'String'; -String.__class = true; -String.prototype.endsWith = function String$endsWith(suffix) { - /// <summary locid="M:J#String.endsWith" /> - /// <param name="suffix" type="String"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "suffix", type: String} - ]); - if (e) throw e; - return (this.substr(this.length - suffix.length) === suffix); -} -String.prototype.startsWith = function String$startsWith(prefix) { - /// <summary locid="M:J#String.startsWith" /> - /// <param name="prefix" type="String"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "prefix", type: String} - ]); - if (e) throw e; - return (this.substr(0, prefix.length) === prefix); -} -String.prototype.trim = function String$trim() { - /// <summary locid="M:J#String.trim" /> - /// <returns type="String"></returns> - if (arguments.length !== 0) throw Error.parameterCount(); - return this.replace(/^\s+|\s+$/g, ''); -} -String.prototype.trimEnd = function String$trimEnd() { - /// <summary locid="M:J#String.trimEnd" /> - /// <returns type="String"></returns> - if (arguments.length !== 0) throw Error.parameterCount(); - return this.replace(/\s+$/, ''); -} -String.prototype.trimStart = function String$trimStart() { - /// <summary locid="M:J#String.trimStart" /> - /// <returns type="String"></returns> - if (arguments.length !== 0) throw Error.parameterCount(); - return this.replace(/^\s+/, ''); -} -String.format = function String$format(format, args) { - /// <summary locid="M:J#String.format" /> - /// <param name="format" type="String"></param> - /// <param name="args" parameterArray="true" mayBeNull="true"></param> - /// <returns type="String"></returns> - var e = Function._validateParams(arguments, [ - {name: "format", type: String}, - {name: "args", mayBeNull: true, parameterArray: true} - ]); - if (e) throw e; - return String._toFormattedString(false, arguments); -} -String.localeFormat = function String$localeFormat(format, args) { - /// <summary locid="M:J#String.localeFormat" /> - /// <param name="format" type="String"></param> - /// <param name="args" parameterArray="true" mayBeNull="true"></param> - /// <returns type="String"></returns> - var e = Function._validateParams(arguments, [ - {name: "format", type: String}, - {name: "args", mayBeNull: true, parameterArray: true} - ]); - if (e) throw e; - return String._toFormattedString(true, arguments); -} -String._toFormattedString = function String$_toFormattedString(useLocale, args) { - var result = ''; - var format = args[0]; - for (var i=0;;) { - var open = format.indexOf('{', i); - var close = format.indexOf('}', i); - if ((open < 0) && (close < 0)) { - result += format.slice(i); - break; - } - if ((close > 0) && ((close < open) || (open < 0))) { - if (format.charAt(close + 1) !== '}') { - throw Error.argument('format', Sys.Res.stringFormatBraceMismatch); - } - result += format.slice(i, close + 1); - i = close + 2; - continue; - } - result += format.slice(i, open); - i = open + 1; - if (format.charAt(i) === '{') { - result += '{'; - i++; - continue; - } - if (close < 0) throw Error.argument('format', Sys.Res.stringFormatBraceMismatch); - var brace = format.substring(i, close); - var colonIndex = brace.indexOf(':'); - var argNumber = parseInt((colonIndex < 0)? brace : brace.substring(0, colonIndex), 10) + 1; - if (isNaN(argNumber)) throw Error.argument('format', Sys.Res.stringFormatInvalid); - var argFormat = (colonIndex < 0)? '' : brace.substring(colonIndex + 1); - var arg = args[argNumber]; - if (typeof(arg) === "undefined" || arg === null) { - arg = ''; - } - if (arg.toFormattedString) { - result += arg.toFormattedString(argFormat); - } - else if (useLocale && arg.localeFormat) { - result += arg.localeFormat(argFormat); - } - else if (arg.format) { - result += arg.format(argFormat); - } - else - result += arg.toString(); - i = close + 1; - } - return result; -} - -Boolean.__typeName = 'Boolean'; -Boolean.__class = true; -Boolean.parse = function Boolean$parse(value) { - /// <summary locid="M:J#Boolean.parse" /> - /// <param name="value" type="String"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "value", type: String} - ]); - if (e) throw e; - var v = value.trim().toLowerCase(); - if (v === 'false') return false; - if (v === 'true') return true; - throw Error.argumentOutOfRange('value', value, Sys.Res.boolTrueOrFalse); -} - -Date.__typeName = 'Date'; -Date.__class = true; -Date._appendPreOrPostMatch = function Date$_appendPreOrPostMatch(preMatch, strBuilder) { - var quoteCount = 0; - var escaped = false; - for (var i = 0, il = preMatch.length; i < il; i++) { - var c = preMatch.charAt(i); - switch (c) { - case '\'': - if (escaped) strBuilder.append("'"); - else quoteCount++; - escaped = false; - break; - case '\\': - if (escaped) strBuilder.append("\\"); - escaped = !escaped; - break; - default: - strBuilder.append(c); - escaped = false; - break; - } - } - return quoteCount; -} -Date._expandFormat = function Date$_expandFormat(dtf, format) { - if (!format) { - format = "F"; - } - if (format.length === 1) { - switch (format) { - case "d": - return dtf.ShortDatePattern; - case "D": - return dtf.LongDatePattern; - case "t": - return dtf.ShortTimePattern; - case "T": - return dtf.LongTimePattern; - case "F": - return dtf.FullDateTimePattern; - case "M": case "m": - return dtf.MonthDayPattern; - case "s": - return dtf.SortableDateTimePattern; - case "Y": case "y": - return dtf.YearMonthPattern; - default: - throw Error.format(Sys.Res.formatInvalidString); - } - } - return format; -} -Date._expandYear = function Date$_expandYear(dtf, year) { - if (year < 100) { - var curr = new Date().getFullYear(); - year += curr - (curr % 100); - if (year > dtf.Calendar.TwoDigitYearMax) { - return year - 100; - } - } - return year; -} -Date._getParseRegExp = function Date$_getParseRegExp(dtf, format) { - if (!dtf._parseRegExp) { - dtf._parseRegExp = {}; - } - else if (dtf._parseRegExp[format]) { - return dtf._parseRegExp[format]; - } - var expFormat = Date._expandFormat(dtf, format); - expFormat = expFormat.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g, "\\\\$1"); - var regexp = new Sys.StringBuilder("^"); - var groups = []; - var index = 0; - var quoteCount = 0; - var tokenRegExp = Date._getTokenRegExp(); - var match; - while ((match = tokenRegExp.exec(expFormat)) !== null) { - var preMatch = expFormat.slice(index, match.index); - index = tokenRegExp.lastIndex; - quoteCount += Date._appendPreOrPostMatch(preMatch, regexp); - if ((quoteCount%2) === 1) { - regexp.append(match[0]); - continue; - } - switch (match[0]) { - case 'dddd': case 'ddd': - case 'MMMM': case 'MMM': - regexp.append("(\\D+)"); - break; - case 'tt': case 't': - regexp.append("(\\D*)"); - break; - case 'yyyy': - regexp.append("(\\d{4})"); - break; - case 'fff': - regexp.append("(\\d{3})"); - break; - case 'ff': - regexp.append("(\\d{2})"); - break; - case 'f': - regexp.append("(\\d)"); - break; - case 'dd': case 'd': - case 'MM': case 'M': - case 'yy': case 'y': - case 'HH': case 'H': - case 'hh': case 'h': - case 'mm': case 'm': - case 'ss': case 's': - regexp.append("(\\d\\d?)"); - break; - case 'zzz': - regexp.append("([+-]?\\d\\d?:\\d{2})"); - break; - case 'zz': case 'z': - regexp.append("([+-]?\\d\\d?)"); - break; - } - Array.add(groups, match[0]); - } - Date._appendPreOrPostMatch(expFormat.slice(index), regexp); - regexp.append("$"); - var regexpStr = regexp.toString().replace(/\s+/g, "\\s+"); - var parseRegExp = {'regExp': regexpStr, 'groups': groups}; - dtf._parseRegExp[format] = parseRegExp; - return parseRegExp; -} -Date._getTokenRegExp = function Date$_getTokenRegExp() { - return /dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z/g; -} -Date.parseLocale = function Date$parseLocale(value, formats) { - /// <summary locid="M:J#Date.parseLocale" /> - /// <param name="value" type="String"></param> - /// <param name="formats" parameterArray="true" optional="true" mayBeNull="true"></param> - /// <returns type="Date"></returns> - var e = Function._validateParams(arguments, [ - {name: "value", type: String}, - {name: "formats", mayBeNull: true, optional: true, parameterArray: true} - ]); - if (e) throw e; - return Date._parse(value, Sys.CultureInfo.CurrentCulture, arguments); -} -Date.parseInvariant = function Date$parseInvariant(value, formats) { - /// <summary locid="M:J#Date.parseInvariant" /> - /// <param name="value" type="String"></param> - /// <param name="formats" parameterArray="true" optional="true" mayBeNull="true"></param> - /// <returns type="Date"></returns> - var e = Function._validateParams(arguments, [ - {name: "value", type: String}, - {name: "formats", mayBeNull: true, optional: true, parameterArray: true} - ]); - if (e) throw e; - return Date._parse(value, Sys.CultureInfo.InvariantCulture, arguments); -} -Date._parse = function Date$_parse(value, cultureInfo, args) { - var custom = false; - for (var i = 1, il = args.length; i < il; i++) { - var format = args[i]; - if (format) { - custom = true; - var date = Date._parseExact(value, format, cultureInfo); - if (date) return date; - } - } - if (! custom) { - var formats = cultureInfo._getDateTimeFormats(); - for (var i = 0, il = formats.length; i < il; i++) { - var date = Date._parseExact(value, formats[i], cultureInfo); - if (date) return date; - } - } - return null; -} -Date._parseExact = function Date$_parseExact(value, format, cultureInfo) { - value = value.trim(); - var dtf = cultureInfo.dateTimeFormat; - var parseInfo = Date._getParseRegExp(dtf, format); - var match = new RegExp(parseInfo.regExp).exec(value); - if (match === null) return null; - - var groups = parseInfo.groups; - var year = null, month = null, date = null, weekDay = null; - var hour = 0, min = 0, sec = 0, msec = 0, tzMinOffset = null; - var pmHour = false; - for (var j = 0, jl = groups.length; j < jl; j++) { - var matchGroup = match[j+1]; - if (matchGroup) { - switch (groups[j]) { - case 'dd': case 'd': - date = parseInt(matchGroup, 10); - if ((date < 1) || (date > 31)) return null; - break; - case 'MMMM': - month = cultureInfo._getMonthIndex(matchGroup); - if ((month < 0) || (month > 11)) return null; - break; - case 'MMM': - month = cultureInfo._getAbbrMonthIndex(matchGroup); - if ((month < 0) || (month > 11)) return null; - break; - case 'M': case 'MM': - var month = parseInt(matchGroup, 10) - 1; - if ((month < 0) || (month > 11)) return null; - break; - case 'y': case 'yy': - year = Date._expandYear(dtf,parseInt(matchGroup, 10)); - if ((year < 0) || (year > 9999)) return null; - break; - case 'yyyy': - year = parseInt(matchGroup, 10); - if ((year < 0) || (year > 9999)) return null; - break; - case 'h': case 'hh': - hour = parseInt(matchGroup, 10); - if (hour === 12) hour = 0; - if ((hour < 0) || (hour > 11)) return null; - break; - case 'H': case 'HH': - hour = parseInt(matchGroup, 10); - if ((hour < 0) || (hour > 23)) return null; - break; - case 'm': case 'mm': - min = parseInt(matchGroup, 10); - if ((min < 0) || (min > 59)) return null; - break; - case 's': case 'ss': - sec = parseInt(matchGroup, 10); - if ((sec < 0) || (sec > 59)) return null; - break; - case 'tt': case 't': - var upperToken = matchGroup.toUpperCase(); - pmHour = (upperToken === dtf.PMDesignator.toUpperCase()); - if (!pmHour && (upperToken !== dtf.AMDesignator.toUpperCase())) return null; - break; - case 'f': - msec = parseInt(matchGroup, 10) * 100; - if ((msec < 0) || (msec > 999)) return null; - break; - case 'ff': - msec = parseInt(matchGroup, 10) * 10; - if ((msec < 0) || (msec > 999)) return null; - break; - case 'fff': - msec = parseInt(matchGroup, 10); - if ((msec < 0) || (msec > 999)) return null; - break; - case 'dddd': - weekDay = cultureInfo._getDayIndex(matchGroup); - if ((weekDay < 0) || (weekDay > 6)) return null; - break; - case 'ddd': - weekDay = cultureInfo._getAbbrDayIndex(matchGroup); - if ((weekDay < 0) || (weekDay > 6)) return null; - break; - case 'zzz': - var offsets = matchGroup.split(/:/); - if (offsets.length !== 2) return null; - var hourOffset = parseInt(offsets[0], 10); - if ((hourOffset < -12) || (hourOffset > 13)) return null; - var minOffset = parseInt(offsets[1], 10); - if ((minOffset < 0) || (minOffset > 59)) return null; - tzMinOffset = (hourOffset * 60) + (matchGroup.startsWith('-')? -minOffset : minOffset); - break; - case 'z': case 'zz': - var hourOffset = parseInt(matchGroup, 10); - if ((hourOffset < -12) || (hourOffset > 13)) return null; - tzMinOffset = hourOffset * 60; - break; - } - } - } - var result = new Date(); - if (year === null) { - year = result.getFullYear(); - } - if (month === null) { - month = result.getMonth(); - } - if (date === null) { - date = result.getDate(); - } - result.setFullYear(year, month, date); - if (result.getDate() !== date) return null; - if ((weekDay !== null) && (result.getDay() !== weekDay)) { - return null; - } - if (pmHour && (hour < 12)) { - hour += 12; - } - result.setHours(hour, min, sec, msec); - if (tzMinOffset !== null) { - var adjustedMin = result.getMinutes() - (tzMinOffset + result.getTimezoneOffset()); - result.setHours(result.getHours() + parseInt(adjustedMin/60, 10), adjustedMin%60); - } - return result; -} -Date.prototype.format = function Date$format(format) { - /// <summary locid="M:J#Date.format" /> - /// <param name="format" type="String"></param> - /// <returns type="String"></returns> - var e = Function._validateParams(arguments, [ - {name: "format", type: String} - ]); - if (e) throw e; - return this._toFormattedString(format, Sys.CultureInfo.InvariantCulture); -} -Date.prototype.localeFormat = function Date$localeFormat(format) { - /// <summary locid="M:J#Date.localeFormat" /> - /// <param name="format" type="String"></param> - /// <returns type="String"></returns> - var e = Function._validateParams(arguments, [ - {name: "format", type: String} - ]); - if (e) throw e; - return this._toFormattedString(format, Sys.CultureInfo.CurrentCulture); -} -Date.prototype._toFormattedString = function Date$_toFormattedString(format, cultureInfo) { - if (!format || (format.length === 0) || (format === 'i')) { - if (cultureInfo && (cultureInfo.name.length > 0)) { - return this.toLocaleString(); - } - else { - return this.toString(); - } - } - var dtf = cultureInfo.dateTimeFormat; - format = Date._expandFormat(dtf, format); - var ret = new Sys.StringBuilder(); - var hour; - function addLeadingZero(num) { - if (num < 10) { - return '0' + num; - } - return num.toString(); - } - function addLeadingZeros(num) { - if (num < 10) { - return '00' + num; - } - if (num < 100) { - return '0' + num; - } - return num.toString(); - } - var quoteCount = 0; - var tokenRegExp = Date._getTokenRegExp(); - for (;;) { - var index = tokenRegExp.lastIndex; - var ar = tokenRegExp.exec(format); - var preMatch = format.slice(index, ar ? ar.index : format.length); - quoteCount += Date._appendPreOrPostMatch(preMatch, ret); - if (!ar) break; - if ((quoteCount%2) === 1) { - ret.append(ar[0]); - continue; - } - switch (ar[0]) { - case "dddd": - ret.append(dtf.DayNames[this.getDay()]); - break; - case "ddd": - ret.append(dtf.AbbreviatedDayNames[this.getDay()]); - break; - case "dd": - ret.append(addLeadingZero(this.getDate())); - break; - case "d": - ret.append(this.getDate()); - break; - case "MMMM": - ret.append(dtf.MonthNames[this.getMonth()]); - break; - case "MMM": - ret.append(dtf.AbbreviatedMonthNames[this.getMonth()]); - break; - case "MM": - ret.append(addLeadingZero(this.getMonth() + 1)); - break; - case "M": - ret.append(this.getMonth() + 1); - break; - case "yyyy": - ret.append(this.getFullYear()); - break; - case "yy": - ret.append(addLeadingZero(this.getFullYear() % 100)); - break; - case "y": - ret.append(this.getFullYear() % 100); - break; - case "hh": - hour = this.getHours() % 12; - if (hour === 0) hour = 12; - ret.append(addLeadingZero(hour)); - break; - case "h": - hour = this.getHours() % 12; - if (hour === 0) hour = 12; - ret.append(hour); - break; - case "HH": - ret.append(addLeadingZero(this.getHours())); - break; - case "H": - ret.append(this.getHours()); - break; - case "mm": - ret.append(addLeadingZero(this.getMinutes())); - break; - case "m": - ret.append(this.getMinutes()); - break; - case "ss": - ret.append(addLeadingZero(this.getSeconds())); - break; - case "s": - ret.append(this.getSeconds()); - break; - case "tt": - ret.append((this.getHours() < 12) ? dtf.AMDesignator : dtf.PMDesignator); - break; - case "t": - ret.append(((this.getHours() < 12) ? dtf.AMDesignator : dtf.PMDesignator).charAt(0)); - break; - case "f": - ret.append(addLeadingZeros(this.getMilliseconds()).charAt(0)); - break; - case "ff": - ret.append(addLeadingZeros(this.getMilliseconds()).substr(0, 2)); - break; - case "fff": - ret.append(addLeadingZeros(this.getMilliseconds())); - break; - case "z": - hour = this.getTimezoneOffset() / 60; - ret.append(((hour <= 0) ? '+' : '-') + Math.floor(Math.abs(hour))); - break; - case "zz": - hour = this.getTimezoneOffset() / 60; - ret.append(((hour <= 0) ? '+' : '-') + addLeadingZero(Math.floor(Math.abs(hour)))); - break; - case "zzz": - hour = this.getTimezoneOffset() / 60; - ret.append(((hour <= 0) ? '+' : '-') + addLeadingZero(Math.floor(Math.abs(hour))) + - dtf.TimeSeparator + addLeadingZero(Math.abs(this.getTimezoneOffset() % 60))); - break; - } - } - return ret.toString(); -} - -Number.__typeName = 'Number'; -Number.__class = true; -Number.parseLocale = function Number$parseLocale(value) { - /// <summary locid="M:J#Number.parseLocale" /> - /// <param name="value" type="String"></param> - /// <returns type="Number"></returns> - var e = Function._validateParams(arguments, [ - {name: "value", type: String} - ]); - if (e) throw e; - return Number._parse(value, Sys.CultureInfo.CurrentCulture); -} -Number.parseInvariant = function Number$parseInvariant(value) { - /// <summary locid="M:J#Number.parseInvariant" /> - /// <param name="value" type="String"></param> - /// <returns type="Number"></returns> - var e = Function._validateParams(arguments, [ - {name: "value", type: String} - ]); - if (e) throw e; - return Number._parse(value, Sys.CultureInfo.InvariantCulture); -} -Number._parse = function Number$_parse(value, cultureInfo) { - value = value.trim(); - - if (value.match(/^[+-]?infinity$/i)) { - return parseFloat(value); - } - if (value.match(/^0x[a-f0-9]+$/i)) { - return parseInt(value); - } - var numFormat = cultureInfo.numberFormat; - var signInfo = Number._parseNumberNegativePattern(value, numFormat, numFormat.NumberNegativePattern); - var sign = signInfo[0]; - var num = signInfo[1]; - - if ((sign === '') && (numFormat.NumberNegativePattern !== 1)) { - signInfo = Number._parseNumberNegativePattern(value, numFormat, 1); - sign = signInfo[0]; - num = signInfo[1]; - } - if (sign === '') sign = '+'; - - var exponent; - var intAndFraction; - var exponentPos = num.indexOf('e'); - if (exponentPos < 0) exponentPos = num.indexOf('E'); - if (exponentPos < 0) { - intAndFraction = num; - exponent = null; - } - else { - intAndFraction = num.substr(0, exponentPos); - exponent = num.substr(exponentPos + 1); - } - - var integer; - var fraction; - var decimalPos = intAndFraction.indexOf(numFormat.NumberDecimalSeparator); - if (decimalPos < 0) { - integer = intAndFraction; - fraction = null; - } - else { - integer = intAndFraction.substr(0, decimalPos); - fraction = intAndFraction.substr(decimalPos + numFormat.NumberDecimalSeparator.length); - } - - integer = integer.split(numFormat.NumberGroupSeparator).join(''); - var altNumGroupSeparator = numFormat.NumberGroupSeparator.replace(/\u00A0/g, " "); - if (numFormat.NumberGroupSeparator !== altNumGroupSeparator) { - integer = integer.split(altNumGroupSeparator).join(''); - } - - var p = sign + integer; - if (fraction !== null) { - p += '.' + fraction; - } - if (exponent !== null) { - var expSignInfo = Number._parseNumberNegativePattern(exponent, numFormat, 1); - if (expSignInfo[0] === '') { - expSignInfo[0] = '+'; - } - p += 'e' + expSignInfo[0] + expSignInfo[1]; - } - if (p.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/)) { - return parseFloat(p); - } - return Number.NaN; -} -Number._parseNumberNegativePattern = function Number$_parseNumberNegativePattern(value, numFormat, numberNegativePattern) { - var neg = numFormat.NegativeSign; - var pos = numFormat.PositiveSign; - switch (numberNegativePattern) { - case 4: - neg = ' ' + neg; - pos = ' ' + pos; - case 3: - if (value.endsWith(neg)) { - return ['-', value.substr(0, value.length - neg.length)]; - } - else if (value.endsWith(pos)) { - return ['+', value.substr(0, value.length - pos.length)]; - } - break; - case 2: - neg += ' '; - pos += ' '; - case 1: - if (value.startsWith(neg)) { - return ['-', value.substr(neg.length)]; - } - else if (value.startsWith(pos)) { - return ['+', value.substr(pos.length)]; - } - break; - case 0: - if (value.startsWith('(') && value.endsWith(')')) { - return ['-', value.substr(1, value.length - 2)]; - } - break; - } - return ['', value]; -} -Number.prototype.format = function Number$format(format) { - /// <summary locid="M:J#Number.format" /> - /// <param name="format" type="String"></param> - /// <returns type="String"></returns> - var e = Function._validateParams(arguments, [ - {name: "format", type: String} - ]); - if (e) throw e; - return this._toFormattedString(format, Sys.CultureInfo.InvariantCulture); -} -Number.prototype.localeFormat = function Number$localeFormat(format) { - /// <summary locid="M:J#Number.localeFormat" /> - /// <param name="format" type="String"></param> - /// <returns type="String"></returns> - var e = Function._validateParams(arguments, [ - {name: "format", type: String} - ]); - if (e) throw e; - return this._toFormattedString(format, Sys.CultureInfo.CurrentCulture); -} -Number.prototype._toFormattedString = function Number$_toFormattedString(format, cultureInfo) { - if (!format || (format.length === 0) || (format === 'i')) { - if (cultureInfo && (cultureInfo.name.length > 0)) { - return this.toLocaleString(); - } - else { - return this.toString(); - } - } - - var _percentPositivePattern = ["n %", "n%", "%n" ]; - var _percentNegativePattern = ["-n %", "-n%", "-%n"]; - var _numberNegativePattern = ["(n)","-n","- n","n-","n -"]; - var _currencyPositivePattern = ["$n","n$","$ n","n $"]; - var _currencyNegativePattern = ["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"]; - function zeroPad(str, count, left) { - for (var l=str.length; l < count; l++) { - str = (left ? ('0' + str) : (str + '0')); - } - return str; - } - - function expandNumber(number, precision, groupSizes, sep, decimalChar) { - - var curSize = groupSizes[0]; - var curGroupIndex = 1; - var factor = Math.pow(10, precision); - var rounded = (Math.round(number * factor) / factor); - if (!isFinite(rounded)) { - rounded = number; - } - number = rounded; - - var numberString = number.toString(); - var right = ""; - var exponent; - - - var split = numberString.split(/e/i); - numberString = split[0]; - exponent = (split.length > 1 ? parseInt(split[1]) : 0); - split = numberString.split('.'); - numberString = split[0]; - right = split.length > 1 ? split[1] : ""; - - var l; - if (exponent > 0) { - right = zeroPad(right, exponent, false); - numberString += right.slice(0, exponent); - right = right.substr(exponent); - } - else if (exponent < 0) { - exponent = -exponent; - numberString = zeroPad(numberString, exponent+1, true); - right = numberString.slice(-exponent, numberString.length) + right; - numberString = numberString.slice(0, -exponent); - } - if (precision > 0) { - if (right.length > precision) { - right = right.slice(0, precision); - } - else { - right = zeroPad(right, precision, false); - } - right = decimalChar + right; - } - else { - right = ""; - } - var stringIndex = numberString.length-1; - var ret = ""; - while (stringIndex >= 0) { - if (curSize === 0 || curSize > stringIndex) { - if (ret.length > 0) - return numberString.slice(0, stringIndex + 1) + sep + ret + right; - else - return numberString.slice(0, stringIndex + 1) + right; - } - if (ret.length > 0) - ret = numberString.slice(stringIndex - curSize + 1, stringIndex+1) + sep + ret; - else - ret = numberString.slice(stringIndex - curSize + 1, stringIndex+1); - stringIndex -= curSize; - if (curGroupIndex < groupSizes.length) { - curSize = groupSizes[curGroupIndex]; - curGroupIndex++; - } - } - return numberString.slice(0, stringIndex + 1) + sep + ret + right; - } - var nf = cultureInfo.numberFormat; - var number = Math.abs(this); - if (!format) - format = "D"; - var precision = -1; - if (format.length > 1) precision = parseInt(format.slice(1), 10); - var pattern; - switch (format.charAt(0)) { - case "d": - case "D": - pattern = 'n'; - if (precision !== -1) { - number = zeroPad(""+number, precision, true); - } - if (this < 0) number = -number; - break; - case "c": - case "C": - if (this < 0) pattern = _currencyNegativePattern[nf.CurrencyNegativePattern]; - else pattern = _currencyPositivePattern[nf.CurrencyPositivePattern]; - if (precision === -1) precision = nf.CurrencyDecimalDigits; - number = expandNumber(Math.abs(this), precision, nf.CurrencyGroupSizes, nf.CurrencyGroupSeparator, nf.CurrencyDecimalSeparator); - break; - case "n": - case "N": - if (this < 0) pattern = _numberNegativePattern[nf.NumberNegativePattern]; - else pattern = 'n'; - if (precision === -1) precision = nf.NumberDecimalDigits; - number = expandNumber(Math.abs(this), precision, nf.NumberGroupSizes, nf.NumberGroupSeparator, nf.NumberDecimalSeparator); - break; - case "p": - case "P": - if (this < 0) pattern = _percentNegativePattern[nf.PercentNegativePattern]; - else pattern = _percentPositivePattern[nf.PercentPositivePattern]; - if (precision === -1) precision = nf.PercentDecimalDigits; - number = expandNumber(Math.abs(this) * 100, precision, nf.PercentGroupSizes, nf.PercentGroupSeparator, nf.PercentDecimalSeparator); - break; - default: - throw Error.format(Sys.Res.formatBadFormatSpecifier); - } - var regex = /n|\$|-|%/g; - var ret = ""; - for (;;) { - var index = regex.lastIndex; - var ar = regex.exec(pattern); - ret += pattern.slice(index, ar ? ar.index : pattern.length); - if (!ar) - break; - switch (ar[0]) { - case "n": - ret += number; - break; - case "$": - ret += nf.CurrencySymbol; - break; - case "-": - ret += nf.NegativeSign; - break; - case "%": - ret += nf.PercentSymbol; - break; - } - } - return ret; -} - -RegExp.__typeName = 'RegExp'; -RegExp.__class = true; - -Array.__typeName = 'Array'; -Array.__class = true; -Array.add = Array.enqueue = function Array$enqueue(array, item) { - /// <summary locid="M:J#Array.enqueue" /> - /// <param name="array" type="Array" elementMayBeNull="true"></param> - /// <param name="item" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "array", type: Array, elementMayBeNull: true}, - {name: "item", mayBeNull: true} - ]); - if (e) throw e; - array[array.length] = item; -} -Array.addRange = function Array$addRange(array, items) { - /// <summary locid="M:J#Array.addRange" /> - /// <param name="array" type="Array" elementMayBeNull="true"></param> - /// <param name="items" type="Array" elementMayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "array", type: Array, elementMayBeNull: true}, - {name: "items", type: Array, elementMayBeNull: true} - ]); - if (e) throw e; - array.push.apply(array, items); -} -Array.clear = function Array$clear(array) { - /// <summary locid="M:J#Array.clear" /> - /// <param name="array" type="Array" elementMayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "array", type: Array, elementMayBeNull: true} - ]); - if (e) throw e; - array.length = 0; -} -Array.clone = function Array$clone(array) { - /// <summary locid="M:J#Array.clone" /> - /// <param name="array" type="Array" elementMayBeNull="true"></param> - /// <returns type="Array" elementMayBeNull="true"></returns> - var e = Function._validateParams(arguments, [ - {name: "array", type: Array, elementMayBeNull: true} - ]); - if (e) throw e; - if (array.length === 1) { - return [array[0]]; - } - else { - return Array.apply(null, array); - } -} -Array.contains = function Array$contains(array, item) { - /// <summary locid="M:J#Array.contains" /> - /// <param name="array" type="Array" elementMayBeNull="true"></param> - /// <param name="item" mayBeNull="true"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "array", type: Array, elementMayBeNull: true}, - {name: "item", mayBeNull: true} - ]); - if (e) throw e; - return (Array.indexOf(array, item) >= 0); -} -Array.dequeue = function Array$dequeue(array) { - /// <summary locid="M:J#Array.dequeue" /> - /// <param name="array" type="Array" elementMayBeNull="true"></param> - /// <returns mayBeNull="true"></returns> - var e = Function._validateParams(arguments, [ - {name: "array", type: Array, elementMayBeNull: true} - ]); - if (e) throw e; - return array.shift(); -} -Array.forEach = function Array$forEach(array, method, instance) { - /// <summary locid="M:J#Array.forEach" /> - /// <param name="array" type="Array" elementMayBeNull="true"></param> - /// <param name="method" type="Function"></param> - /// <param name="instance" optional="true" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "array", type: Array, elementMayBeNull: true}, - {name: "method", type: Function}, - {name: "instance", mayBeNull: true, optional: true} - ]); - if (e) throw e; - for (var i = 0, l = array.length; i < l; i++) { - var elt = array[i]; - if (typeof(elt) !== 'undefined') method.call(instance, elt, i, array); - } -} -Array.indexOf = function Array$indexOf(array, item, start) { - /// <summary locid="M:J#Array.indexOf" /> - /// <param name="array" type="Array" elementMayBeNull="true"></param> - /// <param name="item" optional="true" mayBeNull="true"></param> - /// <param name="start" optional="true" mayBeNull="true"></param> - /// <returns type="Number"></returns> - var e = Function._validateParams(arguments, [ - {name: "array", type: Array, elementMayBeNull: true}, - {name: "item", mayBeNull: true, optional: true}, - {name: "start", mayBeNull: true, optional: true} - ]); - if (e) throw e; - if (typeof(item) === "undefined") return -1; - var length = array.length; - if (length !== 0) { - start = start - 0; - if (isNaN(start)) { - start = 0; - } - else { - if (isFinite(start)) { - start = start - (start % 1); - } - if (start < 0) { - start = Math.max(0, length + start); - } - } - for (var i = start; i < length; i++) { - if ((typeof(array[i]) !== "undefined") && (array[i] === item)) { - return i; - } - } - } - return -1; -} -Array.insert = function Array$insert(array, index, item) { - /// <summary locid="M:J#Array.insert" /> - /// <param name="array" type="Array" elementMayBeNull="true"></param> - /// <param name="index" mayBeNull="true"></param> - /// <param name="item" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "array", type: Array, elementMayBeNull: true}, - {name: "index", mayBeNull: true}, - {name: "item", mayBeNull: true} - ]); - if (e) throw e; - array.splice(index, 0, item); -} -Array.parse = function Array$parse(value) { - /// <summary locid="M:J#Array.parse" /> - /// <param name="value" type="String" mayBeNull="true"></param> - /// <returns type="Array" elementMayBeNull="true"></returns> - var e = Function._validateParams(arguments, [ - {name: "value", type: String, mayBeNull: true} - ]); - if (e) throw e; - if (!value) return []; - var v = eval(value); - if (!Array.isInstanceOfType(v)) throw Error.argument('value', Sys.Res.arrayParseBadFormat); - return v; -} -Array.remove = function Array$remove(array, item) { - /// <summary locid="M:J#Array.remove" /> - /// <param name="array" type="Array" elementMayBeNull="true"></param> - /// <param name="item" mayBeNull="true"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "array", type: Array, elementMayBeNull: true}, - {name: "item", mayBeNull: true} - ]); - if (e) throw e; - var index = Array.indexOf(array, item); - if (index >= 0) { - array.splice(index, 1); - } - return (index >= 0); -} -Array.removeAt = function Array$removeAt(array, index) { - /// <summary locid="M:J#Array.removeAt" /> - /// <param name="array" type="Array" elementMayBeNull="true"></param> - /// <param name="index" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "array", type: Array, elementMayBeNull: true}, - {name: "index", mayBeNull: true} - ]); - if (e) throw e; - array.splice(index, 1); -} - -if (!window) this.window = this; -window.Type = Function; -Type.__fullyQualifiedIdentifierRegExp = new RegExp("^[^.0-9 \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]([^ \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]*[^. \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\])?$", "i"); -Type.__identifierRegExp = new RegExp("^[^.0-9 \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\][^. \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]*$", "i"); -Type.prototype.callBaseMethod = function Type$callBaseMethod(instance, name, baseArguments) { - /// <summary locid="M:J#Type.callBaseMethod" /> - /// <param name="instance"></param> - /// <param name="name" type="String"></param> - /// <param name="baseArguments" type="Array" optional="true" mayBeNull="true" elementMayBeNull="true"></param> - /// <returns></returns> - var e = Function._validateParams(arguments, [ - {name: "instance"}, - {name: "name", type: String}, - {name: "baseArguments", type: Array, mayBeNull: true, optional: true, elementMayBeNull: true} - ]); - if (e) throw e; - var baseMethod = this.getBaseMethod(instance, name); - if (!baseMethod) throw Error.invalidOperation(String.format(Sys.Res.methodNotFound, name)); - if (!baseArguments) { - return baseMethod.apply(instance); - } - else { - return baseMethod.apply(instance, baseArguments); - } -} -Type.prototype.getBaseMethod = function Type$getBaseMethod(instance, name) { - /// <summary locid="M:J#Type.getBaseMethod" /> - /// <param name="instance"></param> - /// <param name="name" type="String"></param> - /// <returns type="Function" mayBeNull="true"></returns> - var e = Function._validateParams(arguments, [ - {name: "instance"}, - {name: "name", type: String} - ]); - if (e) throw e; - if (!this.isInstanceOfType(instance)) throw Error.argumentType('instance', Object.getType(instance), this); - var baseType = this.getBaseType(); - if (baseType) { - var baseMethod = baseType.prototype[name]; - return (baseMethod instanceof Function) ? baseMethod : null; - } - return null; -} -Type.prototype.getBaseType = function Type$getBaseType() { - /// <summary locid="M:J#Type.getBaseType" /> - /// <returns type="Type" mayBeNull="true"></returns> - if (arguments.length !== 0) throw Error.parameterCount(); - return (typeof(this.__baseType) === "undefined") ? null : this.__baseType; -} -Type.prototype.getInterfaces = function Type$getInterfaces() { - /// <summary locid="M:J#Type.getInterfaces" /> - /// <returns type="Array" elementType="Type" mayBeNull="false" elementMayBeNull="false"></returns> - if (arguments.length !== 0) throw Error.parameterCount(); - var result = []; - var type = this; - while(type) { - var interfaces = type.__interfaces; - if (interfaces) { - for (var i = 0, l = interfaces.length; i < l; i++) { - var interfaceType = interfaces[i]; - if (!Array.contains(result, interfaceType)) { - result[result.length] = interfaceType; - } - } - } - type = type.__baseType; - } - return result; -} -Type.prototype.getName = function Type$getName() { - /// <summary locid="M:J#Type.getName" /> - /// <returns type="String"></returns> - if (arguments.length !== 0) throw Error.parameterCount(); - return (typeof(this.__typeName) === "undefined") ? "" : this.__typeName; -} -Type.prototype.implementsInterface = function Type$implementsInterface(interfaceType) { - /// <summary locid="M:J#Type.implementsInterface" /> - /// <param name="interfaceType" type="Type"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "interfaceType", type: Type} - ]); - if (e) throw e; - this.resolveInheritance(); - var interfaceName = interfaceType.getName(); - var cache = this.__interfaceCache; - if (cache) { - var cacheEntry = cache[interfaceName]; - if (typeof(cacheEntry) !== 'undefined') return cacheEntry; - } - else { - cache = this.__interfaceCache = {}; - } - var baseType = this; - while (baseType) { - var interfaces = baseType.__interfaces; - if (interfaces) { - if (Array.indexOf(interfaces, interfaceType) !== -1) { - return cache[interfaceName] = true; - } - } - baseType = baseType.__baseType; - } - return cache[interfaceName] = false; -} -Type.prototype.inheritsFrom = function Type$inheritsFrom(parentType) { - /// <summary locid="M:J#Type.inheritsFrom" /> - /// <param name="parentType" type="Type"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "parentType", type: Type} - ]); - if (e) throw e; - this.resolveInheritance(); - var baseType = this.__baseType; - while (baseType) { - if (baseType === parentType) { - return true; - } - baseType = baseType.__baseType; - } - return false; -} -Type.prototype.initializeBase = function Type$initializeBase(instance, baseArguments) { - /// <summary locid="M:J#Type.initializeBase" /> - /// <param name="instance"></param> - /// <param name="baseArguments" type="Array" optional="true" mayBeNull="true" elementMayBeNull="true"></param> - /// <returns></returns> - var e = Function._validateParams(arguments, [ - {name: "instance"}, - {name: "baseArguments", type: Array, mayBeNull: true, optional: true, elementMayBeNull: true} - ]); - if (e) throw e; - if (!this.isInstanceOfType(instance)) throw Error.argumentType('instance', Object.getType(instance), this); - this.resolveInheritance(); - if (this.__baseType) { - if (!baseArguments) { - this.__baseType.apply(instance); - } - else { - this.__baseType.apply(instance, baseArguments); - } - } - return instance; -} -Type.prototype.isImplementedBy = function Type$isImplementedBy(instance) { - /// <summary locid="M:J#Type.isImplementedBy" /> - /// <param name="instance" mayBeNull="true"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "instance", mayBeNull: true} - ]); - if (e) throw e; - if (typeof(instance) === "undefined" || instance === null) return false; - var instanceType = Object.getType(instance); - return !!(instanceType.implementsInterface && instanceType.implementsInterface(this)); -} -Type.prototype.isInstanceOfType = function Type$isInstanceOfType(instance) { - /// <summary locid="M:J#Type.isInstanceOfType" /> - /// <param name="instance" mayBeNull="true"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "instance", mayBeNull: true} - ]); - if (e) throw e; - if (typeof(instance) === "undefined" || instance === null) return false; - if (instance instanceof this) return true; - var instanceType = Object.getType(instance); - return !!(instanceType === this) || - (instanceType.inheritsFrom && instanceType.inheritsFrom(this)) || - (instanceType.implementsInterface && instanceType.implementsInterface(this)); -} -Type.prototype.registerClass = function Type$registerClass(typeName, baseType, interfaceTypes) { - /// <summary locid="M:J#Type.registerClass" /> - /// <param name="typeName" type="String"></param> - /// <param name="baseType" type="Type" optional="true" mayBeNull="true"></param> - /// <param name="interfaceTypes" parameterArray="true" type="Type"></param> - /// <returns type="Type"></returns> - var e = Function._validateParams(arguments, [ - {name: "typeName", type: String}, - {name: "baseType", type: Type, mayBeNull: true, optional: true}, - {name: "interfaceTypes", type: Type, parameterArray: true} - ]); - if (e) throw e; - if (!Type.__fullyQualifiedIdentifierRegExp.test(typeName)) throw Error.argument('typeName', Sys.Res.notATypeName); - var parsedName; - try { - parsedName = eval(typeName); - } - catch(e) { - throw Error.argument('typeName', Sys.Res.argumentTypeName); - } - if (parsedName !== this) throw Error.argument('typeName', Sys.Res.badTypeName); - if (Sys.__registeredTypes[typeName]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, typeName)); - if ((arguments.length > 1) && (typeof(baseType) === 'undefined')) throw Error.argumentUndefined('baseType'); - if (baseType && !baseType.__class) throw Error.argument('baseType', Sys.Res.baseNotAClass); - this.prototype.constructor = this; - this.__typeName = typeName; - this.__class = true; - if (baseType) { - this.__baseType = baseType; - this.__basePrototypePending = true; - } - Sys.__upperCaseTypes[typeName.toUpperCase()] = this; - if (interfaceTypes) { - this.__interfaces = []; - this.resolveInheritance(); - for (var i = 2, l = arguments.length; i < l; i++) { - var interfaceType = arguments[i]; - if (!interfaceType.__interface) throw Error.argument('interfaceTypes[' + (i - 2) + ']', Sys.Res.notAnInterface); - for (var methodName in interfaceType.prototype) { - var method = interfaceType.prototype[methodName]; - if (!this.prototype[methodName]) { - this.prototype[methodName] = method; - } - } - this.__interfaces.push(interfaceType); - } - } - Sys.__registeredTypes[typeName] = true; - return this; -} -Type.prototype.registerInterface = function Type$registerInterface(typeName) { - /// <summary locid="M:J#Type.registerInterface" /> - /// <param name="typeName" type="String"></param> - /// <returns type="Type"></returns> - var e = Function._validateParams(arguments, [ - {name: "typeName", type: String} - ]); - if (e) throw e; - if (!Type.__fullyQualifiedIdentifierRegExp.test(typeName)) throw Error.argument('typeName', Sys.Res.notATypeName); - var parsedName; - try { - parsedName = eval(typeName); - } - catch(e) { - throw Error.argument('typeName', Sys.Res.argumentTypeName); - } - if (parsedName !== this) throw Error.argument('typeName', Sys.Res.badTypeName); - if (Sys.__registeredTypes[typeName]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, typeName)); - Sys.__upperCaseTypes[typeName.toUpperCase()] = this; - this.prototype.constructor = this; - this.__typeName = typeName; - this.__interface = true; - Sys.__registeredTypes[typeName] = true; - return this; -} -Type.prototype.resolveInheritance = function Type$resolveInheritance() { - /// <summary locid="M:J#Type.resolveInheritance" /> - if (arguments.length !== 0) throw Error.parameterCount(); - if (this.__basePrototypePending) { - var baseType = this.__baseType; - baseType.resolveInheritance(); - for (var memberName in baseType.prototype) { - var memberValue = baseType.prototype[memberName]; - if (!this.prototype[memberName]) { - this.prototype[memberName] = memberValue; - } - } - delete this.__basePrototypePending; - } -} -Type.getRootNamespaces = function Type$getRootNamespaces() { - /// <summary locid="M:J#Type.getRootNamespaces" /> - /// <returns type="Array"></returns> - if (arguments.length !== 0) throw Error.parameterCount(); - return Array.clone(Sys.__rootNamespaces); -} -Type.isClass = function Type$isClass(type) { - /// <summary locid="M:J#Type.isClass" /> - /// <param name="type" mayBeNull="true"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "type", mayBeNull: true} - ]); - if (e) throw e; - if ((typeof(type) === 'undefined') || (type === null)) return false; - return !!type.__class; -} -Type.isInterface = function Type$isInterface(type) { - /// <summary locid="M:J#Type.isInterface" /> - /// <param name="type" mayBeNull="true"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "type", mayBeNull: true} - ]); - if (e) throw e; - if ((typeof(type) === 'undefined') || (type === null)) return false; - return !!type.__interface; -} -Type.isNamespace = function Type$isNamespace(object) { - /// <summary locid="M:J#Type.isNamespace" /> - /// <param name="object" mayBeNull="true"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "object", mayBeNull: true} - ]); - if (e) throw e; - if ((typeof(object) === 'undefined') || (object === null)) return false; - return !!object.__namespace; -} -Type.parse = function Type$parse(typeName, ns) { - /// <summary locid="M:J#Type.parse" /> - /// <param name="typeName" type="String" mayBeNull="true"></param> - /// <param name="ns" optional="true" mayBeNull="true"></param> - /// <returns type="Type" mayBeNull="true"></returns> - var e = Function._validateParams(arguments, [ - {name: "typeName", type: String, mayBeNull: true}, - {name: "ns", mayBeNull: true, optional: true} - ]); - if (e) throw e; - var fn; - if (ns) { - fn = Sys.__upperCaseTypes[ns.getName().toUpperCase() + '.' + typeName.toUpperCase()]; - return fn || null; - } - if (!typeName) return null; - if (!Type.__htClasses) { - Type.__htClasses = {}; - } - fn = Type.__htClasses[typeName]; - if (!fn) { - fn = eval(typeName); - if (typeof(fn) !== 'function') throw Error.argument('typeName', Sys.Res.notATypeName); - Type.__htClasses[typeName] = fn; - } - return fn; -} -Type.registerNamespace = function Type$registerNamespace(namespacePath) { - /// <summary locid="M:J#Type.registerNamespace" /> - /// <param name="namespacePath" type="String"></param> - var e = Function._validateParams(arguments, [ - {name: "namespacePath", type: String} - ]); - if (e) throw e; - if (!Type.__fullyQualifiedIdentifierRegExp.test(namespacePath)) throw Error.argument('namespacePath', Sys.Res.invalidNameSpace); - var rootObject = window; - var namespaceParts = namespacePath.split('.'); - for (var i = 0; i < namespaceParts.length; i++) { - var currentPart = namespaceParts[i]; - var ns = rootObject[currentPart]; - if (ns && !ns.__namespace) { - throw Error.invalidOperation(String.format(Sys.Res.namespaceContainsObject, namespaceParts.splice(0, i + 1).join('.'))); - } - if (!ns) { - ns = rootObject[currentPart] = { - __namespace: true, - __typeName: namespaceParts.slice(0, i + 1).join('.') - }; - if (i === 0) { - Sys.__rootNamespaces[Sys.__rootNamespaces.length] = ns; - } - var parsedName; - try { - parsedName = eval(ns.__typeName); - } - catch(e) { - parsedName = null; - } - if (parsedName !== ns) { - delete rootObject[currentPart]; - throw Error.argument('namespacePath', Sys.Res.invalidNameSpace); - } - ns.getName = function ns$getName() {return this.__typeName;} - } - rootObject = ns; - } -} -window.Sys = { - __namespace: true, - __typeName: "Sys", - getName: function() {return "Sys";}, - __upperCaseTypes: {} -}; -Sys.__rootNamespaces = [Sys]; -Sys.__registeredTypes = {}; - -Sys.IDisposable = function Sys$IDisposable() { - throw Error.notImplemented(); -} - function Sys$IDisposable$dispose() { - throw Error.notImplemented(); - } -Sys.IDisposable.prototype = { - dispose: Sys$IDisposable$dispose -} -Sys.IDisposable.registerInterface('Sys.IDisposable'); - -Sys.StringBuilder = function Sys$StringBuilder(initialText) { - /// <summary locid="M:J#Sys.StringBuilder.#ctor" /> - /// <param name="initialText" optional="true" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "initialText", mayBeNull: true, optional: true} - ]); - if (e) throw e; - this._parts = (typeof(initialText) !== 'undefined' && initialText !== null && initialText !== '') ? - [initialText.toString()] : []; - this._value = {}; - this._len = 0; -} - function Sys$StringBuilder$append(text) { - /// <summary locid="M:J#Sys.StringBuilder.append" /> - /// <param name="text" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "text", mayBeNull: true} - ]); - if (e) throw e; - this._parts[this._parts.length] = text; - } - function Sys$StringBuilder$appendLine(text) { - /// <summary locid="M:J#Sys.StringBuilder.appendLine" /> - /// <param name="text" optional="true" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "text", mayBeNull: true, optional: true} - ]); - if (e) throw e; - this._parts[this._parts.length] = - ((typeof(text) === 'undefined') || (text === null) || (text === '')) ? - '\r\n' : text + '\r\n'; - } - function Sys$StringBuilder$clear() { - /// <summary locid="M:J#Sys.StringBuilder.clear" /> - if (arguments.length !== 0) throw Error.parameterCount(); - this._parts = []; - this._value = {}; - this._len = 0; - } - function Sys$StringBuilder$isEmpty() { - /// <summary locid="M:J#Sys.StringBuilder.isEmpty" /> - /// <returns type="Boolean"></returns> - if (arguments.length !== 0) throw Error.parameterCount(); - if (this._parts.length === 0) return true; - return this.toString() === ''; - } - function Sys$StringBuilder$toString(separator) { - /// <summary locid="M:J#Sys.StringBuilder.toString" /> - /// <param name="separator" type="String" optional="true" mayBeNull="true"></param> - /// <returns type="String"></returns> - var e = Function._validateParams(arguments, [ - {name: "separator", type: String, mayBeNull: true, optional: true} - ]); - if (e) throw e; - separator = separator || ''; - var parts = this._parts; - if (this._len !== parts.length) { - this._value = {}; - this._len = parts.length; - } - var val = this._value; - if (typeof(val[separator]) === 'undefined') { - if (separator !== '') { - for (var i = 0; i < parts.length;) { - if ((typeof(parts[i]) === 'undefined') || (parts[i] === '') || (parts[i] === null)) { - parts.splice(i, 1); - } - else { - i++; - } - } - } - val[separator] = this._parts.join(separator); - } - return val[separator]; - } -Sys.StringBuilder.prototype = { - append: Sys$StringBuilder$append, - appendLine: Sys$StringBuilder$appendLine, - clear: Sys$StringBuilder$clear, - isEmpty: Sys$StringBuilder$isEmpty, - toString: Sys$StringBuilder$toString -} -Sys.StringBuilder.registerClass('Sys.StringBuilder'); - -if (!window.XMLHttpRequest) { - window.XMLHttpRequest = function window$XMLHttpRequest() { - var progIDs = [ 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP' ]; - for (var i = 0, l = progIDs.length; i < l; i++) { - try { - return new ActiveXObject(progIDs[i]); - } - catch (ex) { - } - } - return null; - } -} - -Sys.Browser = {}; -Sys.Browser.InternetExplorer = {}; -Sys.Browser.Firefox = {}; -Sys.Browser.Safari = {}; -Sys.Browser.Opera = {}; -Sys.Browser.agent = null; -Sys.Browser.hasDebuggerStatement = false; -Sys.Browser.name = navigator.appName; -Sys.Browser.version = parseFloat(navigator.appVersion); -Sys.Browser.documentMode = 0; -if (navigator.userAgent.indexOf(' MSIE ') > -1) { - Sys.Browser.agent = Sys.Browser.InternetExplorer; - Sys.Browser.version = parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]); - if (Sys.Browser.version >= 8) { - if (document.documentMode >= 7) { - Sys.Browser.documentMode = document.documentMode; - } - } - Sys.Browser.hasDebuggerStatement = true; -} -else if (navigator.userAgent.indexOf(' Firefox/') > -1) { - Sys.Browser.agent = Sys.Browser.Firefox; - Sys.Browser.version = parseFloat(navigator.userAgent.match(/ Firefox\/(\d+\.\d+)/)[1]); - Sys.Browser.name = 'Firefox'; - Sys.Browser.hasDebuggerStatement = true; -} -else if (navigator.userAgent.indexOf(' AppleWebKit/') > -1) { - Sys.Browser.agent = Sys.Browser.Safari; - Sys.Browser.version = parseFloat(navigator.userAgent.match(/ AppleWebKit\/(\d+(\.\d+)?)/)[1]); - Sys.Browser.name = 'Safari'; -} -else if (navigator.userAgent.indexOf('Opera/') > -1) { - Sys.Browser.agent = Sys.Browser.Opera; -} -Type.registerNamespace('Sys.UI'); - -Sys._Debug = function Sys$_Debug() { - /// <summary locid="M:J#Sys.Debug.#ctor" /> - /// <field name="isDebug" type="Boolean" locid="F:J#Sys.Debug.isDebug"></field> - if (arguments.length !== 0) throw Error.parameterCount(); -} - function Sys$_Debug$_appendConsole(text) { - if ((typeof(Debug) !== 'undefined') && Debug.writeln) { - Debug.writeln(text); - } - if (window.console && window.console.log) { - window.console.log(text); - } - if (window.opera) { - window.opera.postError(text); - } - if (window.debugService) { - window.debugService.trace(text); - } - } - function Sys$_Debug$_appendTrace(text) { - var traceElement = document.getElementById('TraceConsole'); - if (traceElement && (traceElement.tagName.toUpperCase() === 'TEXTAREA')) { - traceElement.value += text + '\n'; - } - } - function Sys$_Debug$assert(condition, message, displayCaller) { - /// <summary locid="M:J#Sys.Debug.assert" /> - /// <param name="condition" type="Boolean"></param> - /// <param name="message" type="String" optional="true" mayBeNull="true"></param> - /// <param name="displayCaller" type="Boolean" optional="true"></param> - var e = Function._validateParams(arguments, [ - {name: "condition", type: Boolean}, - {name: "message", type: String, mayBeNull: true, optional: true}, - {name: "displayCaller", type: Boolean, optional: true} - ]); - if (e) throw e; - if (!condition) { - message = (displayCaller && this.assert.caller) ? - String.format(Sys.Res.assertFailedCaller, message, this.assert.caller) : - String.format(Sys.Res.assertFailed, message); - if (confirm(String.format(Sys.Res.breakIntoDebugger, message))) { - this.fail(message); - } - } - } - function Sys$_Debug$clearTrace() { - /// <summary locid="M:J#Sys.Debug.clearTrace" /> - if (arguments.length !== 0) throw Error.parameterCount(); - var traceElement = document.getElementById('TraceConsole'); - if (traceElement && (traceElement.tagName.toUpperCase() === 'TEXTAREA')) { - traceElement.value = ''; - } - } - function Sys$_Debug$fail(message) { - /// <summary locid="M:J#Sys.Debug.fail" /> - /// <param name="message" type="String" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "message", type: String, mayBeNull: true} - ]); - if (e) throw e; - this._appendConsole(message); - if (Sys.Browser.hasDebuggerStatement) { - eval('debugger'); - } - } - function Sys$_Debug$trace(text) { - /// <summary locid="M:J#Sys.Debug.trace" /> - /// <param name="text"></param> - var e = Function._validateParams(arguments, [ - {name: "text"} - ]); - if (e) throw e; - this._appendConsole(text); - this._appendTrace(text); - } - function Sys$_Debug$traceDump(object, name) { - /// <summary locid="M:J#Sys.Debug.traceDump" /> - /// <param name="object" mayBeNull="true"></param> - /// <param name="name" type="String" mayBeNull="true" optional="true"></param> - var e = Function._validateParams(arguments, [ - {name: "object", mayBeNull: true}, - {name: "name", type: String, mayBeNull: true, optional: true} - ]); - if (e) throw e; - var text = this._traceDump(object, name, true); - } - function Sys$_Debug$_traceDump(object, name, recursive, indentationPadding, loopArray) { - name = name? name : 'traceDump'; - indentationPadding = indentationPadding? indentationPadding : ''; - if (object === null) { - this.trace(indentationPadding + name + ': null'); - return; - } - switch(typeof(object)) { - case 'undefined': - this.trace(indentationPadding + name + ': Undefined'); - break; - case 'number': case 'string': case 'boolean': - this.trace(indentationPadding + name + ': ' + object); - break; - default: - if (Date.isInstanceOfType(object) || RegExp.isInstanceOfType(object)) { - this.trace(indentationPadding + name + ': ' + object.toString()); - break; - } - if (!loopArray) { - loopArray = []; - } - else if (Array.contains(loopArray, object)) { - this.trace(indentationPadding + name + ': ...'); - return; - } - Array.add(loopArray, object); - if ((object == window) || (object === document) || - (window.HTMLElement && (object instanceof HTMLElement)) || - (typeof(object.nodeName) === 'string')) { - var tag = object.tagName? object.tagName : 'DomElement'; - if (object.id) { - tag += ' - ' + object.id; - } - this.trace(indentationPadding + name + ' {' + tag + '}'); - } - else { - var typeName = Object.getTypeName(object); - this.trace(indentationPadding + name + (typeof(typeName) === 'string' ? ' {' + typeName + '}' : '')); - if ((indentationPadding === '') || recursive) { - indentationPadding += " "; - var i, length, properties, p, v; - if (Array.isInstanceOfType(object)) { - length = object.length; - for (i = 0; i < length; i++) { - this._traceDump(object[i], '[' + i + ']', recursive, indentationPadding, loopArray); - } - } - else { - for (p in object) { - v = object[p]; - if (!Function.isInstanceOfType(v)) { - this._traceDump(v, p, recursive, indentationPadding, loopArray); - } - } - } - } - } - Array.remove(loopArray, object); - } - } -Sys._Debug.prototype = { - _appendConsole: Sys$_Debug$_appendConsole, - _appendTrace: Sys$_Debug$_appendTrace, - assert: Sys$_Debug$assert, - clearTrace: Sys$_Debug$clearTrace, - fail: Sys$_Debug$fail, - trace: Sys$_Debug$trace, - traceDump: Sys$_Debug$traceDump, - _traceDump: Sys$_Debug$_traceDump -} -Sys._Debug.registerClass('Sys._Debug'); -Sys.Debug = new Sys._Debug(); - Sys.Debug.isDebug = true; - -function Sys$Enum$parse(value, ignoreCase) { - /// <summary locid="M:J#Sys.Enum.parse" /> - /// <param name="value" type="String"></param> - /// <param name="ignoreCase" type="Boolean" optional="true"></param> - /// <returns></returns> - var e = Function._validateParams(arguments, [ - {name: "value", type: String}, - {name: "ignoreCase", type: Boolean, optional: true} - ]); - if (e) throw e; - var values, parsed, val; - if (ignoreCase) { - values = this.__lowerCaseValues; - if (!values) { - this.__lowerCaseValues = values = {}; - var prototype = this.prototype; - for (var name in prototype) { - values[name.toLowerCase()] = prototype[name]; - } - } - } - else { - values = this.prototype; - } - if (!this.__flags) { - val = (ignoreCase ? value.toLowerCase() : value); - parsed = values[val.trim()]; - if (typeof(parsed) !== 'number') throw Error.argument('value', String.format(Sys.Res.enumInvalidValue, value, this.__typeName)); - return parsed; - } - else { - var parts = (ignoreCase ? value.toLowerCase() : value).split(','); - var v = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var part = parts[i].trim(); - parsed = values[part]; - if (typeof(parsed) !== 'number') throw Error.argument('value', String.format(Sys.Res.enumInvalidValue, value.split(',')[i].trim(), this.__typeName)); - v |= parsed; - } - return v; - } -} -function Sys$Enum$toString(value) { - /// <summary locid="M:J#Sys.Enum.toString" /> - /// <param name="value" optional="true" mayBeNull="true"></param> - /// <returns type="String"></returns> - var e = Function._validateParams(arguments, [ - {name: "value", mayBeNull: true, optional: true} - ]); - if (e) throw e; - if ((typeof(value) === 'undefined') || (value === null)) return this.__string; - if ((typeof(value) != 'number') || ((value % 1) !== 0)) throw Error.argumentType('value', Object.getType(value), this); - var values = this.prototype; - var i; - if (!this.__flags || (value === 0)) { - for (i in values) { - if (values[i] === value) { - return i; - } - } - } - else { - var sorted = this.__sortedValues; - if (!sorted) { - sorted = []; - for (i in values) { - sorted[sorted.length] = {key: i, value: values[i]}; - } - sorted.sort(function(a, b) { - return a.value - b.value; - }); - this.__sortedValues = sorted; - } - var parts = []; - var v = value; - for (i = sorted.length - 1; i >= 0; i--) { - var kvp = sorted[i]; - var vali = kvp.value; - if (vali === 0) continue; - if ((vali & value) === vali) { - parts[parts.length] = kvp.key; - v -= vali; - if (v === 0) break; - } - } - if (parts.length && v === 0) return parts.reverse().join(', '); - } - throw Error.argumentOutOfRange('value', value, String.format(Sys.Res.enumInvalidValue, value, this.__typeName)); -} -Type.prototype.registerEnum = function Type$registerEnum(name, flags) { - /// <summary locid="M:J#Sys.UI.LineType.#ctor" /> - /// <param name="name" type="String"></param> - /// <param name="flags" type="Boolean" optional="true"></param> - var e = Function._validateParams(arguments, [ - {name: "name", type: String}, - {name: "flags", type: Boolean, optional: true} - ]); - if (e) throw e; - if (!Type.__fullyQualifiedIdentifierRegExp.test(name)) throw Error.argument('name', Sys.Res.notATypeName); - var parsedName; - try { - parsedName = eval(name); - } - catch(e) { - throw Error.argument('name', Sys.Res.argumentTypeName); - } - if (parsedName !== this) throw Error.argument('name', Sys.Res.badTypeName); - if (Sys.__registeredTypes[name]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, name)); - for (var i in this.prototype) { - var val = this.prototype[i]; - if (!Type.__identifierRegExp.test(i)) throw Error.invalidOperation(String.format(Sys.Res.enumInvalidValueName, i)); - if (typeof(val) !== 'number' || (val % 1) !== 0) throw Error.invalidOperation(Sys.Res.enumValueNotInteger); - if (typeof(this[i]) !== 'undefined') throw Error.invalidOperation(String.format(Sys.Res.enumReservedName, i)); - } - Sys.__upperCaseTypes[name.toUpperCase()] = this; - for (var i in this.prototype) { - this[i] = this.prototype[i]; - } - this.__typeName = name; - this.parse = Sys$Enum$parse; - this.__string = this.toString(); - this.toString = Sys$Enum$toString; - this.__flags = flags; - this.__enum = true; - Sys.__registeredTypes[name] = true; -} -Type.isEnum = function Type$isEnum(type) { - /// <summary locid="M:J#Type.isEnum" /> - /// <param name="type" mayBeNull="true"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "type", mayBeNull: true} - ]); - if (e) throw e; - if ((typeof(type) === 'undefined') || (type === null)) return false; - return !!type.__enum; -} -Type.isFlags = function Type$isFlags(type) { - /// <summary locid="M:J#Type.isFlags" /> - /// <param name="type" mayBeNull="true"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "type", mayBeNull: true} - ]); - if (e) throw e; - if ((typeof(type) === 'undefined') || (type === null)) return false; - return !!type.__flags; -} - -Sys.EventHandlerList = function Sys$EventHandlerList() { - /// <summary locid="M:J#Sys.EventHandlerList.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); - this._list = {}; -} - function Sys$EventHandlerList$addHandler(id, handler) { - /// <summary locid="M:J#Sys.EventHandlerList.addHandler" /> - /// <param name="id" type="String"></param> - /// <param name="handler" type="Function"></param> - var e = Function._validateParams(arguments, [ - {name: "id", type: String}, - {name: "handler", type: Function} - ]); - if (e) throw e; - Array.add(this._getEvent(id, true), handler); - } - function Sys$EventHandlerList$removeHandler(id, handler) { - /// <summary locid="M:J#Sys.EventHandlerList.removeHandler" /> - /// <param name="id" type="String"></param> - /// <param name="handler" type="Function"></param> - var e = Function._validateParams(arguments, [ - {name: "id", type: String}, - {name: "handler", type: Function} - ]); - if (e) throw e; - var evt = this._getEvent(id); - if (!evt) return; - Array.remove(evt, handler); - } - function Sys$EventHandlerList$getHandler(id) { - /// <summary locid="M:J#Sys.EventHandlerList.getHandler" /> - /// <param name="id" type="String"></param> - /// <returns type="Function"></returns> - var e = Function._validateParams(arguments, [ - {name: "id", type: String} - ]); - if (e) throw e; - var evt = this._getEvent(id); - if (!evt || (evt.length === 0)) return null; - evt = Array.clone(evt); - return function(source, args) { - for (var i = 0, l = evt.length; i < l; i++) { - evt[i](source, args); - } - }; - } - function Sys$EventHandlerList$_getEvent(id, create) { - if (!this._list[id]) { - if (!create) return null; - this._list[id] = []; - } - return this._list[id]; - } -Sys.EventHandlerList.prototype = { - addHandler: Sys$EventHandlerList$addHandler, - removeHandler: Sys$EventHandlerList$removeHandler, - getHandler: Sys$EventHandlerList$getHandler, - _getEvent: Sys$EventHandlerList$_getEvent -} -Sys.EventHandlerList.registerClass('Sys.EventHandlerList'); - -Sys.EventArgs = function Sys$EventArgs() { - /// <summary locid="M:J#Sys.EventArgs.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); -} -Sys.EventArgs.registerClass('Sys.EventArgs'); -Sys.EventArgs.Empty = new Sys.EventArgs(); - -Sys.CancelEventArgs = function Sys$CancelEventArgs() { - /// <summary locid="M:J#Sys.CancelEventArgs.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); - Sys.CancelEventArgs.initializeBase(this); - this._cancel = false; -} - function Sys$CancelEventArgs$get_cancel() { - /// <value type="Boolean" locid="P:J#Sys.CancelEventArgs.cancel"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._cancel; - } - function Sys$CancelEventArgs$set_cancel(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]); - if (e) throw e; - this._cancel = value; - } -Sys.CancelEventArgs.prototype = { - get_cancel: Sys$CancelEventArgs$get_cancel, - set_cancel: Sys$CancelEventArgs$set_cancel -} -Sys.CancelEventArgs.registerClass('Sys.CancelEventArgs', Sys.EventArgs); - -Sys.INotifyPropertyChange = function Sys$INotifyPropertyChange() { - /// <summary locid="M:J#Sys.INotifyPropertyChange.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); -} - function Sys$INotifyPropertyChange$add_propertyChanged(handler) { - /// <summary locid="E:J#Sys.INotifyPropertyChange.propertyChanged" /> - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - throw Error.notImplemented(); - } - function Sys$INotifyPropertyChange$remove_propertyChanged(handler) { - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - throw Error.notImplemented(); - } -Sys.INotifyPropertyChange.prototype = { - add_propertyChanged: Sys$INotifyPropertyChange$add_propertyChanged, - remove_propertyChanged: Sys$INotifyPropertyChange$remove_propertyChanged -} -Sys.INotifyPropertyChange.registerInterface('Sys.INotifyPropertyChange'); - -Sys.PropertyChangedEventArgs = function Sys$PropertyChangedEventArgs(propertyName) { - /// <summary locid="M:J#Sys.PropertyChangedEventArgs.#ctor" /> - /// <param name="propertyName" type="String"></param> - var e = Function._validateParams(arguments, [ - {name: "propertyName", type: String} - ]); - if (e) throw e; - Sys.PropertyChangedEventArgs.initializeBase(this); - this._propertyName = propertyName; -} - - function Sys$PropertyChangedEventArgs$get_propertyName() { - /// <value type="String" locid="P:J#Sys.PropertyChangedEventArgs.propertyName"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._propertyName; - } -Sys.PropertyChangedEventArgs.prototype = { - get_propertyName: Sys$PropertyChangedEventArgs$get_propertyName -} -Sys.PropertyChangedEventArgs.registerClass('Sys.PropertyChangedEventArgs', Sys.EventArgs); - -Sys.INotifyDisposing = function Sys$INotifyDisposing() { - /// <summary locid="M:J#Sys.INotifyDisposing.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); -} - function Sys$INotifyDisposing$add_disposing(handler) { - /// <summary locid="E:J#Sys.INotifyDisposing.disposing" /> - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - throw Error.notImplemented(); - } - function Sys$INotifyDisposing$remove_disposing(handler) { - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - throw Error.notImplemented(); - } -Sys.INotifyDisposing.prototype = { - add_disposing: Sys$INotifyDisposing$add_disposing, - remove_disposing: Sys$INotifyDisposing$remove_disposing -} -Sys.INotifyDisposing.registerInterface("Sys.INotifyDisposing"); - -Sys.Component = function Sys$Component() { - /// <summary locid="M:J#Sys.Component.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); - if (Sys.Application) Sys.Application.registerDisposableObject(this); -} - function Sys$Component$get_events() { - /// <value type="Sys.EventHandlerList" locid="P:J#Sys.Component.events"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - if (!this._events) { - this._events = new Sys.EventHandlerList(); - } - return this._events; - } - function Sys$Component$get_id() { - /// <value type="String" locid="P:J#Sys.Component.id"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._id; - } - function Sys$Component$set_id(value) { - var e = Function._validateParams(arguments, [{name: "value", type: String}]); - if (e) throw e; - if (this._idSet) throw Error.invalidOperation(Sys.Res.componentCantSetIdTwice); - this._idSet = true; - var oldId = this.get_id(); - if (oldId && Sys.Application.findComponent(oldId)) throw Error.invalidOperation(Sys.Res.componentCantSetIdAfterAddedToApp); - this._id = value; - } - function Sys$Component$get_isInitialized() { - /// <value type="Boolean" locid="P:J#Sys.Component.isInitialized"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._initialized; - } - function Sys$Component$get_isUpdating() { - /// <value type="Boolean" locid="P:J#Sys.Component.isUpdating"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._updating; - } - function Sys$Component$add_disposing(handler) { - /// <summary locid="E:J#Sys.Component.disposing" /> - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this.get_events().addHandler("disposing", handler); - } - function Sys$Component$remove_disposing(handler) { - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this.get_events().removeHandler("disposing", handler); - } - function Sys$Component$add_propertyChanged(handler) { - /// <summary locid="E:J#Sys.Component.propertyChanged" /> - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this.get_events().addHandler("propertyChanged", handler); - } - function Sys$Component$remove_propertyChanged(handler) { - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this.get_events().removeHandler("propertyChanged", handler); - } - function Sys$Component$beginUpdate() { - this._updating = true; - } - function Sys$Component$dispose() { - if (this._events) { - var handler = this._events.getHandler("disposing"); - if (handler) { - handler(this, Sys.EventArgs.Empty); - } - } - delete this._events; - Sys.Application.unregisterDisposableObject(this); - Sys.Application.removeComponent(this); - } - function Sys$Component$endUpdate() { - this._updating = false; - if (!this._initialized) this.initialize(); - this.updated(); - } - function Sys$Component$initialize() { - this._initialized = true; - } - function Sys$Component$raisePropertyChanged(propertyName) { - /// <summary locid="M:J#Sys.Component.raisePropertyChanged" /> - /// <param name="propertyName" type="String"></param> - var e = Function._validateParams(arguments, [ - {name: "propertyName", type: String} - ]); - if (e) throw e; - if (!this._events) return; - var handler = this._events.getHandler("propertyChanged"); - if (handler) { - handler(this, new Sys.PropertyChangedEventArgs(propertyName)); - } - } - function Sys$Component$updated() { - } -Sys.Component.prototype = { - _id: null, - _idSet: false, - _initialized: false, - _updating: false, - get_events: Sys$Component$get_events, - get_id: Sys$Component$get_id, - set_id: Sys$Component$set_id, - get_isInitialized: Sys$Component$get_isInitialized, - get_isUpdating: Sys$Component$get_isUpdating, - add_disposing: Sys$Component$add_disposing, - remove_disposing: Sys$Component$remove_disposing, - add_propertyChanged: Sys$Component$add_propertyChanged, - remove_propertyChanged: Sys$Component$remove_propertyChanged, - beginUpdate: Sys$Component$beginUpdate, - dispose: Sys$Component$dispose, - endUpdate: Sys$Component$endUpdate, - initialize: Sys$Component$initialize, - raisePropertyChanged: Sys$Component$raisePropertyChanged, - updated: Sys$Component$updated -} -Sys.Component.registerClass('Sys.Component', null, Sys.IDisposable, Sys.INotifyPropertyChange, Sys.INotifyDisposing); -function Sys$Component$_setProperties(target, properties) { - /// <summary locid="M:J#Sys.Component._setProperties" /> - /// <param name="target"></param> - /// <param name="properties"></param> - var e = Function._validateParams(arguments, [ - {name: "target"}, - {name: "properties"} - ]); - if (e) throw e; - var current; - var targetType = Object.getType(target); - var isObject = (targetType === Object) || (targetType === Sys.UI.DomElement); - var isComponent = Sys.Component.isInstanceOfType(target) && !target.get_isUpdating(); - if (isComponent) target.beginUpdate(); - for (var name in properties) { - var val = properties[name]; - var getter = isObject ? null : target["get_" + name]; - if (isObject || typeof(getter) !== 'function') { - var targetVal = target[name]; - if (!isObject && typeof(targetVal) === 'undefined') throw Error.invalidOperation(String.format(Sys.Res.propertyUndefined, name)); - if (!val || (typeof(val) !== 'object') || (isObject && !targetVal)) { - target[name] = val; - } - else { - Sys$Component$_setProperties(targetVal, val); - } - } - else { - var setter = target["set_" + name]; - if (typeof(setter) === 'function') { - setter.apply(target, [val]); - } - else if (val instanceof Array) { - current = getter.apply(target); - if (!(current instanceof Array)) throw new Error.invalidOperation(String.format(Sys.Res.propertyNotAnArray, name)); - for (var i = 0, j = current.length, l= val.length; i < l; i++, j++) { - current[j] = val[i]; - } - } - else if ((typeof(val) === 'object') && (Object.getType(val) === Object)) { - current = getter.apply(target); - if ((typeof(current) === 'undefined') || (current === null)) throw new Error.invalidOperation(String.format(Sys.Res.propertyNullOrUndefined, name)); - Sys$Component$_setProperties(current, val); - } - else { - throw new Error.invalidOperation(String.format(Sys.Res.propertyNotWritable, name)); - } - } - } - if (isComponent) target.endUpdate(); -} -function Sys$Component$_setReferences(component, references) { - for (var name in references) { - var setter = component["set_" + name]; - var reference = $find(references[name]); - if (typeof(setter) !== 'function') throw new Error.invalidOperation(String.format(Sys.Res.propertyNotWritable, name)); - if (!reference) throw Error.invalidOperation(String.format(Sys.Res.referenceNotFound, references[name])); - setter.apply(component, [reference]); - } -} -var $create = Sys.Component.create = function Sys$Component$create(type, properties, events, references, element) { - /// <summary locid="M:J#Sys.Component.create" /> - /// <param name="type" type="Type"></param> - /// <param name="properties" optional="true" mayBeNull="true"></param> - /// <param name="events" optional="true" mayBeNull="true"></param> - /// <param name="references" optional="true" mayBeNull="true"></param> - /// <param name="element" domElement="true" optional="true" mayBeNull="true"></param> - /// <returns type="Sys.UI.Component"></returns> - var e = Function._validateParams(arguments, [ - {name: "type", type: Type}, - {name: "properties", mayBeNull: true, optional: true}, - {name: "events", mayBeNull: true, optional: true}, - {name: "references", mayBeNull: true, optional: true}, - {name: "element", mayBeNull: true, domElement: true, optional: true} - ]); - if (e) throw e; - if (!type.inheritsFrom(Sys.Component)) { - throw Error.argument('type', String.format(Sys.Res.createNotComponent, type.getName())); - } - if (type.inheritsFrom(Sys.UI.Behavior) || type.inheritsFrom(Sys.UI.Control)) { - if (!element) throw Error.argument('element', Sys.Res.createNoDom); - } - else if (element) throw Error.argument('element', Sys.Res.createComponentOnDom); - var component = (element ? new type(element): new type()); - var app = Sys.Application; - var creatingComponents = app.get_isCreatingComponents(); - component.beginUpdate(); - if (properties) { - Sys$Component$_setProperties(component, properties); - } - if (events) { - for (var name in events) { - if (!(component["add_" + name] instanceof Function)) throw new Error.invalidOperation(String.format(Sys.Res.undefinedEvent, name)); - if (!(events[name] instanceof Function)) throw new Error.invalidOperation(Sys.Res.eventHandlerNotFunction); - component["add_" + name](events[name]); - } - } - if (component.get_id()) { - app.addComponent(component); - } - if (creatingComponents) { - app._createdComponents[app._createdComponents.length] = component; - if (references) { - app._addComponentToSecondPass(component, references); - } - else { - component.endUpdate(); - } - } - else { - if (references) { - Sys$Component$_setReferences(component, references); - } - component.endUpdate(); - } - return component; -} - -Sys.UI.MouseButton = function Sys$UI$MouseButton() { - /// <summary locid="M:J#Sys.UI.MouseButton.#ctor" /> - /// <field name="leftButton" type="Number" integer="true" static="true" locid="F:J#Sys.UI.MouseButton.leftButton"></field> - /// <field name="middleButton" type="Number" integer="true" static="true" locid="F:J#Sys.UI.MouseButton.middleButton"></field> - /// <field name="rightButton" type="Number" integer="true" static="true" locid="F:J#Sys.UI.MouseButton.rightButton"></field> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); -} -Sys.UI.MouseButton.prototype = { - leftButton: 0, - middleButton: 1, - rightButton: 2 -} -Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton"); - -Sys.UI.Key = function Sys$UI$Key() { - /// <summary locid="M:J#Sys.UI.Key.#ctor" /> - /// <field name="backspace" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.backspace"></field> - /// <field name="tab" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.tab"></field> - /// <field name="enter" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.enter"></field> - /// <field name="esc" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.esc"></field> - /// <field name="space" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.space"></field> - /// <field name="pageUp" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.pageUp"></field> - /// <field name="pageDown" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.pageDown"></field> - /// <field name="end" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.end"></field> - /// <field name="home" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.home"></field> - /// <field name="left" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.left"></field> - /// <field name="up" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.up"></field> - /// <field name="right" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.right"></field> - /// <field name="down" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.down"></field> - /// <field name="del" type="Number" integer="true" static="true" locid="F:J#Sys.UI.Key.del"></field> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); -} -Sys.UI.Key.prototype = { - 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 -} -Sys.UI.Key.registerEnum("Sys.UI.Key"); - -Sys.UI.Point = function Sys$UI$Point(x, y) { - /// <summary locid="M:J#Sys.UI.Point.#ctor" /> - /// <param name="x" type="Number" integer="true"></param> - /// <param name="y" type="Number" integer="true"></param> - /// <field name="x" type="Number" integer="true" locid="F:J#Sys.UI.Point.x"></field> - /// <field name="y" type="Number" integer="true" locid="F:J#Sys.UI.Point.y"></field> - var e = Function._validateParams(arguments, [ - {name: "x", type: Number, integer: true}, - {name: "y", type: Number, integer: true} - ]); - if (e) throw e; - this.x = x; - this.y = y; -} -Sys.UI.Point.registerClass('Sys.UI.Point'); - -Sys.UI.Bounds = function Sys$UI$Bounds(x, y, width, height) { - /// <summary locid="M:J#Sys.UI.Bounds.#ctor" /> - /// <param name="x" type="Number" integer="true"></param> - /// <param name="y" type="Number" integer="true"></param> - /// <param name="height" type="Number" integer="true"></param> - /// <param name="width" type="Number" integer="true"></param> - /// <field name="x" type="Number" integer="true" locid="F:J#Sys.UI.Bounds.x"></field> - /// <field name="y" type="Number" integer="true" locid="F:J#Sys.UI.Bounds.y"></field> - /// <field name="height" type="Number" integer="true" locid="F:J#Sys.UI.Bounds.height"></field> - /// <field name="width" type="Number" integer="true" locid="F:J#Sys.UI.Bounds.width"></field> - var e = Function._validateParams(arguments, [ - {name: "x", type: Number, integer: true}, - {name: "y", type: Number, integer: true}, - {name: "height", type: Number, integer: true}, - {name: "width", type: Number, integer: true} - ]); - if (e) throw e; - this.x = x; - this.y = y; - this.height = height; - this.width = width; -} -Sys.UI.Bounds.registerClass('Sys.UI.Bounds'); - -Sys.UI.DomEvent = function Sys$UI$DomEvent(eventObject) { - /// <summary locid="M:J#Sys.UI.DomEvent.#ctor" /> - /// <param name="eventObject"></param> - /// <field name="altKey" type="Boolean" locid="F:J#Sys.UI.DomEvent.altKey"></field> - /// <field name="button" type="Sys.UI.MouseButton" locid="F:J#Sys.UI.DomEvent.button"></field> - /// <field name="charCode" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.charCode"></field> - /// <field name="clientX" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.clientX"></field> - /// <field name="clientY" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.clientY"></field> - /// <field name="ctrlKey" type="Boolean" locid="F:J#Sys.UI.DomEvent.ctrlKey"></field> - /// <field name="keyCode" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.keyCode"></field> - /// <field name="offsetX" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.offsetX"></field> - /// <field name="offsetY" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.offsetY"></field> - /// <field name="screenX" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.screenX"></field> - /// <field name="screenY" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.screenY"></field> - /// <field name="shiftKey" type="Boolean" locid="F:J#Sys.UI.DomEvent.shiftKey"></field> - /// <field name="target" locid="F:J#Sys.UI.DomEvent.target"></field> - /// <field name="type" type="String" locid="F:J#Sys.UI.DomEvent.type"></field> - var e = Function._validateParams(arguments, [ - {name: "eventObject"} - ]); - if (e) throw e; - var e = eventObject; - var etype = this.type = e.type.toLowerCase(); - this.rawEvent = e; - this.altKey = e.altKey; - if (typeof(e.button) !== 'undefined') { - this.button = (typeof(e.which) !== 'undefined') ? e.button : - (e.button === 4) ? Sys.UI.MouseButton.middleButton : - (e.button === 2) ? Sys.UI.MouseButton.rightButton : - Sys.UI.MouseButton.leftButton; - } - if (etype === 'keypress') { - this.charCode = e.charCode || e.keyCode; - } - else if (e.keyCode && (e.keyCode === 46)) { - this.keyCode = 127; - } - else { - this.keyCode = e.keyCode; - } - this.clientX = e.clientX; - this.clientY = e.clientY; - this.ctrlKey = e.ctrlKey; - this.target = e.target ? e.target : e.srcElement; - if (!etype.startsWith('key')) { - if ((typeof(e.offsetX) !== 'undefined') && (typeof(e.offsetY) !== 'undefined')) { - this.offsetX = e.offsetX; - this.offsetY = e.offsetY; - } - else if (this.target && (this.target.nodeType !== 3) && (typeof(e.clientX) === 'number')) { - var loc = Sys.UI.DomElement.getLocation(this.target); - var w = Sys.UI.DomElement._getWindow(this.target); - this.offsetX = (w.pageXOffset || 0) + e.clientX - loc.x; - this.offsetY = (w.pageYOffset || 0) + e.clientY - loc.y; - } - } - this.screenX = e.screenX; - this.screenY = e.screenY; - this.shiftKey = e.shiftKey; -} - function Sys$UI$DomEvent$preventDefault() { - /// <summary locid="M:J#Sys.UI.DomEvent.preventDefault" /> - if (arguments.length !== 0) throw Error.parameterCount(); - if (this.rawEvent.preventDefault) { - this.rawEvent.preventDefault(); - } - else if (window.event) { - this.rawEvent.returnValue = false; - } - } - function Sys$UI$DomEvent$stopPropagation() { - /// <summary locid="M:J#Sys.UI.DomEvent.stopPropagation" /> - if (arguments.length !== 0) throw Error.parameterCount(); - if (this.rawEvent.stopPropagation) { - this.rawEvent.stopPropagation(); - } - else if (window.event) { - this.rawEvent.cancelBubble = true; - } - } -Sys.UI.DomEvent.prototype = { - preventDefault: Sys$UI$DomEvent$preventDefault, - stopPropagation: Sys$UI$DomEvent$stopPropagation -} -Sys.UI.DomEvent.registerClass('Sys.UI.DomEvent'); -var $addHandler = Sys.UI.DomEvent.addHandler = function Sys$UI$DomEvent$addHandler(element, eventName, handler) { - /// <summary locid="M:J#Sys.UI.DomEvent.addHandler" /> - /// <param name="element"></param> - /// <param name="eventName" type="String"></param> - /// <param name="handler" type="Function"></param> - var e = Function._validateParams(arguments, [ - {name: "element"}, - {name: "eventName", type: String}, - {name: "handler", type: Function} - ]); - if (e) throw e; - Sys.UI.DomEvent._ensureDomNode(element); - if (eventName === "error") throw Error.invalidOperation(Sys.Res.addHandlerCantBeUsedForError); - if (!element._events) { - element._events = {}; - } - var eventCache = element._events[eventName]; - if (!eventCache) { - element._events[eventName] = eventCache = []; - } - var browserHandler; - if (element.addEventListener) { - browserHandler = function(e) { - return handler.call(element, new Sys.UI.DomEvent(e)); - } - element.addEventListener(eventName, browserHandler, false); - } - else if (element.attachEvent) { - browserHandler = function() { - var e = {}; - try {e = Sys.UI.DomElement._getWindow(element).event} catch(ex) {} - return handler.call(element, new Sys.UI.DomEvent(e)); - } - element.attachEvent('on' + eventName, browserHandler); - } - eventCache[eventCache.length] = {handler: handler, browserHandler: browserHandler}; -} -var $addHandlers = Sys.UI.DomEvent.addHandlers = function Sys$UI$DomEvent$addHandlers(element, events, handlerOwner) { - /// <summary locid="M:J#Sys.UI.DomEvent.addHandlers" /> - /// <param name="element"></param> - /// <param name="events" type="Object"></param> - /// <param name="handlerOwner" optional="true"></param> - var e = Function._validateParams(arguments, [ - {name: "element"}, - {name: "events", type: Object}, - {name: "handlerOwner", optional: true} - ]); - if (e) throw e; - Sys.UI.DomEvent._ensureDomNode(element); - for (var name in events) { - var handler = events[name]; - if (typeof(handler) !== 'function') throw Error.invalidOperation(Sys.Res.cantAddNonFunctionhandler); - if (handlerOwner) { - handler = Function.createDelegate(handlerOwner, handler); - } - $addHandler(element, name, handler); - } -} -var $clearHandlers = Sys.UI.DomEvent.clearHandlers = function Sys$UI$DomEvent$clearHandlers(element) { - /// <summary locid="M:J#Sys.UI.DomEvent.clearHandlers" /> - /// <param name="element"></param> - var e = Function._validateParams(arguments, [ - {name: "element"} - ]); - if (e) throw e; - Sys.UI.DomEvent._ensureDomNode(element); - if (element._events) { - var cache = element._events; - for (var name in cache) { - var handlers = cache[name]; - for (var i = handlers.length - 1; i >= 0; i--) { - $removeHandler(element, name, handlers[i].handler); - } - } - element._events = null; - } -} -var $removeHandler = Sys.UI.DomEvent.removeHandler = function Sys$UI$DomEvent$removeHandler(element, eventName, handler) { - /// <summary locid="M:J#Sys.UI.DomEvent.removeHandler" /> - /// <param name="element"></param> - /// <param name="eventName" type="String"></param> - /// <param name="handler" type="Function"></param> - var e = Function._validateParams(arguments, [ - {name: "element"}, - {name: "eventName", type: String}, - {name: "handler", type: Function} - ]); - if (e) throw e; - Sys.UI.DomEvent._ensureDomNode(element); - var browserHandler = null; - if ((typeof(element._events) !== 'object') || (element._events == null)) throw Error.invalidOperation(Sys.Res.eventHandlerInvalid); - var cache = element._events[eventName]; - if (!(cache instanceof Array)) throw Error.invalidOperation(Sys.Res.eventHandlerInvalid); - for (var i = 0, l = cache.length; i < l; i++) { - if (cache[i].handler === handler) { - browserHandler = cache[i].browserHandler; - break; - } - } - if (typeof(browserHandler) !== 'function') throw Error.invalidOperation(Sys.Res.eventHandlerInvalid); - if (element.removeEventListener) { - element.removeEventListener(eventName, browserHandler, false); - } - else if (element.detachEvent) { - element.detachEvent('on' + eventName, browserHandler); - } - cache.splice(i, 1); -} -Sys.UI.DomEvent._ensureDomNode = function Sys$UI$DomEvent$_ensureDomNode(element) { - if (element.tagName && (element.tagName.toUpperCase() === "SCRIPT")) return; - - var doc = element.ownerDocument || element.document || element; - if ((typeof(element.document) !== 'object') && (element != doc) && (typeof(element.nodeType) !== 'number')) { - throw Error.argument("element", Sys.Res.argumentDomNode); - } -} - -Sys.UI.DomElement = function Sys$UI$DomElement() { - /// <summary locid="M:J#Sys.UI.DomElement.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); -} -Sys.UI.DomElement.registerClass('Sys.UI.DomElement'); -Sys.UI.DomElement.addCssClass = function Sys$UI$DomElement$addCssClass(element, className) { - /// <summary locid="M:J#Sys.UI.DomElement.addCssClass" /> - /// <param name="element" domElement="true"></param> - /// <param name="className" type="String"></param> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true}, - {name: "className", type: String} - ]); - if (e) throw e; - if (!Sys.UI.DomElement.containsCssClass(element, className)) { - if (element.className === '') { - element.className = className; - } - else { - element.className += ' ' + className; - } - } -} -Sys.UI.DomElement.containsCssClass = function Sys$UI$DomElement$containsCssClass(element, className) { - /// <summary locid="M:J#Sys.UI.DomElement.containsCssClass" /> - /// <param name="element" domElement="true"></param> - /// <param name="className" type="String"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true}, - {name: "className", type: String} - ]); - if (e) throw e; - return Array.contains(element.className.split(' '), className); -} -Sys.UI.DomElement.getBounds = function Sys$UI$DomElement$getBounds(element) { - /// <summary locid="M:J#Sys.UI.DomElement.getBounds" /> - /// <param name="element" domElement="true"></param> - /// <returns type="Sys.UI.Bounds"></returns> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true} - ]); - if (e) throw e; - var offset = Sys.UI.DomElement.getLocation(element); - return new Sys.UI.Bounds(offset.x, offset.y, element.offsetWidth || 0, element.offsetHeight || 0); -} -var $get = Sys.UI.DomElement.getElementById = function Sys$UI$DomElement$getElementById(id, element) { - /// <summary locid="M:J#Sys.UI.DomElement.getElementById" /> - /// <param name="id" type="String"></param> - /// <param name="element" domElement="true" optional="true" mayBeNull="true"></param> - /// <returns domElement="true" mayBeNull="true"></returns> - var e = Function._validateParams(arguments, [ - {name: "id", type: String}, - {name: "element", mayBeNull: true, domElement: true, optional: true} - ]); - if (e) throw e; - if (!element) return document.getElementById(id); - if (element.getElementById) return element.getElementById(id); - var nodeQueue = []; - var childNodes = element.childNodes; - for (var i = 0; i < childNodes.length; i++) { - var node = childNodes[i]; - if (node.nodeType == 1) { - nodeQueue[nodeQueue.length] = node; - } - } - while (nodeQueue.length) { - node = nodeQueue.shift(); - if (node.id == id) { - return node; - } - childNodes = node.childNodes; - for (i = 0; i < childNodes.length; i++) { - node = childNodes[i]; - if (node.nodeType == 1) { - nodeQueue[nodeQueue.length] = node; - } - } - } - return null; -} -switch(Sys.Browser.agent) { - case Sys.Browser.InternetExplorer: - Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) { - /// <summary locid="M:J#Sys.UI.DomElement.getLocation" /> - /// <param name="element" domElement="true"></param> - /// <returns type="Sys.UI.Point"></returns> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true} - ]); - if (e) throw e; - if (element.self || element.nodeType === 9) return new Sys.UI.Point(0,0); - var clientRect = element.getBoundingClientRect(); - if (!clientRect) { - return new Sys.UI.Point(0,0); - } - var documentElement = element.ownerDocument.documentElement; - var offsetX = clientRect.left - 2 + documentElement.scrollLeft, - offsetY = clientRect.top - 2 + documentElement.scrollTop; - - try { - var f = element.ownerDocument.parentWindow.frameElement || null; - if (f) { - var offset = (f.frameBorder === "0" || f.frameBorder === "no") ? 2 : 0; - offsetX += offset; - offsetY += offset; - } - } - catch(ex) { - } - - return new Sys.UI.Point(offsetX, offsetY); - } - break; - case Sys.Browser.Safari: - Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) { - /// <summary locid="M:J#Sys.UI.DomElement.getLocation" /> - /// <param name="element" domElement="true"></param> - /// <returns type="Sys.UI.Point"></returns> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true} - ]); - if (e) throw e; - if ((element.window && (element.window === element)) || element.nodeType === 9) return new Sys.UI.Point(0,0); - var offsetX = 0; - var offsetY = 0; - var previous = null; - var previousStyle = null; - var currentStyle; - for (var parent = element; parent; previous = parent, previousStyle = currentStyle, parent = parent.offsetParent) { - currentStyle = Sys.UI.DomElement._getCurrentStyle(parent); - var tagName = parent.tagName ? parent.tagName.toUpperCase() : null; - if ((parent.offsetLeft || parent.offsetTop) && - ((tagName !== "BODY") || (!previousStyle || previousStyle.position !== "absolute"))) { - offsetX += parent.offsetLeft; - offsetY += parent.offsetTop; - } - } - currentStyle = Sys.UI.DomElement._getCurrentStyle(element); - var elementPosition = currentStyle ? currentStyle.position : null; - if (!elementPosition || (elementPosition !== "absolute")) { - for (var parent = element.parentNode; parent; parent = parent.parentNode) { - tagName = parent.tagName ? parent.tagName.toUpperCase() : null; - if ((tagName !== "BODY") && (tagName !== "HTML") && (parent.scrollLeft || parent.scrollTop)) { - offsetX -= (parent.scrollLeft || 0); - offsetY -= (parent.scrollTop || 0); - } - currentStyle = Sys.UI.DomElement._getCurrentStyle(parent); - var parentPosition = currentStyle ? currentStyle.position : null; - if (parentPosition && (parentPosition === "absolute")) break; - } - } - return new Sys.UI.Point(offsetX, offsetY); - } - break; - case Sys.Browser.Opera: - Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) { - /// <summary locid="M:J#Sys.UI.DomElement.getLocation" /> - /// <param name="element" domElement="true"></param> - /// <returns type="Sys.UI.Point"></returns> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true} - ]); - if (e) throw e; - if ((element.window && (element.window === element)) || element.nodeType === 9) return new Sys.UI.Point(0,0); - var offsetX = 0; - var offsetY = 0; - var previous = null; - for (var parent = element; parent; previous = parent, parent = parent.offsetParent) { - var tagName = parent.tagName; - offsetX += parent.offsetLeft || 0; - offsetY += parent.offsetTop || 0; - } - var elementPosition = element.style.position; - var elementPositioned = elementPosition && (elementPosition !== "static"); - for (var parent = element.parentNode; parent; parent = parent.parentNode) { - tagName = parent.tagName ? parent.tagName.toUpperCase() : null; - if ((tagName !== "BODY") && (tagName !== "HTML") && (parent.scrollLeft || parent.scrollTop) && - ((elementPositioned && - ((parent.style.overflow === "scroll") || (parent.style.overflow === "auto"))))) { - offsetX -= (parent.scrollLeft || 0); - offsetY -= (parent.scrollTop || 0); - } - var parentPosition = (parent && parent.style) ? parent.style.position : null; - elementPositioned = elementPositioned || (parentPosition && (parentPosition !== "static")); - } - return new Sys.UI.Point(offsetX, offsetY); - } - break; - default: - Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) { - /// <summary locid="M:J#Sys.UI.DomElement.getLocation" /> - /// <param name="element" domElement="true"></param> - /// <returns type="Sys.UI.Point"></returns> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true} - ]); - if (e) throw e; - if ((element.window && (element.window === element)) || element.nodeType === 9) return new Sys.UI.Point(0,0); - var offsetX = 0; - var offsetY = 0; - var previous = null; - var previousStyle = null; - var currentStyle = null; - for (var parent = element; parent; previous = parent, previousStyle = currentStyle, parent = parent.offsetParent) { - var tagName = parent.tagName ? parent.tagName.toUpperCase() : null; - currentStyle = Sys.UI.DomElement._getCurrentStyle(parent); - if ((parent.offsetLeft || parent.offsetTop) && - !((tagName === "BODY") && - (!previousStyle || previousStyle.position !== "absolute"))) { - offsetX += parent.offsetLeft; - offsetY += parent.offsetTop; - } - if (previous !== null && currentStyle) { - if ((tagName !== "TABLE") && (tagName !== "TD") && (tagName !== "HTML")) { - offsetX += parseInt(currentStyle.borderLeftWidth) || 0; - offsetY += parseInt(currentStyle.borderTopWidth) || 0; - } - if (tagName === "TABLE" && - (currentStyle.position === "relative" || currentStyle.position === "absolute")) { - offsetX += parseInt(currentStyle.marginLeft) || 0; - offsetY += parseInt(currentStyle.marginTop) || 0; - } - } - } - currentStyle = Sys.UI.DomElement._getCurrentStyle(element); - var elementPosition = currentStyle ? currentStyle.position : null; - if (!elementPosition || (elementPosition !== "absolute")) { - for (var parent = element.parentNode; parent; parent = parent.parentNode) { - tagName = parent.tagName ? parent.tagName.toUpperCase() : null; - if ((tagName !== "BODY") && (tagName !== "HTML") && (parent.scrollLeft || parent.scrollTop)) { - offsetX -= (parent.scrollLeft || 0); - offsetY -= (parent.scrollTop || 0); - currentStyle = Sys.UI.DomElement._getCurrentStyle(parent); - if (currentStyle) { - offsetX += parseInt(currentStyle.borderLeftWidth) || 0; - offsetY += parseInt(currentStyle.borderTopWidth) || 0; - } - } - } - } - return new Sys.UI.Point(offsetX, offsetY); - } - break; -} -Sys.UI.DomElement.removeCssClass = function Sys$UI$DomElement$removeCssClass(element, className) { - /// <summary locid="M:J#Sys.UI.DomElement.removeCssClass" /> - /// <param name="element" domElement="true"></param> - /// <param name="className" type="String"></param> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true}, - {name: "className", type: String} - ]); - if (e) throw e; - var currentClassName = ' ' + element.className + ' '; - var index = currentClassName.indexOf(' ' + className + ' '); - if (index >= 0) { - element.className = (currentClassName.substr(0, index) + ' ' + - currentClassName.substring(index + className.length + 1, currentClassName.length)).trim(); - } -} -Sys.UI.DomElement.setLocation = function Sys$UI$DomElement$setLocation(element, x, y) { - /// <summary locid="M:J#Sys.UI.DomElement.setLocation" /> - /// <param name="element" domElement="true"></param> - /// <param name="x" type="Number" integer="true"></param> - /// <param name="y" type="Number" integer="true"></param> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true}, - {name: "x", type: Number, integer: true}, - {name: "y", type: Number, integer: true} - ]); - if (e) throw e; - var style = element.style; - style.position = 'absolute'; - style.left = x + "px"; - style.top = y + "px"; -} -Sys.UI.DomElement.toggleCssClass = function Sys$UI$DomElement$toggleCssClass(element, className) { - /// <summary locid="M:J#Sys.UI.DomElement.toggleCssClass" /> - /// <param name="element" domElement="true"></param> - /// <param name="className" type="String"></param> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true}, - {name: "className", type: String} - ]); - if (e) throw e; - if (Sys.UI.DomElement.containsCssClass(element, className)) { - Sys.UI.DomElement.removeCssClass(element, className); - } - else { - Sys.UI.DomElement.addCssClass(element, className); - } -} -Sys.UI.DomElement.getVisibilityMode = function Sys$UI$DomElement$getVisibilityMode(element) { - /// <summary locid="M:J#Sys.UI.DomElement.getVisibilityMode" /> - /// <param name="element" domElement="true"></param> - /// <returns type="Sys.UI.VisibilityMode"></returns> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true} - ]); - if (e) throw e; - return (element._visibilityMode === Sys.UI.VisibilityMode.hide) ? - Sys.UI.VisibilityMode.hide : - Sys.UI.VisibilityMode.collapse; -} -Sys.UI.DomElement.setVisibilityMode = function Sys$UI$DomElement$setVisibilityMode(element, value) { - /// <summary locid="M:J#Sys.UI.DomElement.setVisibilityMode" /> - /// <param name="element" domElement="true"></param> - /// <param name="value" type="Sys.UI.VisibilityMode"></param> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true}, - {name: "value", type: Sys.UI.VisibilityMode} - ]); - if (e) throw e; - Sys.UI.DomElement._ensureOldDisplayMode(element); - if (element._visibilityMode !== value) { - element._visibilityMode = value; - if (Sys.UI.DomElement.getVisible(element) === false) { - if (element._visibilityMode === Sys.UI.VisibilityMode.hide) { - element.style.display = element._oldDisplayMode; - } - else { - element.style.display = 'none'; - } - } - element._visibilityMode = value; - } -} -Sys.UI.DomElement.getVisible = function Sys$UI$DomElement$getVisible(element) { - /// <summary locid="M:J#Sys.UI.DomElement.getVisible" /> - /// <param name="element" domElement="true"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true} - ]); - if (e) throw e; - var style = element.currentStyle || Sys.UI.DomElement._getCurrentStyle(element); - if (!style) return true; - return (style.visibility !== 'hidden') && (style.display !== 'none'); -} -Sys.UI.DomElement.setVisible = function Sys$UI$DomElement$setVisible(element, value) { - /// <summary locid="M:J#Sys.UI.DomElement.setVisible" /> - /// <param name="element" domElement="true"></param> - /// <param name="value" type="Boolean"></param> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true}, - {name: "value", type: Boolean} - ]); - if (e) throw e; - if (value !== Sys.UI.DomElement.getVisible(element)) { - Sys.UI.DomElement._ensureOldDisplayMode(element); - element.style.visibility = value ? 'visible' : 'hidden'; - if (value || (element._visibilityMode === Sys.UI.VisibilityMode.hide)) { - element.style.display = element._oldDisplayMode; - } - else { - element.style.display = 'none'; - } - } -} -Sys.UI.DomElement._ensureOldDisplayMode = function Sys$UI$DomElement$_ensureOldDisplayMode(element) { - if (!element._oldDisplayMode) { - var style = element.currentStyle || Sys.UI.DomElement._getCurrentStyle(element); - element._oldDisplayMode = style ? style.display : null; - if (!element._oldDisplayMode || element._oldDisplayMode === 'none') { - switch(element.tagName.toUpperCase()) { - case 'DIV': case 'P': case 'ADDRESS': case 'BLOCKQUOTE': case 'BODY': case 'COL': - case 'COLGROUP': case 'DD': case 'DL': case 'DT': case 'FIELDSET': case 'FORM': - case 'H1': case 'H2': case 'H3': case 'H4': case 'H5': case 'H6': case 'HR': - case 'IFRAME': case 'LEGEND': case 'OL': case 'PRE': case 'TABLE': case 'TD': - case 'TH': case 'TR': case 'UL': - element._oldDisplayMode = 'block'; - break; - case 'LI': - element._oldDisplayMode = 'list-item'; - break; - default: - element._oldDisplayMode = 'inline'; - } - } - } -} -Sys.UI.DomElement._getWindow = function Sys$UI$DomElement$_getWindow(element) { - var doc = element.ownerDocument || element.document || element; - return doc.defaultView || doc.parentWindow; -} -Sys.UI.DomElement._getCurrentStyle = function Sys$UI$DomElement$_getCurrentStyle(element) { - if (element.nodeType === 3) return null; - var w = Sys.UI.DomElement._getWindow(element); - if (element.documentElement) element = element.documentElement; - var computedStyle = (w && (element !== w) && w.getComputedStyle) ? - w.getComputedStyle(element, null) : - element.currentStyle || element.style; - if (!computedStyle && (Sys.Browser.agent === Sys.Browser.Safari) && element.style) { - var oldDisplay = element.style.display; - var oldPosition = element.style.position; - element.style.position = 'absolute'; - element.style.display = 'block'; - var style = w.getComputedStyle(element, null); - element.style.display = oldDisplay; - element.style.position = oldPosition; - computedStyle = {}; - for (var n in style) { - computedStyle[n] = style[n]; - } - computedStyle.display = 'none'; - } - return computedStyle; -} - -Sys.IContainer = function Sys$IContainer() { - throw Error.notImplemented(); -} - function Sys$IContainer$addComponent(component) { - /// <summary locid="M:J#Sys.IContainer.addComponent" /> - /// <param name="component" type="Sys.Component"></param> - var e = Function._validateParams(arguments, [ - {name: "component", type: Sys.Component} - ]); - if (e) throw e; - throw Error.notImplemented(); - } - function Sys$IContainer$removeComponent(component) { - /// <summary locid="M:J#Sys.IContainer.removeComponent" /> - /// <param name="component" type="Sys.Component"></param> - var e = Function._validateParams(arguments, [ - {name: "component", type: Sys.Component} - ]); - if (e) throw e; - throw Error.notImplemented(); - } - function Sys$IContainer$findComponent(id) { - /// <summary locid="M:J#Sys.IContainer.findComponent" /> - /// <param name="id" type="String"></param> - /// <returns type="Sys.Component"></returns> - var e = Function._validateParams(arguments, [ - {name: "id", type: String} - ]); - if (e) throw e; - throw Error.notImplemented(); - } - function Sys$IContainer$getComponents() { - /// <summary locid="M:J#Sys.IContainer.getComponents" /> - /// <returns type="Array" elementType="Sys.Component"></returns> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); - } -Sys.IContainer.prototype = { - addComponent: Sys$IContainer$addComponent, - removeComponent: Sys$IContainer$removeComponent, - findComponent: Sys$IContainer$findComponent, - getComponents: Sys$IContainer$getComponents -} -Sys.IContainer.registerInterface("Sys.IContainer"); - -Sys._ScriptLoader = function Sys$_ScriptLoader() { - this._scriptsToLoad = null; - this._sessions = []; - this._scriptLoadedDelegate = Function.createDelegate(this, this._scriptLoadedHandler); -} - function Sys$_ScriptLoader$dispose() { - this._stopSession(); - this._loading = false; - if(this._events) { - delete this._events; - } - this._sessions = null; - this._currentSession = null; - this._scriptLoadedDelegate = null; - } - function Sys$_ScriptLoader$loadScripts(scriptTimeout, allScriptsLoadedCallback, scriptLoadFailedCallback, scriptLoadTimeoutCallback) { - /// <summary locid="M:J#Sys._ScriptLoader.loadScripts" /> - /// <param name="scriptTimeout" type="Number" integer="true"></param> - /// <param name="allScriptsLoadedCallback" type="Function" mayBeNull="true"></param> - /// <param name="scriptLoadFailedCallback" type="Function" mayBeNull="true"></param> - /// <param name="scriptLoadTimeoutCallback" type="Function" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "scriptTimeout", type: Number, integer: true}, - {name: "allScriptsLoadedCallback", type: Function, mayBeNull: true}, - {name: "scriptLoadFailedCallback", type: Function, mayBeNull: true}, - {name: "scriptLoadTimeoutCallback", type: Function, mayBeNull: true} - ]); - if (e) throw e; - var session = { - allScriptsLoadedCallback: allScriptsLoadedCallback, - scriptLoadFailedCallback: scriptLoadFailedCallback, - scriptLoadTimeoutCallback: scriptLoadTimeoutCallback, - scriptsToLoad: this._scriptsToLoad, - scriptTimeout: scriptTimeout }; - this._scriptsToLoad = null; - this._sessions[this._sessions.length] = session; - - if (!this._loading) { - this._nextSession(); - } - } - function Sys$_ScriptLoader$notifyScriptLoaded() { - /// <summary locid="M:J#Sys._ScriptLoader.notifyScriptLoaded" /> - if (arguments.length !== 0) throw Error.parameterCount(); - - if(!this._loading) { - return; - } - this._currentTask._notified++; - - if(Sys.Browser.agent === Sys.Browser.Safari) { - if(this._currentTask._notified === 1) { - window.setTimeout(Function.createDelegate(this, function() { - this._scriptLoadedHandler(this._currentTask.get_scriptElement(), true); - }), 0); - } - } - } - function Sys$_ScriptLoader$queueCustomScriptTag(scriptAttributes) { - /// <summary locid="M:J#Sys._ScriptLoader.queueCustomScriptTag" /> - /// <param name="scriptAttributes" mayBeNull="false"></param> - var e = Function._validateParams(arguments, [ - {name: "scriptAttributes"} - ]); - if (e) throw e; - if(!this._scriptsToLoad) { - this._scriptsToLoad = []; - } - Array.add(this._scriptsToLoad, scriptAttributes); - } - function Sys$_ScriptLoader$queueScriptBlock(scriptContent) { - /// <summary locid="M:J#Sys._ScriptLoader.queueScriptBlock" /> - /// <param name="scriptContent" type="String" mayBeNull="false"></param> - var e = Function._validateParams(arguments, [ - {name: "scriptContent", type: String} - ]); - if (e) throw e; - if(!this._scriptsToLoad) { - this._scriptsToLoad = []; - } - Array.add(this._scriptsToLoad, {text: scriptContent}); - } - function Sys$_ScriptLoader$queueScriptReference(scriptUrl) { - /// <summary locid="M:J#Sys._ScriptLoader.queueScriptReference" /> - /// <param name="scriptUrl" type="String" mayBeNull="false"></param> - var e = Function._validateParams(arguments, [ - {name: "scriptUrl", type: String} - ]); - if (e) throw e; - if(!this._scriptsToLoad) { - this._scriptsToLoad = []; - } - Array.add(this._scriptsToLoad, {src: scriptUrl}); - } - function Sys$_ScriptLoader$_createScriptElement(queuedScript) { - var scriptElement = document.createElement('script'); - scriptElement.type = 'text/javascript'; - for (var attr in queuedScript) { - scriptElement[attr] = queuedScript[attr]; - } - - return scriptElement; - } - function Sys$_ScriptLoader$_loadScriptsInternal() { - var session = this._currentSession; - if (session.scriptsToLoad && session.scriptsToLoad.length > 0) { - var nextScript = Array.dequeue(session.scriptsToLoad); - var scriptElement = this._createScriptElement(nextScript); - - if (scriptElement.text && Sys.Browser.agent === Sys.Browser.Safari) { - scriptElement.innerHTML = scriptElement.text; - delete scriptElement.text; - } - if (typeof(nextScript.src) === "string") { - this._currentTask = new Sys._ScriptLoaderTask(scriptElement, this._scriptLoadedDelegate); - this._currentTask.execute(); - } - else { - var headElements = document.getElementsByTagName('head'); - if (headElements.length === 0) { - throw new Error.invalidOperation(Sys.Res.scriptLoadFailedNoHead); - } - else { - headElements[0].appendChild(scriptElement); - } - - - Sys._ScriptLoader._clearScript(scriptElement); - this._loadScriptsInternal(); - } - } - else { - this._stopSession(); - var callback = session.allScriptsLoadedCallback; - if(callback) { - callback(this); - } - this._nextSession(); - } - } - function Sys$_ScriptLoader$_nextSession() { - if (this._sessions.length === 0) { - this._loading = false; - this._currentSession = null; - return; - } - this._loading = true; - - var session = Array.dequeue(this._sessions); - this._currentSession = session; - this._loadScriptsInternal(); - } - function Sys$_ScriptLoader$_raiseError(multipleCallbacks) { - var callback = this._currentSession.scriptLoadFailedCallback; - var scriptElement = this._currentTask.get_scriptElement(); - this._stopSession(); - - if(callback) { - callback(this, scriptElement, multipleCallbacks); - this._nextSession(); - } - else { - this._loading = false; - throw Sys._ScriptLoader._errorScriptLoadFailed(scriptElement.src, multipleCallbacks); - } - } - function Sys$_ScriptLoader$_scriptLoadedHandler(scriptElement, loaded) { - if(loaded && this._currentTask._notified) { - if(this._currentTask._notified > 1) { - this._raiseError(true); - } - else { - Array.add(Sys._ScriptLoader._getLoadedScripts(), scriptElement.src); - this._currentTask.dispose(); - this._currentTask = null; - this._loadScriptsInternal(); - } - } - else { - this._raiseError(false); - } - } - function Sys$_ScriptLoader$_scriptLoadTimeoutHandler() { - var callback = this._currentSession.scriptLoadTimeoutCallback; - this._stopSession(); - if(callback) { - callback(this); - } - this._nextSession(); - } - function Sys$_ScriptLoader$_stopSession() { - if(this._currentTask) { - this._currentTask.dispose(); - this._currentTask = null; - } - } -Sys._ScriptLoader.prototype = { - dispose: Sys$_ScriptLoader$dispose, - loadScripts: Sys$_ScriptLoader$loadScripts, - notifyScriptLoaded: Sys$_ScriptLoader$notifyScriptLoaded, - queueCustomScriptTag: Sys$_ScriptLoader$queueCustomScriptTag, - queueScriptBlock: Sys$_ScriptLoader$queueScriptBlock, - queueScriptReference: Sys$_ScriptLoader$queueScriptReference, - _createScriptElement: Sys$_ScriptLoader$_createScriptElement, - _loadScriptsInternal: Sys$_ScriptLoader$_loadScriptsInternal, - _nextSession: Sys$_ScriptLoader$_nextSession, - _raiseError: Sys$_ScriptLoader$_raiseError, - _scriptLoadedHandler: Sys$_ScriptLoader$_scriptLoadedHandler, - _scriptLoadTimeoutHandler: Sys$_ScriptLoader$_scriptLoadTimeoutHandler, - _stopSession: Sys$_ScriptLoader$_stopSession -} -Sys._ScriptLoader.registerClass('Sys._ScriptLoader', null, Sys.IDisposable); -Sys._ScriptLoader.getInstance = function Sys$_ScriptLoader$getInstance() { - var sl = Sys._ScriptLoader._activeInstance; - if(!sl) { - sl = Sys._ScriptLoader._activeInstance = new Sys._ScriptLoader(); - } - return sl; -} -Sys._ScriptLoader.isScriptLoaded = function Sys$_ScriptLoader$isScriptLoaded(scriptSrc) { - var dummyScript = document.createElement('script'); - dummyScript.src = scriptSrc; - return Array.contains(Sys._ScriptLoader._getLoadedScripts(), dummyScript.src); -} -Sys._ScriptLoader.readLoadedScripts = function Sys$_ScriptLoader$readLoadedScripts() { - if(!Sys._ScriptLoader._referencedScripts) { - var referencedScripts = Sys._ScriptLoader._referencedScripts = []; - var existingScripts = document.getElementsByTagName('script'); - for (i = existingScripts.length - 1; i >= 0; i--) { - var scriptNode = existingScripts[i]; - var scriptSrc = scriptNode.src; - if (scriptSrc.length) { - if (!Array.contains(referencedScripts, scriptSrc)) { - Array.add(referencedScripts, scriptSrc); - } - } - } - } -} -Sys._ScriptLoader._clearScript = function Sys$_ScriptLoader$_clearScript(scriptElement) { - if (!Sys.Debug.isDebug) { - scriptElement.parentNode.removeChild(scriptElement); - } -} -Sys._ScriptLoader._errorScriptLoadFailed = function Sys$_ScriptLoader$_errorScriptLoadFailed(scriptUrl, multipleCallbacks) { - var errorMessage; - if(multipleCallbacks) { - errorMessage = Sys.Res.scriptLoadMultipleCallbacks; - } - else { - errorMessage = Sys.Res.scriptLoadFailedDebug; - } - var displayMessage = "Sys.ScriptLoadFailedException: " + String.format(errorMessage, scriptUrl); - var e = Error.create(displayMessage, {name: 'Sys.ScriptLoadFailedException', 'scriptUrl': scriptUrl }); - e.popStackFrame(); - return e; -} -Sys._ScriptLoader._getLoadedScripts = function Sys$_ScriptLoader$_getLoadedScripts() { - if(!Sys._ScriptLoader._referencedScripts) { - Sys._ScriptLoader._referencedScripts = []; - Sys._ScriptLoader.readLoadedScripts(); - } - return Sys._ScriptLoader._referencedScripts; -} - -Sys._ScriptLoaderTask = function Sys$_ScriptLoaderTask(scriptElement, completedCallback) { - /// <summary locid="M:J#Sys._ScriptLoaderTask.#ctor" /> - /// <param name="scriptElement" domElement="true"></param> - /// <param name="completedCallback" type="Function"></param> - var e = Function._validateParams(arguments, [ - {name: "scriptElement", domElement: true}, - {name: "completedCallback", type: Function} - ]); - if (e) throw e; - this._scriptElement = scriptElement; - this._completedCallback = completedCallback; - this._notified = 0; -} - function Sys$_ScriptLoaderTask$get_scriptElement() { - /// <value domElement="true" locid="P:J#Sys._ScriptLoaderTask.scriptElement"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._scriptElement; - } - function Sys$_ScriptLoaderTask$dispose() { - if(this._disposed) { - return; - } - this._disposed = true; - this._removeScriptElementHandlers(); - Sys._ScriptLoader._clearScript(this._scriptElement); - this._scriptElement = null; - } - function Sys$_ScriptLoaderTask$execute() { - /// <summary locid="M:J#Sys._ScriptLoaderTask.execute" /> - if (arguments.length !== 0) throw Error.parameterCount(); - this._addScriptElementHandlers(); - var headElements = document.getElementsByTagName('head'); - if (headElements.length === 0) { - throw new Error.invalidOperation(Sys.Res.scriptLoadFailedNoHead); - } - else { - headElements[0].appendChild(this._scriptElement); - } - } - function Sys$_ScriptLoaderTask$_addScriptElementHandlers() { - this._scriptLoadDelegate = Function.createDelegate(this, this._scriptLoadHandler); - - if (Sys.Browser.agent !== Sys.Browser.InternetExplorer) { - this._scriptElement.readyState = 'loaded'; - $addHandler(this._scriptElement, 'load', this._scriptLoadDelegate); - } - else { - $addHandler(this._scriptElement, 'readystatechange', this._scriptLoadDelegate); - } - if (this._scriptElement.addEventListener) { - this._scriptErrorDelegate = Function.createDelegate(this, this._scriptErrorHandler); - this._scriptElement.addEventListener('error', this._scriptErrorDelegate, false); - } - } - function Sys$_ScriptLoaderTask$_removeScriptElementHandlers() { - if(this._scriptLoadDelegate) { - var scriptElement = this.get_scriptElement(); - if (Sys.Browser.agent !== Sys.Browser.InternetExplorer) { - $removeHandler(scriptElement, 'load', this._scriptLoadDelegate); - } - else { - $removeHandler(scriptElement, 'readystatechange', this._scriptLoadDelegate); - } - if (this._scriptErrorDelegate) { - this._scriptElement.removeEventListener('error', this._scriptErrorDelegate, false); - this._scriptErrorDelegate = null; - } - this._scriptLoadDelegate = null; - } - } - function Sys$_ScriptLoaderTask$_scriptErrorHandler() { - if(this._disposed) { - return; - } - - this._completedCallback(this.get_scriptElement(), false); - } - function Sys$_ScriptLoaderTask$_scriptLoadHandler() { - if(this._disposed) { - return; - } - var scriptElement = this.get_scriptElement(); - if ((scriptElement.readyState !== 'loaded') && - (scriptElement.readyState !== 'complete')) { - return; - } - - var _this = this; - window.setTimeout(function() { - _this._completedCallback(scriptElement, true); - }, 0); - } -Sys._ScriptLoaderTask.prototype = { - get_scriptElement: Sys$_ScriptLoaderTask$get_scriptElement, - dispose: Sys$_ScriptLoaderTask$dispose, - execute: Sys$_ScriptLoaderTask$execute, - _addScriptElementHandlers: Sys$_ScriptLoaderTask$_addScriptElementHandlers, - _removeScriptElementHandlers: Sys$_ScriptLoaderTask$_removeScriptElementHandlers, - _scriptErrorHandler: Sys$_ScriptLoaderTask$_scriptErrorHandler, - _scriptLoadHandler: Sys$_ScriptLoaderTask$_scriptLoadHandler -} -Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask", null, Sys.IDisposable); - -Sys.ApplicationLoadEventArgs = function Sys$ApplicationLoadEventArgs(components, isPartialLoad) { - /// <summary locid="M:J#Sys.ApplicationLoadEventArgs.#ctor" /> - /// <param name="components" type="Array" elementType="Sys.Component"></param> - /// <param name="isPartialLoad" type="Boolean"></param> - var e = Function._validateParams(arguments, [ - {name: "components", type: Array, elementType: Sys.Component}, - {name: "isPartialLoad", type: Boolean} - ]); - if (e) throw e; - Sys.ApplicationLoadEventArgs.initializeBase(this); - this._components = components; - this._isPartialLoad = isPartialLoad; -} - - function Sys$ApplicationLoadEventArgs$get_components() { - /// <value type="Array" elementType="Sys.Component" locid="P:J#Sys.ApplicationLoadEventArgs.components"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._components; - } - function Sys$ApplicationLoadEventArgs$get_isPartialLoad() { - /// <value type="Boolean" locid="P:J#Sys.ApplicationLoadEventArgs.isPartialLoad"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._isPartialLoad; - } -Sys.ApplicationLoadEventArgs.prototype = { - get_components: Sys$ApplicationLoadEventArgs$get_components, - get_isPartialLoad: Sys$ApplicationLoadEventArgs$get_isPartialLoad -} -Sys.ApplicationLoadEventArgs.registerClass('Sys.ApplicationLoadEventArgs', Sys.EventArgs); -Sys.HistoryEventArgs = function Sys$HistoryEventArgs(state) { - /// <summary locid="M:J#Sys.HistoryEventArgs.#ctor" /> - /// <param name="state" type="Object"></param> - var e = Function._validateParams(arguments, [ - {name: "state", type: Object} - ]); - if (e) throw e; - Sys.HistoryEventArgs.initializeBase(this); - this._state = state; -} - function Sys$HistoryEventArgs$get_state() { - /// <value type="Object" locid="P:J#Sys.HistoryEventArgs.state"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._state; - } -Sys.HistoryEventArgs.prototype = { - get_state: Sys$HistoryEventArgs$get_state -} -Sys.HistoryEventArgs.registerClass('Sys.HistoryEventArgs', Sys.EventArgs); - -Sys._Application = function Sys$_Application() { - /// <summary locid="M:J#Sys.Application.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); - Sys._Application.initializeBase(this); - this._disposableObjects = []; - this._components = {}; - this._createdComponents = []; - this._secondPassComponents = []; - this._appLoadHandler = null; - this._beginRequestHandler = null; - this._clientId = null; - this._currentEntry = ''; - this._endRequestHandler = null; - this._history = null; - this._enableHistory = false; - this._historyEnabledInScriptManager = false; - this._historyFrame = null; - this._historyInitialized = false; - this._historyInitialLength = 0; - this._historyLength = 0; - this._historyPointIsNew = false; - this._ignoreTimer = false; - this._initialState = null; - this._state = {}; - this._timerCookie = 0; - this._timerHandler = null; - this._uniqueId = null; - this._unloadHandlerDelegate = Function.createDelegate(this, this._unloadHandler); - this._loadHandlerDelegate = Function.createDelegate(this, this._loadHandler); - Sys.UI.DomEvent.addHandler(window, "unload", this._unloadHandlerDelegate); - Sys.UI.DomEvent.addHandler(window, "load", this._loadHandlerDelegate); -} - function Sys$_Application$get_isCreatingComponents() { - /// <value type="Boolean" locid="P:J#Sys.Application.isCreatingComponents"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._creatingComponents; - } - function Sys$_Application$get_stateString() { - /// <value type="String" locid="P:J#Sys.Application.stateString"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - var hash = window.location.hash; - if (this._isSafari2()) { - var history = this._getHistory(); - if (history) { - hash = history[window.history.length - this._historyInitialLength]; - } - } - if ((hash.length > 0) && (hash.charAt(0) === '#')) { - hash = hash.substring(1); - } - if (Sys.Browser.agent === Sys.Browser.Firefox) { - hash = this._serializeState(this._deserializeState(hash, true)); - } - return hash; - } - function Sys$_Application$get_enableHistory() { - /// <value type="Boolean" locid="P:J#Sys.Application.enableHistory"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._enableHistory; - } - function Sys$_Application$set_enableHistory(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]); - if (e) throw e; - if (this._initialized && !this._initializing) { - throw Error.invalidOperation(Sys.Res.historyCannotEnableHistory); - } - else if (this._historyEnabledInScriptManager && !value) { - throw Error.invalidOperation(Sys.Res.invalidHistorySettingCombination); - } - this._enableHistory = value; - } - function Sys$_Application$add_init(handler) { - /// <summary locid="E:J#Sys.Application.init" /> - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - if (this._initialized) { - handler(this, Sys.EventArgs.Empty); - } - else { - this.get_events().addHandler("init", handler); - } - } - function Sys$_Application$remove_init(handler) { - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this.get_events().removeHandler("init", handler); - } - function Sys$_Application$add_load(handler) { - /// <summary locid="E:J#Sys.Application.load" /> - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this.get_events().addHandler("load", handler); - } - function Sys$_Application$remove_load(handler) { - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this.get_events().removeHandler("load", handler); - } - function Sys$_Application$add_navigate(handler) { - /// <summary locid="E:J#Sys.Application.navigate" /> - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this.get_events().addHandler("navigate", handler); - } - function Sys$_Application$remove_navigate(handler) { - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this.get_events().removeHandler("navigate", handler); - } - function Sys$_Application$add_unload(handler) { - /// <summary locid="E:J#Sys.Application.unload" /> - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this.get_events().addHandler("unload", handler); - } - function Sys$_Application$remove_unload(handler) { - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this.get_events().removeHandler("unload", handler); - } - function Sys$_Application$addComponent(component) { - /// <summary locid="M:J#Sys.Application.addComponent" /> - /// <param name="component" type="Sys.Component"></param> - var e = Function._validateParams(arguments, [ - {name: "component", type: Sys.Component} - ]); - if (e) throw e; - var id = component.get_id(); - if (!id) throw Error.invalidOperation(Sys.Res.cantAddWithoutId); - if (typeof(this._components[id]) !== 'undefined') throw Error.invalidOperation(String.format(Sys.Res.appDuplicateComponent, id)); - this._components[id] = component; - } - function Sys$_Application$addHistoryPoint(state, title) { - /// <summary locid="M:J#Sys.Application.addHistoryPoint" /> - /// <param name="state" type="Object"></param> - /// <param name="title" type="String" optional="true" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "state", type: Object}, - {name: "title", type: String, mayBeNull: true, optional: true} - ]); - if (e) throw e; - if (!this._enableHistory) throw Error.invalidOperation(Sys.Res.historyCannotAddHistoryPointWithHistoryDisabled); - for (var n in state) { - var v = state[n]; - var t = typeof(v); - if ((v !== null) && ((t === 'object') || (t === 'function') || (t === 'undefined'))) { - throw Error.argument('state', Sys.Res.stateMustBeStringDictionary); - } - } - this._ensureHistory(); - var initialState = this._state; - for (var key in state) { - var value = state[key]; - if (value === null) { - if (typeof(initialState[key]) !== 'undefined') { - delete initialState[key]; - } - } - else { - initialState[key] = value; - } - } - var entry = this._serializeState(initialState); - this._historyPointIsNew = true; - this._setState(entry, title); - this._raiseNavigate(); - } - function Sys$_Application$beginCreateComponents() { - /// <summary locid="M:J#Sys.Application.beginCreateComponents" /> - if (arguments.length !== 0) throw Error.parameterCount(); - this._creatingComponents = true; - } - function Sys$_Application$dispose() { - /// <summary locid="M:J#Sys.Application.dispose" /> - if (arguments.length !== 0) throw Error.parameterCount(); - if (!this._disposing) { - this._disposing = true; - if (this._timerCookie) { - window.clearTimeout(this._timerCookie); - delete this._timerCookie; - } - if (this._endRequestHandler) { - Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler); - delete this._endRequestHandler; - } - if (this._beginRequestHandler) { - Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler); - delete this._beginRequestHandler; - } - if (window.pageUnload) { - window.pageUnload(this, Sys.EventArgs.Empty); - } - var unloadHandler = this.get_events().getHandler("unload"); - if (unloadHandler) { - unloadHandler(this, Sys.EventArgs.Empty); - } - var disposableObjects = Array.clone(this._disposableObjects); - for (var i = 0, l = disposableObjects.length; i < l; i++) { - disposableObjects[i].dispose(); - } - Array.clear(this._disposableObjects); - Sys.UI.DomEvent.removeHandler(window, "unload", this._unloadHandlerDelegate); - if(this._loadHandlerDelegate) { - Sys.UI.DomEvent.removeHandler(window, "load", this._loadHandlerDelegate); - this._loadHandlerDelegate = null; - } - var sl = Sys._ScriptLoader.getInstance(); - if(sl) { - sl.dispose(); - } - Sys._Application.callBaseMethod(this, 'dispose'); - } - } - function Sys$_Application$endCreateComponents() { - /// <summary locid="M:J#Sys.Application.endCreateComponents" /> - if (arguments.length !== 0) throw Error.parameterCount(); - var components = this._secondPassComponents; - for (var i = 0, l = components.length; i < l; i++) { - var component = components[i].component; - Sys$Component$_setReferences(component, components[i].references); - component.endUpdate(); - } - this._secondPassComponents = []; - this._creatingComponents = false; - } - function Sys$_Application$findComponent(id, parent) { - /// <summary locid="M:J#Sys.Application.findComponent" /> - /// <param name="id" type="String"></param> - /// <param name="parent" optional="true" mayBeNull="true"></param> - /// <returns type="Sys.Component" mayBeNull="true"></returns> - var e = Function._validateParams(arguments, [ - {name: "id", type: String}, - {name: "parent", mayBeNull: true, optional: true} - ]); - if (e) throw e; - return (parent ? - ((Sys.IContainer.isInstanceOfType(parent)) ? - parent.findComponent(id) : - parent[id] || null) : - Sys.Application._components[id] || null); - } - function Sys$_Application$getComponents() { - /// <summary locid="M:J#Sys.Application.getComponents" /> - /// <returns type="Array" elementType="Sys.Component"></returns> - if (arguments.length !== 0) throw Error.parameterCount(); - var res = []; - var components = this._components; - for (var name in components) { - res[res.length] = components[name]; - } - return res; - } - function Sys$_Application$initialize() { - /// <summary locid="M:J#Sys.Application.initialize" /> - if (arguments.length !== 0) throw Error.parameterCount(); - if(!this._initialized && !this._initializing) { - this._initializing = true; - window.setTimeout(Function.createDelegate(this, this._doInitialize), 0); - } - } - function Sys$_Application$notifyScriptLoaded() { - /// <summary locid="M:J#Sys.Application.notifyScriptLoaded" /> - if (arguments.length !== 0) throw Error.parameterCount(); - var sl = Sys._ScriptLoader.getInstance(); - if(sl) { - sl.notifyScriptLoaded(); - } - } - function Sys$_Application$registerDisposableObject(object) { - /// <summary locid="M:J#Sys.Application.registerDisposableObject" /> - /// <param name="object" type="Sys.IDisposable"></param> - var e = Function._validateParams(arguments, [ - {name: "object", type: Sys.IDisposable} - ]); - if (e) throw e; - if (!this._disposing) { - this._disposableObjects[this._disposableObjects.length] = object; - } - } - function Sys$_Application$raiseLoad() { - /// <summary locid="M:J#Sys.Application.raiseLoad" /> - if (arguments.length !== 0) throw Error.parameterCount(); - var h = this.get_events().getHandler("load"); - var args = new Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents), !this._initializing); - if (h) { - h(this, args); - } - if (window.pageLoad) { - window.pageLoad(this, args); - } - this._createdComponents = []; - } - function Sys$_Application$removeComponent(component) { - /// <summary locid="M:J#Sys.Application.removeComponent" /> - /// <param name="component" type="Sys.Component"></param> - var e = Function._validateParams(arguments, [ - {name: "component", type: Sys.Component} - ]); - if (e) throw e; - var id = component.get_id(); - if (id) delete this._components[id]; - } - function Sys$_Application$setServerId(clientId, uniqueId) { - /// <summary locid="M:J#Sys.Application.setServerId" /> - /// <param name="clientId" type="String"></param> - /// <param name="uniqueId" type="String"></param> - var e = Function._validateParams(arguments, [ - {name: "clientId", type: String}, - {name: "uniqueId", type: String} - ]); - if (e) throw e; - this._clientId = clientId; - this._uniqueId = uniqueId; - } - function Sys$_Application$setServerState(value) { - /// <summary locid="M:J#Sys.Application.setServerState" /> - /// <param name="value" type="String"></param> - var e = Function._validateParams(arguments, [ - {name: "value", type: String} - ]); - if (e) throw e; - this._ensureHistory(); - this._state.__s = value; - this._updateHiddenField(value); - } - function Sys$_Application$unregisterDisposableObject(object) { - /// <summary locid="M:J#Sys.Application.unregisterDisposableObject" /> - /// <param name="object" type="Sys.IDisposable"></param> - var e = Function._validateParams(arguments, [ - {name: "object", type: Sys.IDisposable} - ]); - if (e) throw e; - if (!this._disposing) { - Array.remove(this._disposableObjects, object); - } - } - function Sys$_Application$_addComponentToSecondPass(component, references) { - this._secondPassComponents[this._secondPassComponents.length] = {component: component, references: references}; - } - function Sys$_Application$_deserializeState(entry, skipDecodeUri) { - var result = {}; - entry = entry || ''; - var serverSeparator = entry.indexOf('&&'); - if ((serverSeparator !== -1) && (serverSeparator + 2 < entry.length)) { - result.__s = entry.substr(serverSeparator + 2); - entry = entry.substr(0, serverSeparator); - } - var tokens = entry.split('&'); - for (var i = 0, l = tokens.length; i < l; i++) { - var token = tokens[i]; - var equal = token.indexOf('='); - if ((equal !== -1) && (equal + 1 < token.length)) { - var name = token.substr(0, equal); - var value = token.substr(equal + 1); - result[name] = skipDecodeUri ? value : decodeURIComponent(value); - } - } - return result; - } - function Sys$_Application$_doInitialize() { - Sys._Application.callBaseMethod(this, 'initialize'); - - var handler = this.get_events().getHandler("init"); - if (handler) { - this.beginCreateComponents(); - handler(this, Sys.EventArgs.Empty); - this.endCreateComponents(); - } - if (Sys.WebForms) { - this._beginRequestHandler = Function.createDelegate(this, this._onPageRequestManagerBeginRequest); - Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._beginRequestHandler); - this._endRequestHandler = Function.createDelegate(this, this._onPageRequestManagerEndRequest); - Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler); - } - - var loadedEntry = this.get_stateString(); - if (loadedEntry !== this._currentEntry) { - this._navigate(loadedEntry); - } - - this.raiseLoad(); - this._initializing = false; - } - function Sys$_Application$_enableHistoryInScriptManager() { - this._enableHistory = true; - this._historyEnabledInScriptManager = true; - } - function Sys$_Application$_ensureHistory() { - if (!this._historyInitialized && this._enableHistory) { - if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.documentMode < 8)) { - this._historyFrame = document.getElementById('__historyFrame'); - if (!this._historyFrame) throw Error.invalidOperation(Sys.Res.historyMissingFrame); - this._ignoreIFrame = true; - } - if (this._isSafari2()) { - var historyElement = document.getElementById('__history'); - if (!historyElement) throw Error.invalidOperation(Sys.Res.historyMissingHiddenInput); - this._setHistory([window.location.hash]); - this._historyInitialLength = window.history.length; - } - - this._timerHandler = Function.createDelegate(this, this._onIdle); - this._timerCookie = window.setTimeout(this._timerHandler, 100); - - try { - this._initialState = this._deserializeState(this.get_stateString()); - } catch(e) {} - - this._historyInitialized = true; - } - } - function Sys$_Application$_getHistory() { - var historyElement = document.getElementById('__history'); - if (!historyElement) return ''; - var v = historyElement.value; - return v ? Sys.Serialization.JavaScriptSerializer.deserialize(v, true) : ''; - } - function Sys$_Application$_isSafari2() { - return (Sys.Browser.agent === Sys.Browser.Safari) && - (Sys.Browser.version <= 419.3); - } - function Sys$_Application$_loadHandler() { - if(this._loadHandlerDelegate) { - Sys.UI.DomEvent.removeHandler(window, "load", this._loadHandlerDelegate); - this._loadHandlerDelegate = null; - } - this.initialize(); - } - function Sys$_Application$_navigate(entry) { - this._ensureHistory(); - var state = this._deserializeState(entry); - - if (this._uniqueId) { - var oldServerEntry = this._state.__s || ''; - var newServerEntry = state.__s || ''; - if (newServerEntry !== oldServerEntry) { - this._updateHiddenField(newServerEntry); - __doPostBack(this._uniqueId, newServerEntry); - this._state = state; - return; - } - } - this._setState(entry); - this._state = state; - this._raiseNavigate(); - } - function Sys$_Application$_onIdle() { - delete this._timerCookie; - - var entry = this.get_stateString(); - if (entry !== this._currentEntry) { - if (!this._ignoreTimer) { - this._historyPointIsNew = false; - this._navigate(entry); - this._historyLength = window.history.length; - } - } - else { - this._ignoreTimer = false; - } - this._timerCookie = window.setTimeout(this._timerHandler, 100); - } - function Sys$_Application$_onIFrameLoad(entry) { - this._ensureHistory(); - if (!this._ignoreIFrame) { - this._historyPointIsNew = false; - this._navigate(entry); - } - this._ignoreIFrame = false; - } - function Sys$_Application$_onPageRequestManagerBeginRequest(sender, args) { - this._ignoreTimer = true; - } - function Sys$_Application$_onPageRequestManagerEndRequest(sender, args) { - var dataItem = args.get_dataItems()[this._clientId]; - var eventTarget = document.getElementById("__EVENTTARGET"); - if (eventTarget && eventTarget.value === this._uniqueId) { - eventTarget.value = ''; - } - if (typeof(dataItem) !== 'undefined') { - this.setServerState(dataItem); - this._historyPointIsNew = true; - } - else { - this._ignoreTimer = false; - } - var entry = this._serializeState(this._state); - if (entry !== this._currentEntry) { - this._ignoreTimer = true; - this._setState(entry); - this._raiseNavigate(); - } - } - function Sys$_Application$_raiseNavigate() { - var h = this.get_events().getHandler("navigate"); - var stateClone = {}; - for (var key in this._state) { - if (key !== '__s') { - stateClone[key] = this._state[key]; - } - } - var args = new Sys.HistoryEventArgs(stateClone); - if (h) { - h(this, args); - } - } - function Sys$_Application$_serializeState(state) { - var serialized = []; - for (var key in state) { - var value = state[key]; - if (key === '__s') { - var serverState = value; - } - else { - if (key.indexOf('=') !== -1) throw Error.argument('state', Sys.Res.stateFieldNameInvalid); - serialized[serialized.length] = key + '=' + encodeURIComponent(value); - } - } - return serialized.join('&') + (serverState ? '&&' + serverState : ''); - } - function Sys$_Application$_setHistory(historyArray) { - var historyElement = document.getElementById('__history'); - if (historyElement) { - historyElement.value = Sys.Serialization.JavaScriptSerializer.serialize(historyArray); - } - } - function Sys$_Application$_setState(entry, title) { - entry = entry || ''; - if (entry !== this._currentEntry) { - if (window.theForm) { - var action = window.theForm.action; - var hashIndex = action.indexOf('#'); - window.theForm.action = ((hashIndex !== -1) ? action.substring(0, hashIndex) : action) + '#' + entry; - } - - if (this._historyFrame && this._historyPointIsNew) { - this._ignoreIFrame = true; - this._historyPointIsNew = false; - var frameDoc = this._historyFrame.contentWindow.document; - frameDoc.open("javascript:'<html></html>'"); - frameDoc.write("<html><head><title>" + (title || document.title) + - "</title><scri" + "pt type=\"text/javascript\">parent.Sys.Application._onIFrameLoad('" + - entry + "');</scri" + "pt></head><body></body></html>"); - frameDoc.close(); - } - this._ignoreTimer = false; - var currentHash = this.get_stateString(); - this._currentEntry = entry; - if (entry !== currentHash) { - var loc = document.location; - if (loc.href.length - loc.hash.length + entry.length > 1024) { - throw Error.invalidOperation(Sys.Res.urlMustBeLessThan1024chars); - } - if (this._isSafari2()) { - var history = this._getHistory(); - history[window.history.length - this._historyInitialLength + 1] = entry; - this._setHistory(history); - this._historyLength = window.history.length + 1; - var form = document.createElement('form'); - form.method = 'get'; - form.action = '#' + entry; - document.appendChild(form); - form.submit(); - document.removeChild(form); - } - else { - window.location.hash = entry; - } - if ((typeof(title) !== 'undefined') && (title !== null)) { - document.title = title; - } - } - } - } - function Sys$_Application$_unloadHandler(event) { - this.dispose(); - } - function Sys$_Application$_updateHiddenField(value) { - if (this._clientId) { - var serverStateField = document.getElementById(this._clientId); - if (serverStateField) { - serverStateField.value = value; - } - } - } -Sys._Application.prototype = { - _creatingComponents: false, - _disposing: false, - get_isCreatingComponents: Sys$_Application$get_isCreatingComponents, - get_stateString: Sys$_Application$get_stateString, - get_enableHistory: Sys$_Application$get_enableHistory, - set_enableHistory: Sys$_Application$set_enableHistory, - add_init: Sys$_Application$add_init, - remove_init: Sys$_Application$remove_init, - add_load: Sys$_Application$add_load, - remove_load: Sys$_Application$remove_load, - add_navigate: Sys$_Application$add_navigate, - remove_navigate: Sys$_Application$remove_navigate, - add_unload: Sys$_Application$add_unload, - remove_unload: Sys$_Application$remove_unload, - addComponent: Sys$_Application$addComponent, - addHistoryPoint: Sys$_Application$addHistoryPoint, - beginCreateComponents: Sys$_Application$beginCreateComponents, - dispose: Sys$_Application$dispose, - endCreateComponents: Sys$_Application$endCreateComponents, - findComponent: Sys$_Application$findComponent, - getComponents: Sys$_Application$getComponents, - initialize: Sys$_Application$initialize, - notifyScriptLoaded: Sys$_Application$notifyScriptLoaded, - registerDisposableObject: Sys$_Application$registerDisposableObject, - raiseLoad: Sys$_Application$raiseLoad, - removeComponent: Sys$_Application$removeComponent, - setServerId: Sys$_Application$setServerId, - setServerState: Sys$_Application$setServerState, - unregisterDisposableObject: Sys$_Application$unregisterDisposableObject, - _addComponentToSecondPass: Sys$_Application$_addComponentToSecondPass, - _deserializeState: Sys$_Application$_deserializeState, - _doInitialize: Sys$_Application$_doInitialize, - _enableHistoryInScriptManager: Sys$_Application$_enableHistoryInScriptManager, - _ensureHistory: Sys$_Application$_ensureHistory, - _getHistory: Sys$_Application$_getHistory, - _isSafari2: Sys$_Application$_isSafari2, - _loadHandler: Sys$_Application$_loadHandler, - _navigate: Sys$_Application$_navigate, - _onIdle: Sys$_Application$_onIdle, - _onIFrameLoad: Sys$_Application$_onIFrameLoad, - _onPageRequestManagerBeginRequest: Sys$_Application$_onPageRequestManagerBeginRequest, - _onPageRequestManagerEndRequest: Sys$_Application$_onPageRequestManagerEndRequest, - _raiseNavigate: Sys$_Application$_raiseNavigate, - _serializeState: Sys$_Application$_serializeState, - _setHistory: Sys$_Application$_setHistory, - _setState: Sys$_Application$_setState, - _unloadHandler: Sys$_Application$_unloadHandler, - _updateHiddenField: Sys$_Application$_updateHiddenField -} -Sys._Application.registerClass('Sys._Application', Sys.Component, Sys.IContainer); -Sys.Application = new Sys._Application(); -var $find = Sys.Application.findComponent; -Type.registerNamespace('Sys.Net'); - -Sys.Net.WebRequestExecutor = function Sys$Net$WebRequestExecutor() { - /// <summary locid="M:J#Sys.Net.WebRequestExecutor.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); - this._webRequest = null; - this._resultObject = null; -} - function Sys$Net$WebRequestExecutor$get_webRequest() { - /// <value type="Sys.Net.WebRequest" locid="P:J#Sys.Net.WebRequestExecutor.webRequest"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._webRequest; - } - function Sys$Net$WebRequestExecutor$_set_webRequest(value) { - if (this.get_started()) { - throw Error.invalidOperation(String.format(Sys.Res.cannotCallOnceStarted, 'set_webRequest')); - } - this._webRequest = value; - } - function Sys$Net$WebRequestExecutor$get_started() { - /// <value type="Boolean" locid="P:J#Sys.Net.WebRequestExecutor.started"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); - } - function Sys$Net$WebRequestExecutor$get_responseAvailable() { - /// <value type="Boolean" locid="P:J#Sys.Net.WebRequestExecutor.responseAvailable"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); - } - function Sys$Net$WebRequestExecutor$get_timedOut() { - /// <value type="Boolean" locid="P:J#Sys.Net.WebRequestExecutor.timedOut"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); - } - function Sys$Net$WebRequestExecutor$get_aborted() { - /// <value type="Boolean" locid="P:J#Sys.Net.WebRequestExecutor.aborted"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); - } - function Sys$Net$WebRequestExecutor$get_responseData() { - /// <value type="String" locid="P:J#Sys.Net.WebRequestExecutor.responseData"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); - } - function Sys$Net$WebRequestExecutor$get_statusCode() { - /// <value type="Number" locid="P:J#Sys.Net.WebRequestExecutor.statusCode"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); - } - function Sys$Net$WebRequestExecutor$get_statusText() { - /// <value type="String" locid="P:J#Sys.Net.WebRequestExecutor.statusText"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); - } - function Sys$Net$WebRequestExecutor$get_xml() { - /// <value locid="P:J#Sys.Net.WebRequestExecutor.xml"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); - } - function Sys$Net$WebRequestExecutor$get_object() { - /// <value locid="P:J#Sys.Net.WebRequestExecutor.object"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - if (!this._resultObject) { - this._resultObject = Sys.Serialization.JavaScriptSerializer.deserialize(this.get_responseData()); - } - return this._resultObject; - } - function Sys$Net$WebRequestExecutor$executeRequest() { - /// <summary locid="M:J#Sys.Net.WebRequestExecutor.executeRequest" /> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); - } - function Sys$Net$WebRequestExecutor$abort() { - /// <summary locid="M:J#Sys.Net.WebRequestExecutor.abort" /> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); - } - function Sys$Net$WebRequestExecutor$getResponseHeader(header) { - /// <summary locid="M:J#Sys.Net.WebRequestExecutor.getResponseHeader" /> - /// <param name="header" type="String"></param> - var e = Function._validateParams(arguments, [ - {name: "header", type: String} - ]); - if (e) throw e; - throw Error.notImplemented(); - } - function Sys$Net$WebRequestExecutor$getAllResponseHeaders() { - /// <summary locid="M:J#Sys.Net.WebRequestExecutor.getAllResponseHeaders" /> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); - } -Sys.Net.WebRequestExecutor.prototype = { - get_webRequest: Sys$Net$WebRequestExecutor$get_webRequest, - _set_webRequest: Sys$Net$WebRequestExecutor$_set_webRequest, - get_started: Sys$Net$WebRequestExecutor$get_started, - get_responseAvailable: Sys$Net$WebRequestExecutor$get_responseAvailable, - get_timedOut: Sys$Net$WebRequestExecutor$get_timedOut, - get_aborted: Sys$Net$WebRequestExecutor$get_aborted, - get_responseData: Sys$Net$WebRequestExecutor$get_responseData, - get_statusCode: Sys$Net$WebRequestExecutor$get_statusCode, - get_statusText: Sys$Net$WebRequestExecutor$get_statusText, - get_xml: Sys$Net$WebRequestExecutor$get_xml, - get_object: Sys$Net$WebRequestExecutor$get_object, - executeRequest: Sys$Net$WebRequestExecutor$executeRequest, - abort: Sys$Net$WebRequestExecutor$abort, - getResponseHeader: Sys$Net$WebRequestExecutor$getResponseHeader, - getAllResponseHeaders: Sys$Net$WebRequestExecutor$getAllResponseHeaders -} -Sys.Net.WebRequestExecutor.registerClass('Sys.Net.WebRequestExecutor'); - -Sys.Net.XMLDOM = function Sys$Net$XMLDOM(markup) { - /// <summary locid="M:J#Sys.Net.XMLDOM.#ctor" /> - /// <param name="markup" type="String"></param> - var e = Function._validateParams(arguments, [ - {name: "markup", type: String} - ]); - if (e) throw e; - if (!window.DOMParser) { - var progIDs = [ 'Msxml2.DOMDocument.3.0', 'Msxml2.DOMDocument' ]; - for (var i = 0, l = progIDs.length; i < l; i++) { - try { - var xmlDOM = new ActiveXObject(progIDs[i]); - xmlDOM.async = false; - xmlDOM.loadXML(markup); - xmlDOM.setProperty('SelectionLanguage', 'XPath'); - return xmlDOM; - } - catch (ex) { - } - } - } - else { - try { - var domParser = new window.DOMParser(); - return domParser.parseFromString(markup, 'text/xml'); - } - catch (ex) { - } - } - return null; -} -Sys.Net.XMLHttpExecutor = function Sys$Net$XMLHttpExecutor() { - /// <summary locid="M:J#Sys.Net.XMLHttpExecutor.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); - Sys.Net.XMLHttpExecutor.initializeBase(this); - var _this = this; - this._xmlHttpRequest = null; - this._webRequest = null; - this._responseAvailable = false; - this._timedOut = false; - this._timer = null; - this._aborted = false; - this._started = false; - this._onReadyStateChange = (function () { - - if (_this._xmlHttpRequest.readyState === 4 ) { - try { - if (typeof(_this._xmlHttpRequest.status) === "undefined") { - return; - } - } - catch(ex) { - return; - } - - _this._clearTimer(); - _this._responseAvailable = true; - try { - _this._webRequest.completed(Sys.EventArgs.Empty); - } - finally { - if (_this._xmlHttpRequest != null) { - _this._xmlHttpRequest.onreadystatechange = Function.emptyMethod; - _this._xmlHttpRequest = null; - } - } - } - }); - this._clearTimer = (function() { - if (_this._timer != null) { - window.clearTimeout(_this._timer); - _this._timer = null; - } - }); - this._onTimeout = (function() { - if (!_this._responseAvailable) { - _this._clearTimer(); - _this._timedOut = true; - _this._xmlHttpRequest.onreadystatechange = Function.emptyMethod; - _this._xmlHttpRequest.abort(); - _this._webRequest.completed(Sys.EventArgs.Empty); - _this._xmlHttpRequest = null; - } - }); -} - function Sys$Net$XMLHttpExecutor$get_timedOut() { - /// <value type="Boolean" locid="P:J#Sys.Net.XMLHttpExecutor.timedOut"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._timedOut; - } - function Sys$Net$XMLHttpExecutor$get_started() { - /// <value type="Boolean" locid="P:J#Sys.Net.XMLHttpExecutor.started"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._started; - } - function Sys$Net$XMLHttpExecutor$get_responseAvailable() { - /// <value type="Boolean" locid="P:J#Sys.Net.XMLHttpExecutor.responseAvailable"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._responseAvailable; - } - function Sys$Net$XMLHttpExecutor$get_aborted() { - /// <value type="Boolean" locid="P:J#Sys.Net.XMLHttpExecutor.aborted"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._aborted; - } - function Sys$Net$XMLHttpExecutor$executeRequest() { - /// <summary locid="M:J#Sys.Net.XMLHttpExecutor.executeRequest" /> - if (arguments.length !== 0) throw Error.parameterCount(); - this._webRequest = this.get_webRequest(); - if (this._started) { - throw Error.invalidOperation(String.format(Sys.Res.cannotCallOnceStarted, 'executeRequest')); - } - if (this._webRequest === null) { - throw Error.invalidOperation(Sys.Res.nullWebRequest); - } - var body = this._webRequest.get_body(); - var headers = this._webRequest.get_headers(); - this._xmlHttpRequest = new XMLHttpRequest(); - this._xmlHttpRequest.onreadystatechange = this._onReadyStateChange; - var verb = this._webRequest.get_httpVerb(); - this._xmlHttpRequest.open(verb, this._webRequest.getResolvedUrl(), true ); - if (headers) { - for (var header in headers) { - var val = headers[header]; - if (typeof(val) !== "function") - this._xmlHttpRequest.setRequestHeader(header, val); - } - } - if (verb.toLowerCase() === "post") { - if ((headers === null) || !headers['Content-Type']) { - this._xmlHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8'); - } - if (!body) { - body = ""; - } - } - var timeout = this._webRequest.get_timeout(); - if (timeout > 0) { - this._timer = window.setTimeout(Function.createDelegate(this, this._onTimeout), timeout); - } - this._xmlHttpRequest.send(body); - this._started = true; - } - function Sys$Net$XMLHttpExecutor$getResponseHeader(header) { - /// <summary locid="M:J#Sys.Net.XMLHttpExecutor.getResponseHeader" /> - /// <param name="header" type="String"></param> - /// <returns type="String"></returns> - var e = Function._validateParams(arguments, [ - {name: "header", type: String} - ]); - if (e) throw e; - if (!this._responseAvailable) { - throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'getResponseHeader')); - } - if (!this._xmlHttpRequest) { - throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'getResponseHeader')); - } - var result; - try { - result = this._xmlHttpRequest.getResponseHeader(header); - } catch (e) { - } - if (!result) result = ""; - return result; - } - function Sys$Net$XMLHttpExecutor$getAllResponseHeaders() { - /// <summary locid="M:J#Sys.Net.XMLHttpExecutor.getAllResponseHeaders" /> - /// <returns type="String"></returns> - if (arguments.length !== 0) throw Error.parameterCount(); - if (!this._responseAvailable) { - throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'getAllResponseHeaders')); - } - if (!this._xmlHttpRequest) { - throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'getAllResponseHeaders')); - } - return this._xmlHttpRequest.getAllResponseHeaders(); - } - function Sys$Net$XMLHttpExecutor$get_responseData() { - /// <value type="String" locid="P:J#Sys.Net.XMLHttpExecutor.responseData"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - if (!this._responseAvailable) { - throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_responseData')); - } - if (!this._xmlHttpRequest) { - throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_responseData')); - } - return this._xmlHttpRequest.responseText; - } - function Sys$Net$XMLHttpExecutor$get_statusCode() { - /// <value type="Number" locid="P:J#Sys.Net.XMLHttpExecutor.statusCode"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - if (!this._responseAvailable) { - throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_statusCode')); - } - if (!this._xmlHttpRequest) { - throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_statusCode')); - } - var result = 0; - try { - result = this._xmlHttpRequest.status; - } - catch(ex) { - } - return result; - } - function Sys$Net$XMLHttpExecutor$get_statusText() { - /// <value type="String" locid="P:J#Sys.Net.XMLHttpExecutor.statusText"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - if (!this._responseAvailable) { - throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_statusText')); - } - if (!this._xmlHttpRequest) { - throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_statusText')); - } - return this._xmlHttpRequest.statusText; - } - function Sys$Net$XMLHttpExecutor$get_xml() { - /// <value locid="P:J#Sys.Net.XMLHttpExecutor.xml"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - if (!this._responseAvailable) { - throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_xml')); - } - if (!this._xmlHttpRequest) { - throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_xml')); - } - var xml = this._xmlHttpRequest.responseXML; - if (!xml || !xml.documentElement) { - xml = Sys.Net.XMLDOM(this._xmlHttpRequest.responseText); - if (!xml || !xml.documentElement) - return null; - } - else if (navigator.userAgent.indexOf('MSIE') !== -1) { - xml.setProperty('SelectionLanguage', 'XPath'); - } - if (xml.documentElement.namespaceURI === "http://www.mozilla.org/newlayout/xml/parsererror.xml" && - xml.documentElement.tagName === "parsererror") { - return null; - } - - if (xml.documentElement.firstChild && xml.documentElement.firstChild.tagName === "parsererror") { - return null; - } - - return xml; - } - function Sys$Net$XMLHttpExecutor$abort() { - /// <summary locid="M:J#Sys.Net.XMLHttpExecutor.abort" /> - if (arguments.length !== 0) throw Error.parameterCount(); - if (!this._started) { - throw Error.invalidOperation(Sys.Res.cannotAbortBeforeStart); - } - if (this._aborted || this._responseAvailable || this._timedOut) - return; - this._aborted = true; - this._clearTimer(); - if (this._xmlHttpRequest && !this._responseAvailable) { - this._xmlHttpRequest.onreadystatechange = Function.emptyMethod; - this._xmlHttpRequest.abort(); - - this._xmlHttpRequest = null; - this._webRequest.completed(Sys.EventArgs.Empty); - } - } -Sys.Net.XMLHttpExecutor.prototype = { - get_timedOut: Sys$Net$XMLHttpExecutor$get_timedOut, - get_started: Sys$Net$XMLHttpExecutor$get_started, - get_responseAvailable: Sys$Net$XMLHttpExecutor$get_responseAvailable, - get_aborted: Sys$Net$XMLHttpExecutor$get_aborted, - executeRequest: Sys$Net$XMLHttpExecutor$executeRequest, - getResponseHeader: Sys$Net$XMLHttpExecutor$getResponseHeader, - getAllResponseHeaders: Sys$Net$XMLHttpExecutor$getAllResponseHeaders, - get_responseData: Sys$Net$XMLHttpExecutor$get_responseData, - get_statusCode: Sys$Net$XMLHttpExecutor$get_statusCode, - get_statusText: Sys$Net$XMLHttpExecutor$get_statusText, - get_xml: Sys$Net$XMLHttpExecutor$get_xml, - abort: Sys$Net$XMLHttpExecutor$abort -} -Sys.Net.XMLHttpExecutor.registerClass('Sys.Net.XMLHttpExecutor', Sys.Net.WebRequestExecutor); - -Sys.Net._WebRequestManager = function Sys$Net$_WebRequestManager() { - /// <summary locid="P:J#Sys.Net.WebRequestManager.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); - this._defaultTimeout = 0; - this._defaultExecutorType = "Sys.Net.XMLHttpExecutor"; -} - function Sys$Net$_WebRequestManager$add_invokingRequest(handler) { - /// <summary locid="E:J#Sys.Net.WebRequestManager.invokingRequest" /> - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this._get_eventHandlerList().addHandler("invokingRequest", handler); - } - function Sys$Net$_WebRequestManager$remove_invokingRequest(handler) { - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this._get_eventHandlerList().removeHandler("invokingRequest", handler); - } - function Sys$Net$_WebRequestManager$add_completedRequest(handler) { - /// <summary locid="E:J#Sys.Net.WebRequestManager.completedRequest" /> - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this._get_eventHandlerList().addHandler("completedRequest", handler); - } - function Sys$Net$_WebRequestManager$remove_completedRequest(handler) { - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this._get_eventHandlerList().removeHandler("completedRequest", handler); - } - function Sys$Net$_WebRequestManager$_get_eventHandlerList() { - if (!this._events) { - this._events = new Sys.EventHandlerList(); - } - return this._events; - } - function Sys$Net$_WebRequestManager$get_defaultTimeout() { - /// <value type="Number" locid="P:J#Sys.Net.WebRequestManager.defaultTimeout"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._defaultTimeout; - } - function Sys$Net$_WebRequestManager$set_defaultTimeout(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Number}]); - if (e) throw e; - if (value < 0) { - throw Error.argumentOutOfRange("value", value, Sys.Res.invalidTimeout); - } - this._defaultTimeout = value; - } - function Sys$Net$_WebRequestManager$get_defaultExecutorType() { - /// <value type="String" locid="P:J#Sys.Net.WebRequestManager.defaultExecutorType"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._defaultExecutorType; - } - function Sys$Net$_WebRequestManager$set_defaultExecutorType(value) { - var e = Function._validateParams(arguments, [{name: "value", type: String}]); - if (e) throw e; - this._defaultExecutorType = value; - } - function Sys$Net$_WebRequestManager$executeRequest(webRequest) { - /// <summary locid="M:J#Sys.Net.WebRequestManager.executeRequest" /> - /// <param name="webRequest" type="Sys.Net.WebRequest"></param> - var e = Function._validateParams(arguments, [ - {name: "webRequest", type: Sys.Net.WebRequest} - ]); - if (e) throw e; - var executor = webRequest.get_executor(); - if (!executor) { - var failed = false; - try { - var executorType = eval(this._defaultExecutorType); - executor = new executorType(); - } catch (e) { - failed = true; - } - if (failed || !Sys.Net.WebRequestExecutor.isInstanceOfType(executor) || !executor) { - throw Error.argument("defaultExecutorType", String.format(Sys.Res.invalidExecutorType, this._defaultExecutorType)); - } - webRequest.set_executor(executor); - } - if (executor.get_aborted()) { - return; - } - var evArgs = new Sys.Net.NetworkRequestEventArgs(webRequest); - var handler = this._get_eventHandlerList().getHandler("invokingRequest"); - if (handler) { - handler(this, evArgs); - } - if (!evArgs.get_cancel()) { - executor.executeRequest(); - } - } -Sys.Net._WebRequestManager.prototype = { - add_invokingRequest: Sys$Net$_WebRequestManager$add_invokingRequest, - remove_invokingRequest: Sys$Net$_WebRequestManager$remove_invokingRequest, - add_completedRequest: Sys$Net$_WebRequestManager$add_completedRequest, - remove_completedRequest: Sys$Net$_WebRequestManager$remove_completedRequest, - _get_eventHandlerList: Sys$Net$_WebRequestManager$_get_eventHandlerList, - get_defaultTimeout: Sys$Net$_WebRequestManager$get_defaultTimeout, - set_defaultTimeout: Sys$Net$_WebRequestManager$set_defaultTimeout, - get_defaultExecutorType: Sys$Net$_WebRequestManager$get_defaultExecutorType, - set_defaultExecutorType: Sys$Net$_WebRequestManager$set_defaultExecutorType, - executeRequest: Sys$Net$_WebRequestManager$executeRequest -} -Sys.Net._WebRequestManager.registerClass('Sys.Net._WebRequestManager'); -Sys.Net.WebRequestManager = new Sys.Net._WebRequestManager(); - -Sys.Net.NetworkRequestEventArgs = function Sys$Net$NetworkRequestEventArgs(webRequest) { - /// <summary locid="M:J#Sys.Net.NetworkRequestEventArgs.#ctor" /> - /// <param name="webRequest" type="Sys.Net.WebRequest"></param> - var e = Function._validateParams(arguments, [ - {name: "webRequest", type: Sys.Net.WebRequest} - ]); - if (e) throw e; - Sys.Net.NetworkRequestEventArgs.initializeBase(this); - this._webRequest = webRequest; -} - function Sys$Net$NetworkRequestEventArgs$get_webRequest() { - /// <value type="Sys.Net.WebRequest" locid="P:J#Sys.Net.NetworkRequestEventArgs.webRequest"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._webRequest; - } -Sys.Net.NetworkRequestEventArgs.prototype = { - get_webRequest: Sys$Net$NetworkRequestEventArgs$get_webRequest -} -Sys.Net.NetworkRequestEventArgs.registerClass('Sys.Net.NetworkRequestEventArgs', Sys.CancelEventArgs); - -Sys.Net.WebRequest = function Sys$Net$WebRequest() { - /// <summary locid="M:J#Sys.Net.WebRequest.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); - this._url = ""; - this._headers = { }; - this._body = null; - this._userContext = null; - this._httpVerb = null; - this._executor = null; - this._invokeCalled = false; - this._timeout = 0; -} - function Sys$Net$WebRequest$add_completed(handler) { - /// <summary locid="E:J#Sys.Net.WebRequest.completed" /> - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this._get_eventHandlerList().addHandler("completed", handler); - } - function Sys$Net$WebRequest$remove_completed(handler) { - var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); - if (e) throw e; - this._get_eventHandlerList().removeHandler("completed", handler); - } - function Sys$Net$WebRequest$completed(eventArgs) { - /// <summary locid="M:J#Sys.Net.WebRequest.completed" /> - /// <param name="eventArgs" type="Sys.EventArgs"></param> - var e = Function._validateParams(arguments, [ - {name: "eventArgs", type: Sys.EventArgs} - ]); - if (e) throw e; - var handler = Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest"); - if (handler) { - handler(this._executor, eventArgs); - } - handler = this._get_eventHandlerList().getHandler("completed"); - if (handler) { - handler(this._executor, eventArgs); - } - } - function Sys$Net$WebRequest$_get_eventHandlerList() { - if (!this._events) { - this._events = new Sys.EventHandlerList(); - } - return this._events; - } - function Sys$Net$WebRequest$get_url() { - /// <value type="String" locid="P:J#Sys.Net.WebRequest.url"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._url; - } - function Sys$Net$WebRequest$set_url(value) { - var e = Function._validateParams(arguments, [{name: "value", type: String}]); - if (e) throw e; - this._url = value; - } - function Sys$Net$WebRequest$get_headers() { - /// <value locid="P:J#Sys.Net.WebRequest.headers"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._headers; - } - function Sys$Net$WebRequest$get_httpVerb() { - /// <value type="String" locid="P:J#Sys.Net.WebRequest.httpVerb"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - if (this._httpVerb === null) { - if (this._body === null) { - return "GET"; - } - return "POST"; - } - return this._httpVerb; - } - function Sys$Net$WebRequest$set_httpVerb(value) { - var e = Function._validateParams(arguments, [{name: "value", type: String}]); - if (e) throw e; - if (value.length === 0) { - throw Error.argument('value', Sys.Res.invalidHttpVerb); - } - this._httpVerb = value; - } - function Sys$Net$WebRequest$get_body() { - /// <value mayBeNull="true" locid="P:J#Sys.Net.WebRequest.body"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._body; - } - function Sys$Net$WebRequest$set_body(value) { - var e = Function._validateParams(arguments, [{name: "value", mayBeNull: true}]); - if (e) throw e; - this._body = value; - } - function Sys$Net$WebRequest$get_userContext() { - /// <value mayBeNull="true" locid="P:J#Sys.Net.WebRequest.userContext"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._userContext; - } - function Sys$Net$WebRequest$set_userContext(value) { - var e = Function._validateParams(arguments, [{name: "value", mayBeNull: true}]); - if (e) throw e; - this._userContext = value; - } - function Sys$Net$WebRequest$get_executor() { - /// <value type="Sys.Net.WebRequestExecutor" locid="P:J#Sys.Net.WebRequest.executor"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._executor; - } - function Sys$Net$WebRequest$set_executor(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Sys.Net.WebRequestExecutor}]); - if (e) throw e; - if (this._executor !== null && this._executor.get_started()) { - throw Error.invalidOperation(Sys.Res.setExecutorAfterActive); - } - this._executor = value; - this._executor._set_webRequest(this); - } - function Sys$Net$WebRequest$get_timeout() { - /// <value type="Number" locid="P:J#Sys.Net.WebRequest.timeout"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - if (this._timeout === 0) { - return Sys.Net.WebRequestManager.get_defaultTimeout(); - } - return this._timeout; - } - function Sys$Net$WebRequest$set_timeout(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Number}]); - if (e) throw e; - if (value < 0) { - throw Error.argumentOutOfRange("value", value, Sys.Res.invalidTimeout); - } - this._timeout = value; - } - function Sys$Net$WebRequest$getResolvedUrl() { - /// <summary locid="M:J#Sys.Net.WebRequest.getResolvedUrl" /> - /// <returns type="String"></returns> - if (arguments.length !== 0) throw Error.parameterCount(); - return Sys.Net.WebRequest._resolveUrl(this._url); - } - function Sys$Net$WebRequest$invoke() { - /// <summary locid="M:J#Sys.Net.WebRequest.invoke" /> - if (arguments.length !== 0) throw Error.parameterCount(); - if (this._invokeCalled) { - throw Error.invalidOperation(Sys.Res.invokeCalledTwice); - } - Sys.Net.WebRequestManager.executeRequest(this); - this._invokeCalled = true; - } -Sys.Net.WebRequest.prototype = { - add_completed: Sys$Net$WebRequest$add_completed, - remove_completed: Sys$Net$WebRequest$remove_completed, - completed: Sys$Net$WebRequest$completed, - _get_eventHandlerList: Sys$Net$WebRequest$_get_eventHandlerList, - get_url: Sys$Net$WebRequest$get_url, - set_url: Sys$Net$WebRequest$set_url, - get_headers: Sys$Net$WebRequest$get_headers, - get_httpVerb: Sys$Net$WebRequest$get_httpVerb, - set_httpVerb: Sys$Net$WebRequest$set_httpVerb, - get_body: Sys$Net$WebRequest$get_body, - set_body: Sys$Net$WebRequest$set_body, - get_userContext: Sys$Net$WebRequest$get_userContext, - set_userContext: Sys$Net$WebRequest$set_userContext, - get_executor: Sys$Net$WebRequest$get_executor, - set_executor: Sys$Net$WebRequest$set_executor, - get_timeout: Sys$Net$WebRequest$get_timeout, - set_timeout: Sys$Net$WebRequest$set_timeout, - getResolvedUrl: Sys$Net$WebRequest$getResolvedUrl, - invoke: Sys$Net$WebRequest$invoke -} -Sys.Net.WebRequest._resolveUrl = function Sys$Net$WebRequest$_resolveUrl(url, baseUrl) { - if (url && url.indexOf('://') !== -1) { - return url; - } - if (!baseUrl || baseUrl.length === 0) { - var baseElement = document.getElementsByTagName('base')[0]; - if (baseElement && baseElement.href && baseElement.href.length > 0) { - baseUrl = baseElement.href; - } - else { - baseUrl = document.URL; - } - } - var qsStart = baseUrl.indexOf('?'); - if (qsStart !== -1) { - baseUrl = baseUrl.substr(0, qsStart); - } - qsStart = baseUrl.indexOf('#'); - if (qsStart !== -1) { - baseUrl = baseUrl.substr(0, qsStart); - } - baseUrl = baseUrl.substr(0, baseUrl.lastIndexOf('/') + 1); - if (!url || url.length === 0) { - return baseUrl; - } - if (url.charAt(0) === '/') { - var slashslash = baseUrl.indexOf('://'); - if (slashslash === -1) { - throw Error.argument("baseUrl", Sys.Res.badBaseUrl1); - } - var nextSlash = baseUrl.indexOf('/', slashslash + 3); - if (nextSlash === -1) { - throw Error.argument("baseUrl", Sys.Res.badBaseUrl2); - } - return baseUrl.substr(0, nextSlash) + url; - } - else { - var lastSlash = baseUrl.lastIndexOf('/'); - if (lastSlash === -1) { - throw Error.argument("baseUrl", Sys.Res.badBaseUrl3); - } - return baseUrl.substr(0, lastSlash+1) + url; - } -} -Sys.Net.WebRequest._createQueryString = function Sys$Net$WebRequest$_createQueryString(queryString, encodeMethod) { - if (!encodeMethod) - encodeMethod = encodeURIComponent; - var sb = new Sys.StringBuilder(); - var i = 0; - for (var arg in queryString) { - var obj = queryString[arg]; - if (typeof(obj) === "function") continue; - var val = Sys.Serialization.JavaScriptSerializer.serialize(obj); - if (i !== 0) { - sb.append('&'); - } - sb.append(arg); - sb.append('='); - sb.append(encodeMethod(val)); - i++; - } - return sb.toString(); -} -Sys.Net.WebRequest._createUrl = function Sys$Net$WebRequest$_createUrl(url, queryString) { - if (!queryString) { - return url; - } - var qs = Sys.Net.WebRequest._createQueryString(queryString); - if (qs.length > 0) { - var sep = '?'; - if (url && url.indexOf('?') !== -1) - sep = '&'; - return url + sep + qs; - } else { - return url; - } -} -Sys.Net.WebRequest.registerClass('Sys.Net.WebRequest'); - -Sys.Net.WebServiceProxy = function Sys$Net$WebServiceProxy() { -} - function Sys$Net$WebServiceProxy$get_timeout() { - /// <value type="Number" locid="P:J#Sys.Net.WebServiceProxy.timeout"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._timeout; - } - function Sys$Net$WebServiceProxy$set_timeout(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Number}]); - if (e) throw e; - if (value < 0) { throw Error.argumentOutOfRange('value', value, Sys.Res.invalidTimeout); } - this._timeout = value; - } - function Sys$Net$WebServiceProxy$get_defaultUserContext() { - /// <value mayBeNull="true" locid="P:J#Sys.Net.WebServiceProxy.defaultUserContext"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._userContext; - } - function Sys$Net$WebServiceProxy$set_defaultUserContext(value) { - var e = Function._validateParams(arguments, [{name: "value", mayBeNull: true}]); - if (e) throw e; - this._userContext = value; - } - function Sys$Net$WebServiceProxy$get_defaultSucceededCallback() { - /// <value type="Function" mayBeNull="true" locid="P:J#Sys.Net.WebServiceProxy.defaultSucceededCallback"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._succeeded; - } - function Sys$Net$WebServiceProxy$set_defaultSucceededCallback(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Function, mayBeNull: true}]); - if (e) throw e; - this._succeeded = value; - } - function Sys$Net$WebServiceProxy$get_defaultFailedCallback() { - /// <value type="Function" mayBeNull="true" locid="P:J#Sys.Net.WebServiceProxy.defaultFailedCallback"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._failed; - } - function Sys$Net$WebServiceProxy$set_defaultFailedCallback(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Function, mayBeNull: true}]); - if (e) throw e; - this._failed = value; - } - function Sys$Net$WebServiceProxy$get_path() { - /// <value type="String" locid="P:J#Sys.Net.WebServiceProxy.path"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._path; - } - function Sys$Net$WebServiceProxy$set_path(value) { - var e = Function._validateParams(arguments, [{name: "value", type: String}]); - if (e) throw e; - this._path = value; - } - function Sys$Net$WebServiceProxy$_invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext) { - /// <summary locid="M:J#Sys.Net.WebServiceProxy._invoke" /> - /// <param name="servicePath" type="String"></param> - /// <param name="methodName" type="String"></param> - /// <param name="useGet" type="Boolean"></param> - /// <param name="params"></param> - /// <param name="onSuccess" type="Function" mayBeNull="true" optional="true"></param> - /// <param name="onFailure" type="Function" mayBeNull="true" optional="true"></param> - /// <param name="userContext" mayBeNull="true" optional="true"></param> - /// <returns type="Sys.Net.WebRequest"></returns> - var e = Function._validateParams(arguments, [ - {name: "servicePath", type: String}, - {name: "methodName", type: String}, - {name: "useGet", type: Boolean}, - {name: "params"}, - {name: "onSuccess", type: Function, mayBeNull: true, optional: true}, - {name: "onFailure", type: Function, mayBeNull: true, optional: true}, - {name: "userContext", mayBeNull: true, optional: true} - ]); - if (e) throw e; - if (onSuccess === null || typeof onSuccess === 'undefined') onSuccess = this.get_defaultSucceededCallback(); - if (onFailure === null || typeof onFailure === 'undefined') onFailure = this.get_defaultFailedCallback(); - if (userContext === null || typeof userContext === 'undefined') userContext = this.get_defaultUserContext(); - - return Sys.Net.WebServiceProxy.invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext, this.get_timeout()); - } -Sys.Net.WebServiceProxy.prototype = { - get_timeout: Sys$Net$WebServiceProxy$get_timeout, - set_timeout: Sys$Net$WebServiceProxy$set_timeout, - get_defaultUserContext: Sys$Net$WebServiceProxy$get_defaultUserContext, - set_defaultUserContext: Sys$Net$WebServiceProxy$set_defaultUserContext, - get_defaultSucceededCallback: Sys$Net$WebServiceProxy$get_defaultSucceededCallback, - set_defaultSucceededCallback: Sys$Net$WebServiceProxy$set_defaultSucceededCallback, - get_defaultFailedCallback: Sys$Net$WebServiceProxy$get_defaultFailedCallback, - set_defaultFailedCallback: Sys$Net$WebServiceProxy$set_defaultFailedCallback, - get_path: Sys$Net$WebServiceProxy$get_path, - set_path: Sys$Net$WebServiceProxy$set_path, - _invoke: Sys$Net$WebServiceProxy$_invoke -} -Sys.Net.WebServiceProxy.registerClass('Sys.Net.WebServiceProxy'); -Sys.Net.WebServiceProxy.invoke = function Sys$Net$WebServiceProxy$invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext, timeout) { - /// <summary locid="M:J#Sys.Net.WebServiceProxy.invoke" /> - /// <param name="servicePath" type="String"></param> - /// <param name="methodName" type="String"></param> - /// <param name="useGet" type="Boolean" optional="true"></param> - /// <param name="params" mayBeNull="true" optional="true"></param> - /// <param name="onSuccess" type="Function" mayBeNull="true" optional="true"></param> - /// <param name="onFailure" type="Function" mayBeNull="true" optional="true"></param> - /// <param name="userContext" mayBeNull="true" optional="true"></param> - /// <param name="timeout" type="Number" optional="true"></param> - /// <returns type="Sys.Net.WebRequest"></returns> - var e = Function._validateParams(arguments, [ - {name: "servicePath", type: String}, - {name: "methodName", type: String}, - {name: "useGet", type: Boolean, optional: true}, - {name: "params", mayBeNull: true, optional: true}, - {name: "onSuccess", type: Function, mayBeNull: true, optional: true}, - {name: "onFailure", type: Function, mayBeNull: true, optional: true}, - {name: "userContext", mayBeNull: true, optional: true}, - {name: "timeout", type: Number, optional: true} - ]); - if (e) throw e; - var request = new Sys.Net.WebRequest(); - request.get_headers()['Content-Type'] = 'application/json; charset=utf-8'; - if (!params) params = {}; - var urlParams = params; - if (!useGet || !urlParams) urlParams = {}; - request.set_url(Sys.Net.WebRequest._createUrl(servicePath+"/"+encodeURIComponent(methodName), urlParams)); - var body = null; - if (!useGet) { - body = Sys.Serialization.JavaScriptSerializer.serialize(params); - if (body === "{}") body = ""; - } - request.set_body(body); - request.add_completed(onComplete); - if (timeout && timeout > 0) request.set_timeout(timeout); - request.invoke(); - function onComplete(response, eventArgs) { - if (response.get_responseAvailable()) { - var statusCode = response.get_statusCode(); - var result = null; - - try { - var contentType = response.getResponseHeader("Content-Type"); - if (contentType.startsWith("application/json")) { - result = response.get_object(); - } - else if (contentType.startsWith("text/xml")) { - result = response.get_xml(); - } - else { - result = response.get_responseData(); - } - } catch (ex) { - } - var error = response.getResponseHeader("jsonerror"); - var errorObj = (error === "true"); - if (errorObj) { - if (result) { - result = new Sys.Net.WebServiceError(false, result.Message, result.StackTrace, result.ExceptionType); - } - } - else if (contentType.startsWith("application/json")) { - if (!result || typeof(result.d) === "undefined") { - throw Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.webServiceInvalidJsonWrapper, methodName)); - } - result = result.d; - } - if (((statusCode < 200) || (statusCode >= 300)) || errorObj) { - if (onFailure) { - if (!result || !errorObj) { - result = new Sys.Net.WebServiceError(false , String.format(Sys.Res.webServiceFailedNoMsg, methodName), "", ""); - } - result._statusCode = statusCode; - onFailure(result, userContext, methodName); - } - else { - var error; - if (result && errorObj) { - error = result.get_exceptionType() + "-- " + result.get_message(); - } - else { - error = response.get_responseData(); - } - throw Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.webServiceFailed, methodName, error)); - } - } - else if (onSuccess) { - onSuccess(result, userContext, methodName); - } - } - else { - var msg; - if (response.get_timedOut()) { - msg = String.format(Sys.Res.webServiceTimedOut, methodName); - } - else { - msg = String.format(Sys.Res.webServiceFailedNoMsg, methodName) - } - if (onFailure) { - onFailure(new Sys.Net.WebServiceError(response.get_timedOut(), msg, "", ""), userContext, methodName); - } - else { - throw Sys.Net.WebServiceProxy._createFailedError(methodName, msg); - } - } - } - return request; -} -Sys.Net.WebServiceProxy._createFailedError = function Sys$Net$WebServiceProxy$_createFailedError(methodName, errorMessage) { - var displayMessage = "Sys.Net.WebServiceFailedException: " + errorMessage; - var e = Error.create(displayMessage, { 'name': 'Sys.Net.WebServiceFailedException', 'methodName': methodName }); - e.popStackFrame(); - return e; -} -Sys.Net.WebServiceProxy._defaultFailedCallback = function Sys$Net$WebServiceProxy$_defaultFailedCallback(err, methodName) { - var error = err.get_exceptionType() + "-- " + err.get_message(); - throw Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.webServiceFailed, methodName, error)); -} -Sys.Net.WebServiceProxy._generateTypedConstructor = function Sys$Net$WebServiceProxy$_generateTypedConstructor(type) { - return function(properties) { - if (properties) { - for (var name in properties) { - this[name] = properties[name]; - } - } - this.__type = type; - } -} - -Sys.Net.WebServiceError = function Sys$Net$WebServiceError(timedOut, message, stackTrace, exceptionType) { - /// <summary locid="M:J#Sys.Net.WebServiceError.#ctor" /> - /// <param name="timedOut" type="Boolean"></param> - /// <param name="message" type="String" mayBeNull="true"></param> - /// <param name="stackTrace" type="String" mayBeNull="true"></param> - /// <param name="exceptionType" type="String" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "timedOut", type: Boolean}, - {name: "message", type: String, mayBeNull: true}, - {name: "stackTrace", type: String, mayBeNull: true}, - {name: "exceptionType", type: String, mayBeNull: true} - ]); - if (e) throw e; - this._timedOut = timedOut; - this._message = message; - this._stackTrace = stackTrace; - this._exceptionType = exceptionType; - this._statusCode = -1; -} - function Sys$Net$WebServiceError$get_timedOut() { - /// <value type="Boolean" locid="P:J#Sys.Net.WebServiceError.timedOut"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._timedOut; - } - function Sys$Net$WebServiceError$get_statusCode() { - /// <value type="Number" locid="P:J#Sys.Net.WebServiceError.statusCode"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._statusCode; - } - function Sys$Net$WebServiceError$get_message() { - /// <value type="String" locid="P:J#Sys.Net.WebServiceError.message"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._message; - } - function Sys$Net$WebServiceError$get_stackTrace() { - /// <value type="String" locid="P:J#Sys.Net.WebServiceError.stackTrace"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._stackTrace; - } - function Sys$Net$WebServiceError$get_exceptionType() { - /// <value type="String" locid="P:J#Sys.Net.WebServiceError.exceptionType"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._exceptionType; - } -Sys.Net.WebServiceError.prototype = { - get_timedOut: Sys$Net$WebServiceError$get_timedOut, - get_statusCode: Sys$Net$WebServiceError$get_statusCode, - get_message: Sys$Net$WebServiceError$get_message, - get_stackTrace: Sys$Net$WebServiceError$get_stackTrace, - get_exceptionType: Sys$Net$WebServiceError$get_exceptionType -} -Sys.Net.WebServiceError.registerClass('Sys.Net.WebServiceError'); -Type.registerNamespace('Sys.Services'); -Sys.Services._ProfileService = function Sys$Services$_ProfileService() { - /// <summary locid="M:J#Sys.Net.ProfileService.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); - Sys.Services._ProfileService.initializeBase(this); - this.properties = {}; -} -Sys.Services._ProfileService.DefaultWebServicePath = ''; - function Sys$Services$_ProfileService$get_defaultLoadCompletedCallback() { - /// <value type="Function" mayBeNull="true" locid="P:J#Sys.Services.ProfileService.defaultLoadCompletedCallback"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._defaultLoadCompletedCallback; - } - function Sys$Services$_ProfileService$set_defaultLoadCompletedCallback(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Function, mayBeNull: true}]); - if (e) throw e; - this._defaultLoadCompletedCallback = value; - } - function Sys$Services$_ProfileService$get_defaultSaveCompletedCallback() { - /// <value type="Function" mayBeNull="true" locid="P:J#Sys.Services.ProfileService.defaultSaveCompletedCallback"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._defaultSaveCompletedCallback; - } - function Sys$Services$_ProfileService$set_defaultSaveCompletedCallback(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Function, mayBeNull: true}]); - if (e) throw e; - this._defaultSaveCompletedCallback = value; - } - function Sys$Services$_ProfileService$get_path() { - /// <value type="String" mayBeNull="true" locid="P:J#Sys.Services.ProfileService.path"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._path || ''; - } - function Sys$Services$_ProfileService$load(propertyNames, loadCompletedCallback, failedCallback, userContext) { - /// <summary locid="M:J#Sys.Services.ProfileService.load" /> - /// <param name="propertyNames" type="Array" elementType="String" optional="true" elementMayBeNull="false" mayBeNull="true"></param> - /// <param name="loadCompletedCallback" type="Function" optional="true" mayBeNull="true"></param> - /// <param name="failedCallback" type="Function" optional="true" mayBeNull="true"></param> - /// <param name="userContext" optional="true" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "propertyNames", type: Array, mayBeNull: true, optional: true, elementType: String}, - {name: "loadCompletedCallback", type: Function, mayBeNull: true, optional: true}, - {name: "failedCallback", type: Function, mayBeNull: true, optional: true}, - {name: "userContext", mayBeNull: true, optional: true} - ]); - if (e) throw e; - var parameters; - var methodName; - if (!propertyNames) { - methodName = "GetAllPropertiesForCurrentUser"; - parameters = { authenticatedUserOnly: false }; - } - else { - methodName = "GetPropertiesForCurrentUser"; - parameters = { properties: this._clonePropertyNames(propertyNames), authenticatedUserOnly: false }; - } - this._invoke(this._get_path(), - methodName, - false, - parameters, - Function.createDelegate(this, this._onLoadComplete), - Function.createDelegate(this, this._onLoadFailed), - [loadCompletedCallback, failedCallback, userContext]); - } - function Sys$Services$_ProfileService$save(propertyNames, saveCompletedCallback, failedCallback, userContext) { - /// <summary locid="M:J#Sys.Services.ProfileService.save" /> - /// <param name="propertyNames" type="Array" elementType="String" optional="true" elementMayBeNull="false" mayBeNull="true"></param> - /// <param name="saveCompletedCallback" type="Function" optional="true" mayBeNull="true"></param> - /// <param name="failedCallback" type="Function" optional="true" mayBeNull="true"></param> - /// <param name="userContext" optional="true" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "propertyNames", type: Array, mayBeNull: true, optional: true, elementType: String}, - {name: "saveCompletedCallback", type: Function, mayBeNull: true, optional: true}, - {name: "failedCallback", type: Function, mayBeNull: true, optional: true}, - {name: "userContext", mayBeNull: true, optional: true} - ]); - if (e) throw e; - var flattenedProperties = this._flattenProperties(propertyNames, this.properties); - this._invoke(this._get_path(), - "SetPropertiesForCurrentUser", - false, - { values: flattenedProperties.value, authenticatedUserOnly: false }, - Function.createDelegate(this, this._onSaveComplete), - Function.createDelegate(this, this._onSaveFailed), - [saveCompletedCallback, failedCallback, userContext, flattenedProperties.count]); - } - function Sys$Services$_ProfileService$_clonePropertyNames(arr) { - var nodups = []; - var seen = {}; - for (var i=0; i < arr.length; i++) { - var prop = arr[i]; - if(!seen[prop]) { Array.add(nodups, prop); seen[prop]=true; }; - } - return nodups; - } - function Sys$Services$_ProfileService$_flattenProperties(propertyNames, properties, groupName) { - var flattenedProperties = {}; - var val; - var key; - var count = 0; - if (propertyNames && propertyNames.length === 0) { - return { value: flattenedProperties, count: 0 }; - } - for (var property in properties) { - val = properties[property]; - key = groupName ? groupName + "." + property : property; - if(Sys.Services.ProfileGroup.isInstanceOfType(val)) { - var obj = this._flattenProperties(propertyNames, val, key); - var groupProperties = obj.value; - count += obj.count; - for(var subKey in groupProperties) { - var subVal = groupProperties[subKey]; - flattenedProperties[subKey] = subVal; - } - } - else { - if(!propertyNames || Array.indexOf(propertyNames, key) !== -1) { - flattenedProperties[key] = val; - count++; - } - } - } - return { value: flattenedProperties, count: count }; - } - function Sys$Services$_ProfileService$_get_path() { - var path = this.get_path(); - if (!path.length) { - path = Sys.Services._ProfileService.DefaultWebServicePath; - } - if (!path || !path.length) { - throw Error.invalidOperation(Sys.Res.servicePathNotSet); - } - return path; - } - function Sys$Services$_ProfileService$_onLoadComplete(result, context, methodName) { - if (typeof(result) !== "object") { - throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType, methodName, "Object")); - } - var unflattened = this._unflattenProperties(result); - for (var name in unflattened) { - this.properties[name] = unflattened[name]; - } - - var callback = context[0] || this.get_defaultLoadCompletedCallback() || this.get_defaultSucceededCallback(); - if (callback) { - var userContext = context[2] || this.get_defaultUserContext(); - callback(result.length, userContext, "Sys.Services.ProfileService.load"); - } - } - function Sys$Services$_ProfileService$_onLoadFailed(err, context, methodName) { - var callback = context[1] || this.get_defaultFailedCallback(); - if (callback) { - var userContext = context[2] || this.get_defaultUserContext(); - callback(err, userContext, "Sys.Services.ProfileService.load"); - } - else { - Sys.Net.WebServiceProxy._defaultFailedCallback(err, methodName); - } - } - function Sys$Services$_ProfileService$_onSaveComplete(result, context, methodName) { - var count = context[3]; - if (result !== null) { - if (result instanceof Array) { - count -= result.length; - } - else if (typeof(result) === 'number') { - count = result; - } - else { - throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType, methodName, "Array")); - } - } - - var callback = context[0] || this.get_defaultSaveCompletedCallback() || this.get_defaultSucceededCallback(); - if (callback) { - var userContext = context[2] || this.get_defaultUserContext(); - callback(count, userContext, "Sys.Services.ProfileService.save"); - } - } - function Sys$Services$_ProfileService$_onSaveFailed(err, context, methodName) { - var callback = context[1] || this.get_defaultFailedCallback(); - if (callback) { - var userContext = context[2] || this.get_defaultUserContext(); - callback(err, userContext, "Sys.Services.ProfileService.save"); - } - else { - Sys.Net.WebServiceProxy._defaultFailedCallback(err, methodName); - } - } - function Sys$Services$_ProfileService$_unflattenProperties(properties) { - var unflattenedProperties = {}; - var dotIndex; - var val; - var count = 0; - for (var key in properties) { - count++; - val = properties[key]; - dotIndex = key.indexOf('.'); - if (dotIndex !== -1) { - var groupName = key.substr(0, dotIndex); - key = key.substr(dotIndex+1); - var group = unflattenedProperties[groupName]; - if (!group || !Sys.Services.ProfileGroup.isInstanceOfType(group)) { - group = new Sys.Services.ProfileGroup(); - unflattenedProperties[groupName] = group; - } - group[key] = val; - } - else { - unflattenedProperties[key] = val; - } - } - properties.length = count; - return unflattenedProperties; - } -Sys.Services._ProfileService.prototype = { - _defaultLoadCompletedCallback: null, - _defaultSaveCompletedCallback: null, - _path: '', - _timeout: 0, - get_defaultLoadCompletedCallback: Sys$Services$_ProfileService$get_defaultLoadCompletedCallback, - set_defaultLoadCompletedCallback: Sys$Services$_ProfileService$set_defaultLoadCompletedCallback, - get_defaultSaveCompletedCallback: Sys$Services$_ProfileService$get_defaultSaveCompletedCallback, - set_defaultSaveCompletedCallback: Sys$Services$_ProfileService$set_defaultSaveCompletedCallback, - get_path: Sys$Services$_ProfileService$get_path, - load: Sys$Services$_ProfileService$load, - save: Sys$Services$_ProfileService$save, - _clonePropertyNames: Sys$Services$_ProfileService$_clonePropertyNames, - _flattenProperties: Sys$Services$_ProfileService$_flattenProperties, - _get_path: Sys$Services$_ProfileService$_get_path, - _onLoadComplete: Sys$Services$_ProfileService$_onLoadComplete, - _onLoadFailed: Sys$Services$_ProfileService$_onLoadFailed, - _onSaveComplete: Sys$Services$_ProfileService$_onSaveComplete, - _onSaveFailed: Sys$Services$_ProfileService$_onSaveFailed, - _unflattenProperties: Sys$Services$_ProfileService$_unflattenProperties -} -Sys.Services._ProfileService.registerClass('Sys.Services._ProfileService', Sys.Net.WebServiceProxy); -Sys.Services.ProfileService = new Sys.Services._ProfileService(); -Sys.Services.ProfileGroup = function Sys$Services$ProfileGroup(properties) { - /// <summary locid="M:J#Sys.Services.ProfileGroup.#ctor" /> - /// <param name="properties" optional="true" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "properties", mayBeNull: true, optional: true} - ]); - if (e) throw e; - if (properties) { - for (var property in properties) { - this[property] = properties[property]; - } - } -} -Sys.Services.ProfileGroup.registerClass('Sys.Services.ProfileGroup'); -Sys.Services._AuthenticationService = function Sys$Services$_AuthenticationService() { - /// <summary locid="M:J#Sys.Services.AuthenticationService.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); - Sys.Services._AuthenticationService.initializeBase(this); -} -Sys.Services._AuthenticationService.DefaultWebServicePath = ''; - function Sys$Services$_AuthenticationService$get_defaultLoginCompletedCallback() { - /// <value type="Function" mayBeNull="true" locid="P:J#Sys.Services.AuthenticationService.defaultLoginCompletedCallback"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._defaultLoginCompletedCallback; - } - function Sys$Services$_AuthenticationService$set_defaultLoginCompletedCallback(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Function, mayBeNull: true}]); - if (e) throw e; - this._defaultLoginCompletedCallback = value; - } - function Sys$Services$_AuthenticationService$get_defaultLogoutCompletedCallback() { - /// <value type="Function" mayBeNull="true" locid="P:J#Sys.Services.AuthenticationService.defaultLogoutCompletedCallback"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._defaultLogoutCompletedCallback; - } - function Sys$Services$_AuthenticationService$set_defaultLogoutCompletedCallback(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Function, mayBeNull: true}]); - if (e) throw e; - this._defaultLogoutCompletedCallback = value; - } - function Sys$Services$_AuthenticationService$get_isLoggedIn() { - /// <value type="Boolean" locid="P:J#Sys.Services.AuthenticationService.isLoggedIn"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._authenticated; - } - function Sys$Services$_AuthenticationService$get_path() { - /// <value type="String" mayBeNull="true" locid="P:J#Sys.Services.AuthenticationService.path"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._path || ''; - } - function Sys$Services$_AuthenticationService$login(username, password, isPersistent, customInfo, redirectUrl, loginCompletedCallback, failedCallback, userContext) { - /// <summary locid="M:J#Sys.Services.AuthenticationService.login" /> - /// <param name="username" type="String" mayBeNull="false"></param> - /// <param name="password" type="String" mayBeNull="true"></param> - /// <param name="isPersistent" type="Boolean" optional="true" mayBeNull="true"></param> - /// <param name="customInfo" type="String" optional="true" mayBeNull="true"></param> - /// <param name="redirectUrl" type="String" optional="true" mayBeNull="true"></param> - /// <param name="loginCompletedCallback" type="Function" optional="true" mayBeNull="true"></param> - /// <param name="failedCallback" type="Function" optional="true" mayBeNull="true"></param> - /// <param name="userContext" optional="true" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "username", type: String}, - {name: "password", type: String, mayBeNull: true}, - {name: "isPersistent", type: Boolean, mayBeNull: true, optional: true}, - {name: "customInfo", type: String, mayBeNull: true, optional: true}, - {name: "redirectUrl", type: String, mayBeNull: true, optional: true}, - {name: "loginCompletedCallback", type: Function, mayBeNull: true, optional: true}, - {name: "failedCallback", type: Function, mayBeNull: true, optional: true}, - {name: "userContext", mayBeNull: true, optional: true} - ]); - if (e) throw e; - this._invoke(this._get_path(), "Login", false, - { userName: username, password: password, createPersistentCookie: isPersistent }, - Function.createDelegate(this, this._onLoginComplete), - Function.createDelegate(this, this._onLoginFailed), - [username, password, isPersistent, customInfo, redirectUrl, loginCompletedCallback, failedCallback, userContext]); - } - function Sys$Services$_AuthenticationService$logout(redirectUrl, logoutCompletedCallback, failedCallback, userContext) { - /// <summary locid="M:J#Sys.Services.AuthenticationService.logout" /> - /// <param name="redirectUrl" type="String" optional="true" mayBeNull="true"></param> - /// <param name="logoutCompletedCallback" type="Function" optional="true" mayBeNull="true"></param> - /// <param name="failedCallback" type="Function" optional="true" mayBeNull="true"></param> - /// <param name="userContext" optional="true" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "redirectUrl", type: String, mayBeNull: true, optional: true}, - {name: "logoutCompletedCallback", type: Function, mayBeNull: true, optional: true}, - {name: "failedCallback", type: Function, mayBeNull: true, optional: true}, - {name: "userContext", mayBeNull: true, optional: true} - ]); - if (e) throw e; - this._invoke(this._get_path(), "Logout", false, {}, - Function.createDelegate(this, this._onLogoutComplete), - Function.createDelegate(this, this._onLogoutFailed), - [redirectUrl, logoutCompletedCallback, failedCallback, userContext]); - } - function Sys$Services$_AuthenticationService$_get_path() { - var path = this.get_path(); - if(!path.length) { - path = Sys.Services._AuthenticationService.DefaultWebServicePath; - } - if(!path || !path.length) { - throw Error.invalidOperation(Sys.Res.servicePathNotSet); - } - return path; - } - function Sys$Services$_AuthenticationService$_onLoginComplete(result, context, methodName) { - if(typeof(result) !== "boolean") { - throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType, methodName, "Boolean")); - } - - var redirectUrl = context[4]; - var userContext = context[7] || this.get_defaultUserContext(); - var callback = context[5] || this.get_defaultLoginCompletedCallback() || this.get_defaultSucceededCallback(); - - if(result) { - this._authenticated = true; - if (callback) { - callback(true, userContext, "Sys.Services.AuthenticationService.login"); - } - - if (typeof(redirectUrl) !== "undefined" && redirectUrl !== null) { - window.location.href = redirectUrl; - } - } - else if (callback) { - callback(false, userContext, "Sys.Services.AuthenticationService.login"); - } - } - function Sys$Services$_AuthenticationService$_onLoginFailed(err, context, methodName) { - var callback = context[6] || this.get_defaultFailedCallback(); - if (callback) { - var userContext = context[7] || this.get_defaultUserContext(); - callback(err, userContext, "Sys.Services.AuthenticationService.login"); - } - else { - Sys.Net.WebServiceProxy._defaultFailedCallback(err, methodName); - } - } - function Sys$Services$_AuthenticationService$_onLogoutComplete(result, context, methodName) { - if(result !== null) { - throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType, methodName, "null")); - } - - var redirectUrl = context[0]; - var userContext = context[3] || this.get_defaultUserContext(); - var callback = context[1] || this.get_defaultLogoutCompletedCallback() || this.get_defaultSucceededCallback(); - this._authenticated = false; - - if (callback) { - callback(null, userContext, "Sys.Services.AuthenticationService.logout"); - } - - if(!redirectUrl) { - window.location.reload(); - } - else { - window.location.href = redirectUrl; - } - } - function Sys$Services$_AuthenticationService$_onLogoutFailed(err, context, methodName) { - var callback = context[2] || this.get_defaultFailedCallback(); - if (callback) { - callback(err, context[3], "Sys.Services.AuthenticationService.logout"); - } - else { - Sys.Net.WebServiceProxy._defaultFailedCallback(err, methodName); - } - } - function Sys$Services$_AuthenticationService$_setAuthenticated(authenticated) { - this._authenticated = authenticated; - } -Sys.Services._AuthenticationService.prototype = { - _defaultLoginCompletedCallback: null, - _defaultLogoutCompletedCallback: null, - _path: '', - _timeout: 0, - _authenticated: false, - get_defaultLoginCompletedCallback: Sys$Services$_AuthenticationService$get_defaultLoginCompletedCallback, - set_defaultLoginCompletedCallback: Sys$Services$_AuthenticationService$set_defaultLoginCompletedCallback, - get_defaultLogoutCompletedCallback: Sys$Services$_AuthenticationService$get_defaultLogoutCompletedCallback, - set_defaultLogoutCompletedCallback: Sys$Services$_AuthenticationService$set_defaultLogoutCompletedCallback, - get_isLoggedIn: Sys$Services$_AuthenticationService$get_isLoggedIn, - get_path: Sys$Services$_AuthenticationService$get_path, - login: Sys$Services$_AuthenticationService$login, - logout: Sys$Services$_AuthenticationService$logout, - _get_path: Sys$Services$_AuthenticationService$_get_path, - _onLoginComplete: Sys$Services$_AuthenticationService$_onLoginComplete, - _onLoginFailed: Sys$Services$_AuthenticationService$_onLoginFailed, - _onLogoutComplete: Sys$Services$_AuthenticationService$_onLogoutComplete, - _onLogoutFailed: Sys$Services$_AuthenticationService$_onLogoutFailed, - _setAuthenticated: Sys$Services$_AuthenticationService$_setAuthenticated -} -Sys.Services._AuthenticationService.registerClass('Sys.Services._AuthenticationService', Sys.Net.WebServiceProxy); -Sys.Services.AuthenticationService = new Sys.Services._AuthenticationService(); -Sys.Services._RoleService = function Sys$Services$_RoleService() { - /// <summary locid="M:J#Sys.Services.RoleService.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); - Sys.Services._RoleService.initializeBase(this); - this._roles = []; -} -Sys.Services._RoleService.DefaultWebServicePath = ''; - function Sys$Services$_RoleService$get_defaultLoadCompletedCallback() { - /// <value type="Function" mayBeNull="true" locid="P:J#Sys.Services.RoleService.defaultLoadCompletedCallback"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._defaultLoadCompletedCallback; - } - function Sys$Services$_RoleService$set_defaultLoadCompletedCallback(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Function, mayBeNull: true}]); - if (e) throw e; - this._defaultLoadCompletedCallback = value; - } - function Sys$Services$_RoleService$get_path() { - /// <value type="String" mayBeNull="true" locid="P:J#Sys.Services.RoleService.path"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._path || ''; - } - function Sys$Services$_RoleService$get_roles() { - /// <value type="Array" elementType="String" mayBeNull="false" locid="P:J#Sys.Services.RoleService.roles"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return Array.clone(this._roles); - } - function Sys$Services$_RoleService$isUserInRole(role) { - /// <summary locid="M:J#Sys.Services.RoleService.isUserInRole" /> - /// <param name="role" type="String" mayBeNull="false"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "role", type: String} - ]); - if (e) throw e; - var v = this._get_rolesIndex()[role.trim().toLowerCase()]; - return !!v; - } - function Sys$Services$_RoleService$load(loadCompletedCallback, failedCallback, userContext) { - /// <summary locid="M:J#Sys.Services.RoleService.load" /> - /// <param name="loadCompletedCallback" type="Function" optional="true" mayBeNull="true"></param> - /// <param name="failedCallback" type="Function" optional="true" mayBeNull="true"></param> - /// <param name="userContext" optional="true" mayBeNull="true"></param> - var e = Function._validateParams(arguments, [ - {name: "loadCompletedCallback", type: Function, mayBeNull: true, optional: true}, - {name: "failedCallback", type: Function, mayBeNull: true, optional: true}, - {name: "userContext", mayBeNull: true, optional: true} - ]); - if (e) throw e; - Sys.Net.WebServiceProxy.invoke( - this._get_path(), - "GetRolesForCurrentUser", - false, - {} , - Function.createDelegate(this, this._onLoadComplete), - Function.createDelegate(this, this._onLoadFailed), - [loadCompletedCallback, failedCallback, userContext], - this.get_timeout()); - } - function Sys$Services$_RoleService$_get_path() { - var path = this.get_path(); - if(!path || !path.length) { - path = Sys.Services._RoleService.DefaultWebServicePath; - } - if(!path || !path.length) { - throw Error.invalidOperation(Sys.Res.servicePathNotSet); - } - return path; - } - function Sys$Services$_RoleService$_get_rolesIndex() { - if (!this._rolesIndex) { - var index = {}; - for(var i=0; i < this._roles.length; i++) { - index[this._roles[i].toLowerCase()] = true; - } - this._rolesIndex = index; - } - return this._rolesIndex; - } - function Sys$Services$_RoleService$_onLoadComplete(result, context, methodName) { - if(result && !(result instanceof Array)) { - throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType, methodName, "Array")); - } - this._roles = result; - this._rolesIndex = null; - var callback = context[0] || this.get_defaultLoadCompletedCallback() || this.get_defaultSucceededCallback(); - if (callback) { - var userContext = context[2] || this.get_defaultUserContext(); - var clonedResult = Array.clone(result); - callback(clonedResult, userContext, "Sys.Services.RoleService.load"); - } - } - function Sys$Services$_RoleService$_onLoadFailed(err, context, methodName) { - var callback = context[1] || this.get_defaultFailedCallback(); - if (callback) { - var userContext = context[2] || this.get_defaultUserContext(); - callback(err, userContext, "Sys.Services.RoleService.load"); - } - else { - Sys.Net.WebServiceProxy._defaultFailedCallback(err, methodName); - } - } -Sys.Services._RoleService.prototype = { - _defaultLoadCompletedCallback: null, - _rolesIndex: null, - _timeout: 0, - _path: '', - get_defaultLoadCompletedCallback: Sys$Services$_RoleService$get_defaultLoadCompletedCallback, - set_defaultLoadCompletedCallback: Sys$Services$_RoleService$set_defaultLoadCompletedCallback, - get_path: Sys$Services$_RoleService$get_path, - get_roles: Sys$Services$_RoleService$get_roles, - isUserInRole: Sys$Services$_RoleService$isUserInRole, - load: Sys$Services$_RoleService$load, - _get_path: Sys$Services$_RoleService$_get_path, - _get_rolesIndex: Sys$Services$_RoleService$_get_rolesIndex, - _onLoadComplete: Sys$Services$_RoleService$_onLoadComplete, - _onLoadFailed: Sys$Services$_RoleService$_onLoadFailed -} -Sys.Services._RoleService.registerClass('Sys.Services._RoleService', Sys.Net.WebServiceProxy); -Sys.Services.RoleService = new Sys.Services._RoleService(); -Type.registerNamespace('Sys.Serialization'); -Sys.Serialization.JavaScriptSerializer = function Sys$Serialization$JavaScriptSerializer() { - /// <summary locid="M:J#Sys.Serialization.JavaScriptSerializer.#ctor" /> - if (arguments.length !== 0) throw Error.parameterCount(); -} -Sys.Serialization.JavaScriptSerializer.registerClass('Sys.Serialization.JavaScriptSerializer'); -Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs = []; -Sys.Serialization.JavaScriptSerializer._charsToEscape = []; -Sys.Serialization.JavaScriptSerializer._dateRegEx = new RegExp('(^|[^\\\\])\\"\\\\/Date\\((-?[0-9]+)(?:[a-zA-Z]|(?:\\+|-)[0-9]{4})?\\)\\\\/\\"', 'g'); -Sys.Serialization.JavaScriptSerializer._escapeChars = {}; -Sys.Serialization.JavaScriptSerializer._escapeRegEx = new RegExp('["\\\\\\x00-\\x1F]', 'i'); -Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal = new RegExp('["\\\\\\x00-\\x1F]', 'g'); -Sys.Serialization.JavaScriptSerializer._jsonRegEx = new RegExp('[^,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]', 'g'); -Sys.Serialization.JavaScriptSerializer._jsonStringRegEx = new RegExp('"(\\\\.|[^"\\\\])*"', 'g'); -Sys.Serialization.JavaScriptSerializer._serverTypeFieldName = '__type'; -Sys.Serialization.JavaScriptSerializer._init = function Sys$Serialization$JavaScriptSerializer$_init() { - var replaceChars = ['\\u0000','\\u0001','\\u0002','\\u0003','\\u0004','\\u0005','\\u0006','\\u0007', - '\\b','\\t','\\n','\\u000b','\\f','\\r','\\u000e','\\u000f','\\u0010','\\u0011', - '\\u0012','\\u0013','\\u0014','\\u0015','\\u0016','\\u0017','\\u0018','\\u0019', - '\\u001a','\\u001b','\\u001c','\\u001d','\\u001e','\\u001f']; - Sys.Serialization.JavaScriptSerializer._charsToEscape[0] = '\\'; - Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['\\'] = new RegExp('\\\\', 'g'); - Sys.Serialization.JavaScriptSerializer._escapeChars['\\'] = '\\\\'; - Sys.Serialization.JavaScriptSerializer._charsToEscape[1] = '"'; - Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['"'] = new RegExp('"', 'g'); - Sys.Serialization.JavaScriptSerializer._escapeChars['"'] = '\\"'; - for (var i = 0; i < 32; i++) { - var c = String.fromCharCode(i); - Sys.Serialization.JavaScriptSerializer._charsToEscape[i+2] = c; - Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[c] = new RegExp(c, 'g'); - Sys.Serialization.JavaScriptSerializer._escapeChars[c] = replaceChars[i]; - } -} -Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeBooleanWithBuilder(object, stringBuilder) { - stringBuilder.append(object.toString()); -} -Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeNumberWithBuilder(object, stringBuilder) { - if (isFinite(object)) { - stringBuilder.append(String(object)); - } - else { - throw Error.invalidOperation(Sys.Res.cannotSerializeNonFiniteNumbers); - } -} -Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeStringWithBuilder(string, stringBuilder) { - stringBuilder.append('"'); - if (Sys.Serialization.JavaScriptSerializer._escapeRegEx.test(string)) { - if (Sys.Serialization.JavaScriptSerializer._charsToEscape.length === 0) { - Sys.Serialization.JavaScriptSerializer._init(); - } - if (string.length < 128) { - string = string.replace(Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal, - function(x) { return Sys.Serialization.JavaScriptSerializer._escapeChars[x]; }); - } - else { - for (var i = 0; i < 34; i++) { - var c = Sys.Serialization.JavaScriptSerializer._charsToEscape[i]; - if (string.indexOf(c) !== -1) { - if (Sys.Browser.agent === Sys.Browser.Opera || Sys.Browser.agent === Sys.Browser.FireFox) { - string = string.split(c).join(Sys.Serialization.JavaScriptSerializer._escapeChars[c]); - } - else { - string = string.replace(Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[c], - Sys.Serialization.JavaScriptSerializer._escapeChars[c]); - } - } - } - } - } - stringBuilder.append(string); - stringBuilder.append('"'); -} -Sys.Serialization.JavaScriptSerializer._serializeWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeWithBuilder(object, stringBuilder, sort, prevObjects) { - var i; - switch (typeof object) { - case 'object': - if (object) { - if (prevObjects){ - for( var j = 0; j < prevObjects.length; j++) { - if (prevObjects[j] === object) { - throw Error.invalidOperation(Sys.Res.cannotSerializeObjectWithCycle); - } - } - } - else { - prevObjects = new Array(); - } - try { - Array.add(prevObjects, object); - - if (Number.isInstanceOfType(object)){ - Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(object, stringBuilder); - } - else if (Boolean.isInstanceOfType(object)){ - Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(object, stringBuilder); - } - else if (String.isInstanceOfType(object)){ - Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(object, stringBuilder); - } - - else if (Array.isInstanceOfType(object)) { - stringBuilder.append('['); - - for (i = 0; i < object.length; ++i) { - if (i > 0) { - stringBuilder.append(','); - } - Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(object[i], stringBuilder,false,prevObjects); - } - stringBuilder.append(']'); - } - else { - if (Date.isInstanceOfType(object)) { - stringBuilder.append('"\\/Date('); - stringBuilder.append(object.getTime()); - stringBuilder.append(')\\/"'); - break; - } - var properties = []; - var propertyCount = 0; - for (var name in object) { - if (name.startsWith('$')) { - continue; - } - if (name === Sys.Serialization.JavaScriptSerializer._serverTypeFieldName && propertyCount !== 0){ - properties[propertyCount++] = properties[0]; - properties[0] = name; - } - else{ - properties[propertyCount++] = name; - } - } - if (sort) properties.sort(); - stringBuilder.append('{'); - var needComma = false; - - for (i=0; i<propertyCount; i++) { - var value = object[properties[i]]; - if (typeof value !== 'undefined' && typeof value !== 'function') { - if (needComma) { - stringBuilder.append(','); - } - else { - needComma = true; - } - - Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(properties[i], stringBuilder, sort, prevObjects); - stringBuilder.append(':'); - Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(value, stringBuilder, sort, prevObjects); - - } - } - stringBuilder.append('}'); - } - } - finally { - Array.removeAt(prevObjects, prevObjects.length - 1); - } - } - else { - stringBuilder.append('null'); - } - break; - case 'number': - Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(object, stringBuilder); - break; - case 'string': - Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(object, stringBuilder); - break; - case 'boolean': - Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(object, stringBuilder); - break; - default: - stringBuilder.append('null'); - break; - } -} -Sys.Serialization.JavaScriptSerializer.serialize = function Sys$Serialization$JavaScriptSerializer$serialize(object) { - /// <summary locid="M:J#Sys.Serialization.JavaScriptSerializer.serialize" /> - /// <param name="object" mayBeNull="true"></param> - /// <returns type="String"></returns> - var e = Function._validateParams(arguments, [ - {name: "object", mayBeNull: true} - ]); - if (e) throw e; - var stringBuilder = new Sys.StringBuilder(); - Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(object, stringBuilder, false); - return stringBuilder.toString(); -} -Sys.Serialization.JavaScriptSerializer.deserialize = function Sys$Serialization$JavaScriptSerializer$deserialize(data, secure) { - /// <summary locid="M:J#Sys.Serialization.JavaScriptSerializer.deserialize" /> - /// <param name="data" type="String"></param> - /// <param name="secure" type="Boolean" optional="true"></param> - /// <returns></returns> - var e = Function._validateParams(arguments, [ - {name: "data", type: String}, - {name: "secure", type: Boolean, optional: true} - ]); - if (e) throw e; - - if (data.length === 0) throw Error.argument('data', Sys.Res.cannotDeserializeEmptyString); - try { - var exp = data.replace(Sys.Serialization.JavaScriptSerializer._dateRegEx, "$1new Date($2)"); - - if (secure && Sys.Serialization.JavaScriptSerializer._jsonRegEx.test( - exp.replace(Sys.Serialization.JavaScriptSerializer._jsonStringRegEx, ''))) throw null; - return eval('(' + exp + ')'); - } - catch (e) { - throw Error.argument('data', Sys.Res.cannotDeserializeInvalidJson); - } -} - -Sys.CultureInfo = function Sys$CultureInfo(name, numberFormat, dateTimeFormat) { - /// <summary locid="M:J#Sys.CultureInfo.#ctor" /> - /// <param name="name" type="String"></param> - /// <param name="numberFormat" type="Object"></param> - /// <param name="dateTimeFormat" type="Object"></param> - var e = Function._validateParams(arguments, [ - {name: "name", type: String}, - {name: "numberFormat", type: Object}, - {name: "dateTimeFormat", type: Object} - ]); - if (e) throw e; - this.name = name; - this.numberFormat = numberFormat; - this.dateTimeFormat = dateTimeFormat; -} - function Sys$CultureInfo$_getDateTimeFormats() { - if (! this._dateTimeFormats) { - var dtf = this.dateTimeFormat; - this._dateTimeFormats = - [ dtf.MonthDayPattern, - dtf.YearMonthPattern, - dtf.ShortDatePattern, - dtf.ShortTimePattern, - dtf.LongDatePattern, - dtf.LongTimePattern, - dtf.FullDateTimePattern, - dtf.RFC1123Pattern, - dtf.SortableDateTimePattern, - dtf.UniversalSortableDateTimePattern ]; - } - return this._dateTimeFormats; - } - function Sys$CultureInfo$_getMonthIndex(value) { - if (!this._upperMonths) { - this._upperMonths = this._toUpperArray(this.dateTimeFormat.MonthNames); - } - return Array.indexOf(this._upperMonths, this._toUpper(value)); - } - function Sys$CultureInfo$_getAbbrMonthIndex(value) { - if (!this._upperAbbrMonths) { - this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames); - } - return Array.indexOf(this._upperAbbrMonths, this._toUpper(value)); - } - function Sys$CultureInfo$_getDayIndex(value) { - if (!this._upperDays) { - this._upperDays = this._toUpperArray(this.dateTimeFormat.DayNames); - } - return Array.indexOf(this._upperDays, this._toUpper(value)); - } - function Sys$CultureInfo$_getAbbrDayIndex(value) { - if (!this._upperAbbrDays) { - this._upperAbbrDays = this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames); - } - return Array.indexOf(this._upperAbbrDays, this._toUpper(value)); - } - function Sys$CultureInfo$_toUpperArray(arr) { - var result = []; - for (var i = 0, il = arr.length; i < il; i++) { - result[i] = this._toUpper(arr[i]); - } - return result; - } - function Sys$CultureInfo$_toUpper(value) { - return value.split("\u00A0").join(' ').toUpperCase(); - } -Sys.CultureInfo.prototype = { - _getDateTimeFormats: Sys$CultureInfo$_getDateTimeFormats, - _getMonthIndex: Sys$CultureInfo$_getMonthIndex, - _getAbbrMonthIndex: Sys$CultureInfo$_getAbbrMonthIndex, - _getDayIndex: Sys$CultureInfo$_getDayIndex, - _getAbbrDayIndex: Sys$CultureInfo$_getAbbrDayIndex, - _toUpperArray: Sys$CultureInfo$_toUpperArray, - _toUpper: Sys$CultureInfo$_toUpper -} -Sys.CultureInfo._parse = function Sys$CultureInfo$_parse(value) { - var cultureInfo = Sys.Serialization.JavaScriptSerializer.deserialize(value); - return new Sys.CultureInfo(cultureInfo.name, cultureInfo.numberFormat, cultureInfo.dateTimeFormat); -} -Sys.CultureInfo.registerClass('Sys.CultureInfo'); -Sys.CultureInfo.InvariantCulture = Sys.CultureInfo._parse('{"name":"","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":true,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"\u00A4","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":true},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, dd MMMM yyyy HH:mm:ss","LongDatePattern":"dddd, dd MMMM yyyy","LongTimePattern":"HH:mm:ss","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"MM/dd/yyyy","ShortTimePattern":"HH:mm","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"yyyy MMMM","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":true,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]}}'); -if (typeof(__cultureInfo) === 'undefined') { - var __cultureInfo = '{"name":"en-US","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":false,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"$","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":false},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, MMMM dd, yyyy h:mm:ss tt","LongDatePattern":"dddd, MMMM dd, yyyy","LongTimePattern":"h:mm:ss tt","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"M/d/yyyy","ShortTimePattern":"h:mm tt","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"MMMM, yyyy","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":false,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]}}'; -} -Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse(__cultureInfo); -delete __cultureInfo; - -Sys.UI.Behavior = function Sys$UI$Behavior(element) { - /// <summary locid="M:J#Sys.UI.Behavior.#ctor" /> - /// <param name="element" domElement="true"></param> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true} - ]); - if (e) throw e; - Sys.UI.Behavior.initializeBase(this); - this._element = element; - var behaviors = element._behaviors; - if (!behaviors) { - element._behaviors = [this]; - } - else { - behaviors[behaviors.length] = this; - } -} - function Sys$UI$Behavior$get_element() { - /// <value domElement="true" locid="P:J#Sys.UI.Behavior.element"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._element; - } - function Sys$UI$Behavior$get_id() { - /// <value type="String" locid="P:J#Sys.UI.Behavior.id"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - var baseId = Sys.UI.Behavior.callBaseMethod(this, 'get_id'); - if (baseId) return baseId; - if (!this._element || !this._element.id) return ''; - return this._element.id + '$' + this.get_name(); - } - function Sys$UI$Behavior$get_name() { - /// <value type="String" locid="P:J#Sys.UI.Behavior.name"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - if (this._name) return this._name; - var name = Object.getTypeName(this); - var i = name.lastIndexOf('.'); - if (i != -1) name = name.substr(i + 1); - if (!this.get_isInitialized()) this._name = name; - return name; - } - function Sys$UI$Behavior$set_name(value) { - var e = Function._validateParams(arguments, [{name: "value", type: String}]); - if (e) throw e; - if ((value === '') || (value.charAt(0) === ' ') || (value.charAt(value.length - 1) === ' ')) - throw Error.argument('value', Sys.Res.invalidId); - if (typeof(this._element[value]) !== 'undefined') - throw Error.invalidOperation(String.format(Sys.Res.behaviorDuplicateName, value)); - if (this.get_isInitialized()) throw Error.invalidOperation(Sys.Res.cantSetNameAfterInit); - this._name = value; - } - function Sys$UI$Behavior$initialize() { - Sys.UI.Behavior.callBaseMethod(this, 'initialize'); - var name = this.get_name(); - if (name) this._element[name] = this; - } - function Sys$UI$Behavior$dispose() { - Sys.UI.Behavior.callBaseMethod(this, 'dispose'); - if (this._element) { - var name = this.get_name(); - if (name) { - this._element[name] = null; - } - Array.remove(this._element._behaviors, this); - delete this._element; - } - } -Sys.UI.Behavior.prototype = { - _name: null, - get_element: Sys$UI$Behavior$get_element, - get_id: Sys$UI$Behavior$get_id, - get_name: Sys$UI$Behavior$get_name, - set_name: Sys$UI$Behavior$set_name, - initialize: Sys$UI$Behavior$initialize, - dispose: Sys$UI$Behavior$dispose -} -Sys.UI.Behavior.registerClass('Sys.UI.Behavior', Sys.Component); -Sys.UI.Behavior.getBehaviorByName = function Sys$UI$Behavior$getBehaviorByName(element, name) { - /// <summary locid="M:J#Sys.UI.Behavior.getBehaviorByName" /> - /// <param name="element" domElement="true"></param> - /// <param name="name" type="String"></param> - /// <returns type="Sys.UI.Behavior" mayBeNull="true"></returns> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true}, - {name: "name", type: String} - ]); - if (e) throw e; - var b = element[name]; - return (b && Sys.UI.Behavior.isInstanceOfType(b)) ? b : null; -} -Sys.UI.Behavior.getBehaviors = function Sys$UI$Behavior$getBehaviors(element) { - /// <summary locid="M:J#Sys.UI.Behavior.getBehaviors" /> - /// <param name="element" domElement="true"></param> - /// <returns type="Array" elementType="Sys.UI.Behavior"></returns> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true} - ]); - if (e) throw e; - if (!element._behaviors) return []; - return Array.clone(element._behaviors); -} -Sys.UI.Behavior.getBehaviorsByType = function Sys$UI$Behavior$getBehaviorsByType(element, type) { - /// <summary locid="M:J#Sys.UI.Behavior.getBehaviorsByType" /> - /// <param name="element" domElement="true"></param> - /// <param name="type" type="Type"></param> - /// <returns type="Array" elementType="Sys.UI.Behavior"></returns> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true}, - {name: "type", type: Type} - ]); - if (e) throw e; - var behaviors = element._behaviors; - var results = []; - if (behaviors) { - for (var i = 0, l = behaviors.length; i < l; i++) { - if (type.isInstanceOfType(behaviors[i])) { - results[results.length] = behaviors[i]; - } - } - } - return results; -} - -Sys.UI.VisibilityMode = function Sys$UI$VisibilityMode() { - /// <summary locid="M:J#Sys.UI.VisibilityMode.#ctor" /> - /// <field name="hide" type="Number" integer="true" static="true" locid="F:J#Sys.UI.VisibilityMode.hide"></field> - /// <field name="collapse" type="Number" integer="true" static="true" locid="F:J#Sys.UI.VisibilityMode.collapse"></field> - if (arguments.length !== 0) throw Error.parameterCount(); - throw Error.notImplemented(); -} -Sys.UI.VisibilityMode.prototype = { - hide: 0, - collapse: 1 -} -Sys.UI.VisibilityMode.registerEnum("Sys.UI.VisibilityMode"); - -Sys.UI.Control = function Sys$UI$Control(element) { - /// <summary locid="M:J#Sys.UI.Control.#ctor" /> - /// <param name="element" domElement="true"></param> - var e = Function._validateParams(arguments, [ - {name: "element", domElement: true} - ]); - if (e) throw e; - if (typeof(element.control) != 'undefined') throw Error.invalidOperation(Sys.Res.controlAlreadyDefined); - Sys.UI.Control.initializeBase(this); - this._element = element; - element.control = this; -} - function Sys$UI$Control$get_element() { - /// <value domElement="true" locid="P:J#Sys.UI.Control.element"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - return this._element; - } - function Sys$UI$Control$get_id() { - /// <value type="String" locid="P:J#Sys.UI.Control.id"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - if (!this._element) return ''; - return this._element.id; - } - function Sys$UI$Control$set_id(value) { - var e = Function._validateParams(arguments, [{name: "value", type: String}]); - if (e) throw e; - throw Error.invalidOperation(Sys.Res.cantSetId); - } - function Sys$UI$Control$get_parent() { - /// <value type="Sys.UI.Control" locid="P:J#Sys.UI.Control.parent"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - if (this._parent) return this._parent; - if (!this._element) return null; - - var parentElement = this._element.parentNode; - while (parentElement) { - if (parentElement.control) { - return parentElement.control; - } - parentElement = parentElement.parentNode; - } - return null; - } - function Sys$UI$Control$set_parent(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Sys.UI.Control}]); - if (e) throw e; - if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); - var parents = [this]; - var current = value; - while (current) { - if (Array.contains(parents, current)) throw Error.invalidOperation(Sys.Res.circularParentChain); - parents[parents.length] = current; - current = current.get_parent(); - } - this._parent = value; - } - function Sys$UI$Control$get_visibilityMode() { - /// <value type="Sys.UI.VisibilityMode" locid="P:J#Sys.UI.Control.visibilityMode"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); - return Sys.UI.DomElement.getVisibilityMode(this._element); - } - function Sys$UI$Control$set_visibilityMode(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Sys.UI.VisibilityMode}]); - if (e) throw e; - if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); - Sys.UI.DomElement.setVisibilityMode(this._element, value); - } - function Sys$UI$Control$get_visible() { - /// <value type="Boolean" locid="P:J#Sys.UI.Control.visible"></value> - if (arguments.length !== 0) throw Error.parameterCount(); - if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); - return Sys.UI.DomElement.getVisible(this._element); - } - function Sys$UI$Control$set_visible(value) { - var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]); - if (e) throw e; - if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); - Sys.UI.DomElement.setVisible(this._element, value) - } - function Sys$UI$Control$addCssClass(className) { - /// <summary locid="M:J#Sys.UI.Control.addCssClass" /> - /// <param name="className" type="String"></param> - var e = Function._validateParams(arguments, [ - {name: "className", type: String} - ]); - if (e) throw e; - if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); - Sys.UI.DomElement.addCssClass(this._element, className); - } - function Sys$UI$Control$dispose() { - Sys.UI.Control.callBaseMethod(this, 'dispose'); - if (this._element) { - this._element.control = undefined; - delete this._element; - } - if (this._parent) delete this._parent; - } - function Sys$UI$Control$onBubbleEvent(source, args) { - /// <summary locid="M:J#Sys.UI.Control.onBubbleEvent" /> - /// <param name="source"></param> - /// <param name="args" type="Sys.EventArgs"></param> - /// <returns type="Boolean"></returns> - var e = Function._validateParams(arguments, [ - {name: "source"}, - {name: "args", type: Sys.EventArgs} - ]); - if (e) throw e; - return false; - } - function Sys$UI$Control$raiseBubbleEvent(source, args) { - /// <summary locid="M:J#Sys.UI.Control.raiseBubbleEvent" /> - /// <param name="source"></param> - /// <param name="args" type="Sys.EventArgs"></param> - var e = Function._validateParams(arguments, [ - {name: "source"}, - {name: "args", type: Sys.EventArgs} - ]); - if (e) throw e; - var currentTarget = this.get_parent(); - while (currentTarget) { - if (currentTarget.onBubbleEvent(source, args)) { - return; - } - currentTarget = currentTarget.get_parent(); - } - } - function Sys$UI$Control$removeCssClass(className) { - /// <summary locid="M:J#Sys.UI.Control.removeCssClass" /> - /// <param name="className" type="String"></param> - var e = Function._validateParams(arguments, [ - {name: "className", type: String} - ]); - if (e) throw e; - if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); - Sys.UI.DomElement.removeCssClass(this._element, className); - } - function Sys$UI$Control$toggleCssClass(className) { - /// <summary locid="M:J#Sys.UI.Control.toggleCssClass" /> - /// <param name="className" type="String"></param> - var e = Function._validateParams(arguments, [ - {name: "className", type: String} - ]); - if (e) throw e; - if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); - Sys.UI.DomElement.toggleCssClass(this._element, className); - } -Sys.UI.Control.prototype = { - _parent: null, - _visibilityMode: Sys.UI.VisibilityMode.hide, - get_element: Sys$UI$Control$get_element, - get_id: Sys$UI$Control$get_id, - set_id: Sys$UI$Control$set_id, - get_parent: Sys$UI$Control$get_parent, - set_parent: Sys$UI$Control$set_parent, - get_visibilityMode: Sys$UI$Control$get_visibilityMode, - set_visibilityMode: Sys$UI$Control$set_visibilityMode, - get_visible: Sys$UI$Control$get_visible, - set_visible: Sys$UI$Control$set_visible, - addCssClass: Sys$UI$Control$addCssClass, - dispose: Sys$UI$Control$dispose, - onBubbleEvent: Sys$UI$Control$onBubbleEvent, - raiseBubbleEvent: Sys$UI$Control$raiseBubbleEvent, - removeCssClass: Sys$UI$Control$removeCssClass, - toggleCssClass: Sys$UI$Control$toggleCssClass -} -Sys.UI.Control.registerClass('Sys.UI.Control', Sys.Component); - - -Type.registerNamespace('Sys'); - -Sys.Res={ -'urlMustBeLessThan1024chars':'The history state must be small enough to not make the url larger than 1024 characters.', -'argumentTypeName':'Value is not the name of an existing type.', -'methodRegisteredTwice':'Method {0} has already been registered.', -'cantSetIdAfterInit':'The id property can\'t be set on this object after initialization.', -'cantBeCalledAfterDispose':'Can\'t be called after dispose.', -'componentCantSetIdAfterAddedToApp':'The id property of a component can\'t be set after it\'s been added to the Application object.', -'behaviorDuplicateName':'A behavior with name \'{0}\' already exists or it is the name of an existing property on the target element.', -'notATypeName':'Value is not a valid type name.', -'typeShouldBeTypeOrString':'Value is not a valid type or a valid type name.', -'historyInvalidHistorySettingCombination':'Cannot set enableHistory to false when ScriptManager.EnableHistory is true.', -'stateMustBeStringDictionary':'The state object can only have null and string fields.', -'boolTrueOrFalse':'Value must be \'true\' or \'false\'.', -'scriptLoadFailedNoHead':'ScriptLoader requires pages to contain a <head> element.', -'stringFormatInvalid':'The format string is invalid.', -'referenceNotFound':'Component \'{0}\' was not found.', -'enumReservedName':'\'{0}\' is a reserved name that can\'t be used as an enum value name.', -'eventHandlerNotFound':'Handler not found.', -'circularParentChain':'The chain of control parents can\'t have circular references.', -'undefinedEvent':'\'{0}\' is not an event.', -'notAMethod':'{0} is not a method.', -'propertyUndefined':'\'{0}\' is not a property or an existing field.', -'historyCannotEnableHistory':'Cannot set enableHistory after initialization.', -'eventHandlerInvalid':'Handler was not added through the Sys.UI.DomEvent.addHandler method.', -'scriptLoadFailedDebug':'The script \'{0}\' failed to load. Check for:\r\n Inaccessible path.\r\n Script errors. (IE) Enable \'Display a notification about every script error\' under advanced settings.\r\n Missing call to Sys.Application.notifyScriptLoaded().', -'propertyNotWritable':'\'{0}\' is not a writable property.', -'enumInvalidValueName':'\'{0}\' is not a valid name for an enum value.', -'controlAlreadyDefined':'A control is already associated with the element.', -'addHandlerCantBeUsedForError':'Can\'t add a handler for the error event using this method. Please set the window.onerror property instead.', -'namespaceContainsObject':'Object {0} already exists and is not a namespace.', -'cantAddNonFunctionhandler':'Can\'t add a handler that is not a function.', -'invalidNameSpace':'Value is not a valid namespace identifier.', -'notAnInterface':'Value is not a valid interface.', -'eventHandlerNotFunction':'Handler must be a function.', -'propertyNotAnArray':'\'{0}\' is not an Array property.', -'typeRegisteredTwice':'Type {0} has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.', -'cantSetNameAfterInit':'The name property can\'t be set on this object after initialization.', -'historyMissingFrame':'For the history feature to work in IE, the page must have an iFrame element with id \'__historyFrame\' pointed to a page that gets its title from the \'title\' query string parameter and calls Sys.Application._onIFrameLoad() on the parent window. This can be done by setting EnableHistory to true on ScriptManager.', -'appDuplicateComponent':'Two components with the same id \'{0}\' can\'t be added to the application.', -'historyCannotAddHistoryPointWithHistoryDisabled':'A history point can only be added if enableHistory is set to true.', -'appComponentMustBeInitialized':'Components must be initialized before they are added to the Application object.', -'baseNotAClass':'Value is not a class.', -'methodNotFound':'No method found with name \'{0}\'.', -'arrayParseBadFormat':'Value must be a valid string representation for an array. It must start with a \'[\' and end with a \']\'.', -'stateFieldNameInvalid':'State field names must not contain any \'=\' characters.', -'cantSetId':'The id property can\'t be set on this object.', -'historyMissingHiddenInput':'For the history feature to work in Safari 2, the page must have a hidden input element with id \'__history\'.', -'stringFormatBraceMismatch':'The format string contains an unmatched opening or closing brace.', -'enumValueNotInteger':'An enumeration definition can only contain integer values.', -'propertyNullOrUndefined':'Cannot set the properties of \'{0}\' because it returned a null value.', -'argumentDomNode':'Value must be a DOM element or a text node.', -'componentCantSetIdTwice':'The id property of a component can\'t be set more than once.', -'createComponentOnDom':'Value must be null for Components that are not Controls or Behaviors.', -'createNotComponent':'{0} does not derive from Sys.Component.', -'createNoDom':'Value must not be null for Controls and Behaviors.', -'cantAddWithoutId':'Can\'t add a component that doesn\'t have an id.', -'badTypeName':'Value is not the name of the type being registered or the name is a reserved word.', -'argumentInteger':'Value must be an integer.', -'scriptLoadMultipleCallbacks':'The script \'{0}\' contains multiple calls to Sys.Application.notifyScriptLoaded(). Only one is allowed.', -'invokeCalledTwice':'Cannot call invoke more than once.', -'webServiceFailed':'The server method \'{0}\' failed with the following error: {1}', -'webServiceInvalidJsonWrapper':'The server method \'{0}\' returned invalid data. The \'d\' property is missing from the JSON wrapper.', -'argumentType':'Object cannot be converted to the required type.', -'argumentNull':'Value cannot be null.', -'controlCantSetId':'The id property can\'t be set on a control.', -'formatBadFormatSpecifier':'Format specifier was invalid.', -'webServiceFailedNoMsg':'The server method \'{0}\' failed.', -'argumentDomElement':'Value must be a DOM element.', -'invalidExecutorType':'Could not create a valid Sys.Net.WebRequestExecutor from: {0}.', -'cannotCallBeforeResponse':'Cannot call {0} when responseAvailable is false.', -'actualValue':'Actual value was {0}.', -'enumInvalidValue':'\'{0}\' is not a valid value for enum {1}.', -'scriptLoadFailed':'The script \'{0}\' could not be loaded.', -'parameterCount':'Parameter count mismatch.', -'cannotDeserializeEmptyString':'Cannot deserialize empty string.', -'formatInvalidString':'Input string was not in a correct format.', -'invalidTimeout':'Value must be greater than or equal to zero.', -'cannotAbortBeforeStart':'Cannot abort when executor has not started.', -'argument':'Value does not fall within the expected range.', -'cannotDeserializeInvalidJson':'Cannot deserialize. The data does not correspond to valid JSON.', -'invalidHttpVerb':'httpVerb cannot be set to an empty or null string.', -'nullWebRequest':'Cannot call executeRequest with a null webRequest.', -'eventHandlerInvalid':'Handler was not added through the Sys.UI.DomEvent.addHandler method.', -'cannotSerializeNonFiniteNumbers':'Cannot serialize non finite numbers.', -'argumentUndefined':'Value cannot be undefined.', -'webServiceInvalidReturnType':'The server method \'{0}\' returned an invalid type. Expected type: {1}', -'servicePathNotSet':'The path to the web service has not been set.', -'argumentTypeWithTypes':'Object of type \'{0}\' cannot be converted to type \'{1}\'.', -'cannotCallOnceStarted':'Cannot call {0} once started.', -'badBaseUrl1':'Base URL does not contain ://.', -'badBaseUrl2':'Base URL does not contain another /.', -'badBaseUrl3':'Cannot find last / in base URL.', -'setExecutorAfterActive':'Cannot set executor after it has become active.', -'paramName':'Parameter name: {0}', -'cannotCallOutsideHandler':'Cannot call {0} outside of a completed event handler.', -'cannotSerializeObjectWithCycle':'Cannot serialize object with cyclic reference within child properties.', -'format':'One of the identified items was in an invalid format.', -'assertFailedCaller':'Assertion Failed: {0}\r\nat {1}', -'argumentOutOfRange':'Specified argument was out of the range of valid values.', -'webServiceTimedOut':'The server method \'{0}\' timed out.', -'notImplemented':'The method or operation is not implemented.', -'assertFailed':'Assertion Failed: {0}', -'invalidOperation':'Operation is not valid due to the current state of the object.', -'breakIntoDebugger':'{0}\r\n\r\nBreak into debugger?' -}; - -if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded(); diff --git a/projecttemplates/MvcRelyingParty/Scripts/MicrosoftAjax.js b/projecttemplates/MvcRelyingParty/Scripts/MicrosoftAjax.js deleted file mode 100644 index db85c14..0000000 --- a/projecttemplates/MvcRelyingParty/Scripts/MicrosoftAjax.js +++ /dev/null @@ -1,7 +0,0 @@ -//---------------------------------------------------------- -// Copyright (C) Microsoft Corporation. All rights reserved. -//---------------------------------------------------------- -// MicrosoftAjax.js -Function.__typeName="Function";Function.__class=true;Function.createCallback=function(b,a){return function(){var e=arguments.length;if(e>0){var d=[];for(var c=0;c<e;c++)d[c]=arguments[c];d[e]=a;return b.apply(this,d)}return b.call(this,a)}};Function.createDelegate=function(a,b){return function(){return b.apply(a,arguments)}};Function.emptyFunction=Function.emptyMethod=function(){};Function._validateParams=function(e,c){var a;a=Function._validateParameterCount(e,c);if(a){a.popStackFrame();return a}for(var b=0;b<e.length;b++){var d=c[Math.min(b,c.length-1)],f=d.name;if(d.parameterArray)f+="["+(b-c.length+1)+"]";a=Function._validateParameter(e[b],d,f);if(a){a.popStackFrame();return a}}return null};Function._validateParameterCount=function(e,a){var c=a.length,d=0;for(var b=0;b<a.length;b++)if(a[b].parameterArray)c=Number.MAX_VALUE;else if(!a[b].optional)d++;if(e.length<d||e.length>c){var f=Error.parameterCount();f.popStackFrame();return f}return null};Function._validateParameter=function(c,a,h){var b,g=a.type,l=!!a.integer,k=!!a.domElement,m=!!a.mayBeNull;b=Function._validateParameterType(c,g,l,k,m,h);if(b){b.popStackFrame();return b}var e=a.elementType,f=!!a.elementMayBeNull;if(g===Array&&typeof c!=="undefined"&&c!==null&&(e||!f)){var j=!!a.elementInteger,i=!!a.elementDomElement;for(var d=0;d<c.length;d++){var n=c[d];b=Function._validateParameterType(n,e,j,i,f,h+"["+d+"]");if(b){b.popStackFrame();return b}}}return null};Function._validateParameterType=function(a,c,n,m,k,d){var b;if(typeof a==="undefined")if(k)return null;else{b=Error.argumentUndefined(d);b.popStackFrame();return b}if(a===null)if(k)return null;else{b=Error.argumentNull(d);b.popStackFrame();return b}if(c&&c.__enum){if(typeof a!=="number"){b=Error.argumentType(d,Object.getType(a),c);b.popStackFrame();return b}if(a%1===0){var e=c.prototype;if(!c.__flags||a===0){for(var i in e)if(e[i]===a)return null}else{var l=a;for(var i in e){var f=e[i];if(f===0)continue;if((f&a)===f)l-=f;if(l===0)return null}}}b=Error.argumentOutOfRange(d,a,String.format(Sys.Res.enumInvalidValue,a,c.getName()));b.popStackFrame();return b}if(m){var h;if(typeof a.nodeType!=="number"){var g=a.ownerDocument||a.document||a;if(g!=a){var j=g.defaultView||g.parentWindow;h=j!=a&&!(j.document&&a.document&&j.document===a.document)}else h=typeof g.body==="undefined"}else h=a.nodeType===3;if(h){b=Error.argument(d,Sys.Res.argumentDomElement);b.popStackFrame();return b}}if(c&&!c.isInstanceOfType(a)){b=Error.argumentType(d,Object.getType(a),c);b.popStackFrame();return b}if(c===Number&&n)if(a%1!==0){b=Error.argumentOutOfRange(d,a,Sys.Res.argumentInteger);b.popStackFrame();return b}return null};Error.__typeName="Error";Error.__class=true;Error.create=function(d,b){var a=new Error(d);a.message=d;if(b)for(var c in b)a[c]=b[c];a.popStackFrame();return a};Error.argument=function(a,c){var b="Sys.ArgumentException: "+(c?c:Sys.Res.argument);if(a)b+="\n"+String.format(Sys.Res.paramName,a);var d=Error.create(b,{name:"Sys.ArgumentException",paramName:a});d.popStackFrame();return d};Error.argumentNull=function(a,c){var b="Sys.ArgumentNullException: "+(c?c:Sys.Res.argumentNull);if(a)b+="\n"+String.format(Sys.Res.paramName,a);var d=Error.create(b,{name:"Sys.ArgumentNullException",paramName:a});d.popStackFrame();return d};Error.argumentOutOfRange=function(c,a,d){var b="Sys.ArgumentOutOfRangeException: "+(d?d:Sys.Res.argumentOutOfRange);if(c)b+="\n"+String.format(Sys.Res.paramName,c);if(typeof a!=="undefined"&&a!==null)b+="\n"+String.format(Sys.Res.actualValue,a);var e=Error.create(b,{name:"Sys.ArgumentOutOfRangeException",paramName:c,actualValue:a});e.popStackFrame();return e};Error.argumentType=function(d,c,b,e){var a="Sys.ArgumentTypeException: ";if(e)a+=e;else if(c&&b)a+=String.format(Sys.Res.argumentTypeWithTypes,c.getName(),b.getName());else a+=Sys.Res.argumentType;if(d)a+="\n"+String.format(Sys.Res.paramName,d);var f=Error.create(a,{name:"Sys.ArgumentTypeException",paramName:d,actualType:c,expectedType:b});f.popStackFrame();return f};Error.argumentUndefined=function(a,c){var b="Sys.ArgumentUndefinedException: "+(c?c:Sys.Res.argumentUndefined);if(a)b+="\n"+String.format(Sys.Res.paramName,a);var d=Error.create(b,{name:"Sys.ArgumentUndefinedException",paramName:a});d.popStackFrame();return d};Error.format=function(a){var c="Sys.FormatException: "+(a?a:Sys.Res.format),b=Error.create(c,{name:"Sys.FormatException"});b.popStackFrame();return b};Error.invalidOperation=function(a){var c="Sys.InvalidOperationException: "+(a?a:Sys.Res.invalidOperation),b=Error.create(c,{name:"Sys.InvalidOperationException"});b.popStackFrame();return b};Error.notImplemented=function(a){var c="Sys.NotImplementedException: "+(a?a:Sys.Res.notImplemented),b=Error.create(c,{name:"Sys.NotImplementedException"});b.popStackFrame();return b};Error.parameterCount=function(a){var c="Sys.ParameterCountException: "+(a?a:Sys.Res.parameterCount),b=Error.create(c,{name:"Sys.ParameterCountException"});b.popStackFrame();return b};Error.prototype.popStackFrame=function(){if(typeof this.stack==="undefined"||this.stack===null||typeof this.fileName==="undefined"||this.fileName===null||typeof this.lineNumber==="undefined"||this.lineNumber===null)return;var a=this.stack.split("\n"),c=a[0],e=this.fileName+":"+this.lineNumber;while(typeof c!=="undefined"&&c!==null&&c.indexOf(e)===-1){a.shift();c=a[0]}var d=a[1];if(typeof d==="undefined"||d===null)return;var b=d.match(/@(.*):(\d+)$/);if(typeof b==="undefined"||b===null)return;this.fileName=b[1];this.lineNumber=parseInt(b[2]);a.shift();this.stack=a.join("\n")};Object.__typeName="Object";Object.__class=true;Object.getType=function(b){var a=b.constructor;if(!a||typeof a!=="function"||!a.__typeName||a.__typeName==="Object")return Object;return a};Object.getTypeName=function(a){return Object.getType(a).getName()};String.__typeName="String";String.__class=true;String.prototype.endsWith=function(a){return this.substr(this.length-a.length)===a};String.prototype.startsWith=function(a){return this.substr(0,a.length)===a};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.trimEnd=function(){return this.replace(/\s+$/,"")};String.prototype.trimStart=function(){return this.replace(/^\s+/,"")};String.format=function(){return String._toFormattedString(false,arguments)};String.localeFormat=function(){return String._toFormattedString(true,arguments)};String._toFormattedString=function(l,j){var c="",e=j[0];for(var a=0;true;){var f=e.indexOf("{",a),d=e.indexOf("}",a);if(f<0&&d<0){c+=e.slice(a);break}if(d>0&&(d<f||f<0)){c+=e.slice(a,d+1);a=d+2;continue}c+=e.slice(a,f);a=f+1;if(e.charAt(a)==="{"){c+="{";a++;continue}if(d<0)break;var h=e.substring(a,d),g=h.indexOf(":"),k=parseInt(g<0?h:h.substring(0,g),10)+1,i=g<0?"":h.substring(g+1),b=j[k];if(typeof b==="undefined"||b===null)b="";if(b.toFormattedString)c+=b.toFormattedString(i);else if(l&&b.localeFormat)c+=b.localeFormat(i);else if(b.format)c+=b.format(i);else c+=b.toString();a=d+1}return c};Boolean.__typeName="Boolean";Boolean.__class=true;Boolean.parse=function(b){var a=b.trim().toLowerCase();if(a==="false")return false;if(a==="true")return true};Date.__typeName="Date";Date.__class=true;Date._appendPreOrPostMatch=function(e,b){var d=0,a=false;for(var c=0,g=e.length;c<g;c++){var f=e.charAt(c);switch(f){case "'":if(a)b.append("'");else d++;a=false;break;case "\\":if(a)b.append("\\");a=!a;break;default:b.append(f);a=false}}return d};Date._expandFormat=function(a,b){if(!b)b="F";if(b.length===1)switch(b){case "d":return a.ShortDatePattern;case "D":return a.LongDatePattern;case "t":return a.ShortTimePattern;case "T":return a.LongTimePattern;case "F":return a.FullDateTimePattern;case "M":case "m":return a.MonthDayPattern;case "s":return a.SortableDateTimePattern;case "Y":case "y":return a.YearMonthPattern;default:throw Error.format(Sys.Res.formatInvalidString)}return b};Date._expandYear=function(c,a){if(a<100){var b=(new Date).getFullYear();a+=b-b%100;if(a>c.Calendar.TwoDigitYearMax)return a-100}return a};Date._getParseRegExp=function(b,e){if(!b._parseRegExp)b._parseRegExp={};else if(b._parseRegExp[e])return b._parseRegExp[e];var c=Date._expandFormat(b,e);c=c.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");var a=new Sys.StringBuilder("^"),j=[],f=0,i=0,h=Date._getTokenRegExp(),d;while((d=h.exec(c))!==null){var l=c.slice(f,d.index);f=h.lastIndex;i+=Date._appendPreOrPostMatch(l,a);if(i%2===1){a.append(d[0]);continue}switch(d[0]){case "dddd":case "ddd":case "MMMM":case "MMM":a.append("(\\D+)");break;case "tt":case "t":a.append("(\\D*)");break;case "yyyy":a.append("(\\d{4})");break;case "fff":a.append("(\\d{3})");break;case "ff":a.append("(\\d{2})");break;case "f":a.append("(\\d)");break;case "dd":case "d":case "MM":case "M":case "yy":case "y":case "HH":case "H":case "hh":case "h":case "mm":case "m":case "ss":case "s":a.append("(\\d\\d?)");break;case "zzz":a.append("([+-]?\\d\\d?:\\d{2})");break;case "zz":case "z":a.append("([+-]?\\d\\d?)")}Array.add(j,d[0])}Date._appendPreOrPostMatch(c.slice(f),a);a.append("$");var k=a.toString().replace(/\s+/g,"\\s+"),g={"regExp":k,"groups":j};b._parseRegExp[e]=g;return g};Date._getTokenRegExp=function(){return /dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z/g};Date.parseLocale=function(a){return Date._parse(a,Sys.CultureInfo.CurrentCulture,arguments)};Date.parseInvariant=function(a){return Date._parse(a,Sys.CultureInfo.InvariantCulture,arguments)};Date._parse=function(g,c,h){var e=false;for(var a=1,i=h.length;a<i;a++){var f=h[a];if(f){e=true;var b=Date._parseExact(g,f,c);if(b)return b}}if(!e){var d=c._getDateTimeFormats();for(var a=0,i=d.length;a<i;a++){var b=Date._parseExact(g,d[a],c);if(b)return b}}return null};Date._parseExact=function(s,y,j){s=s.trim();var m=j.dateTimeFormat,v=Date._getParseRegExp(m,y),x=(new RegExp(v.regExp)).exec(s);if(x===null)return null;var w=v.groups,f=null,c=null,h=null,g=null,d=0,n=0,o=0,e=0,k=null,r=false;for(var p=0,z=w.length;p<z;p++){var a=x[p+1];if(a)switch(w[p]){case "dd":case "d":h=parseInt(a,10);if(h<1||h>31)return null;break;case "MMMM":c=j._getMonthIndex(a);if(c<0||c>11)return null;break;case "MMM":c=j._getAbbrMonthIndex(a);if(c<0||c>11)return null;break;case "M":case "MM":var c=parseInt(a,10)-1;if(c<0||c>11)return null;break;case "y":case "yy":f=Date._expandYear(m,parseInt(a,10));if(f<0||f>9999)return null;break;case "yyyy":f=parseInt(a,10);if(f<0||f>9999)return null;break;case "h":case "hh":d=parseInt(a,10);if(d===12)d=0;if(d<0||d>11)return null;break;case "H":case "HH":d=parseInt(a,10);if(d<0||d>23)return null;break;case "m":case "mm":n=parseInt(a,10);if(n<0||n>59)return null;break;case "s":case "ss":o=parseInt(a,10);if(o<0||o>59)return null;break;case "tt":case "t":var u=a.toUpperCase();r=u===m.PMDesignator.toUpperCase();if(!r&&u!==m.AMDesignator.toUpperCase())return null;break;case "f":e=parseInt(a,10)*100;if(e<0||e>999)return null;break;case "ff":e=parseInt(a,10)*10;if(e<0||e>999)return null;break;case "fff":e=parseInt(a,10);if(e<0||e>999)return null;break;case "dddd":g=j._getDayIndex(a);if(g<0||g>6)return null;break;case "ddd":g=j._getAbbrDayIndex(a);if(g<0||g>6)return null;break;case "zzz":var q=a.split(/:/);if(q.length!==2)return null;var i=parseInt(q[0],10);if(i<-12||i>13)return null;var l=parseInt(q[1],10);if(l<0||l>59)return null;k=i*60+(a.startsWith("-")?-l:l);break;case "z":case "zz":var i=parseInt(a,10);if(i<-12||i>13)return null;k=i*60}}var b=new Date;if(f===null)f=b.getFullYear();if(c===null)c=b.getMonth();if(h===null)h=b.getDate();b.setFullYear(f,c,h);if(b.getDate()!==h)return null;if(g!==null&&b.getDay()!==g)return null;if(r&&d<12)d+=12;b.setHours(d,n,o,e);if(k!==null){var t=b.getMinutes()-(k+b.getTimezoneOffset());b.setHours(b.getHours()+parseInt(t/60,10),t%60)}return b};Date.prototype.format=function(a){return this._toFormattedString(a,Sys.CultureInfo.InvariantCulture)};Date.prototype.localeFormat=function(a){return this._toFormattedString(a,Sys.CultureInfo.CurrentCulture)};Date.prototype._toFormattedString=function(e,h){if(!e||e.length===0||e==="i")if(h&&h.name.length>0)return this.toLocaleString();else return this.toString();var d=h.dateTimeFormat;e=Date._expandFormat(d,e);var a=new Sys.StringBuilder,b;function c(a){if(a<10)return "0"+a;return a.toString()}function g(a){if(a<10)return "00"+a;if(a<100)return "0"+a;return a.toString()}var j=0,i=Date._getTokenRegExp();for(;true;){var l=i.lastIndex,f=i.exec(e),k=e.slice(l,f?f.index:e.length);j+=Date._appendPreOrPostMatch(k,a);if(!f)break;if(j%2===1){a.append(f[0]);continue}switch(f[0]){case "dddd":a.append(d.DayNames[this.getDay()]);break;case "ddd":a.append(d.AbbreviatedDayNames[this.getDay()]);break;case "dd":a.append(c(this.getDate()));break;case "d":a.append(this.getDate());break;case "MMMM":a.append(d.MonthNames[this.getMonth()]);break;case "MMM":a.append(d.AbbreviatedMonthNames[this.getMonth()]);break;case "MM":a.append(c(this.getMonth()+1));break;case "M":a.append(this.getMonth()+1);break;case "yyyy":a.append(this.getFullYear());break;case "yy":a.append(c(this.getFullYear()%100));break;case "y":a.append(this.getFullYear()%100);break;case "hh":b=this.getHours()%12;if(b===0)b=12;a.append(c(b));break;case "h":b=this.getHours()%12;if(b===0)b=12;a.append(b);break;case "HH":a.append(c(this.getHours()));break;case "H":a.append(this.getHours());break;case "mm":a.append(c(this.getMinutes()));break;case "m":a.append(this.getMinutes());break;case "ss":a.append(c(this.getSeconds()));break;case "s":a.append(this.getSeconds());break;case "tt":a.append(this.getHours()<12?d.AMDesignator:d.PMDesignator);break;case "t":a.append((this.getHours()<12?d.AMDesignator:d.PMDesignator).charAt(0));break;case "f":a.append(g(this.getMilliseconds()).charAt(0));break;case "ff":a.append(g(this.getMilliseconds()).substr(0,2));break;case "fff":a.append(g(this.getMilliseconds()));break;case "z":b=this.getTimezoneOffset()/60;a.append((b<=0?"+":"-")+Math.floor(Math.abs(b)));break;case "zz":b=this.getTimezoneOffset()/60;a.append((b<=0?"+":"-")+c(Math.floor(Math.abs(b))));break;case "zzz":b=this.getTimezoneOffset()/60;a.append((b<=0?"+":"-")+c(Math.floor(Math.abs(b)))+d.TimeSeparator+c(Math.abs(this.getTimezoneOffset()%60)))}}return a.toString()};Number.__typeName="Number";Number.__class=true;Number.parseLocale=function(a){return Number._parse(a,Sys.CultureInfo.CurrentCulture)};Number.parseInvariant=function(a){return Number._parse(a,Sys.CultureInfo.InvariantCulture)};Number._parse=function(b,o){b=b.trim();if(b.match(/^[+-]?infinity$/i))return parseFloat(b);if(b.match(/^0x[a-f0-9]+$/i))return parseInt(b);var a=o.numberFormat,g=Number._parseNumberNegativePattern(b,a,a.NumberNegativePattern),h=g[0],e=g[1];if(h===""&&a.NumberNegativePattern!==1){g=Number._parseNumberNegativePattern(b,a,1);h=g[0];e=g[1]}if(h==="")h="+";var j,d,f=e.indexOf("e");if(f<0)f=e.indexOf("E");if(f<0){d=e;j=null}else{d=e.substr(0,f);j=e.substr(f+1)}var c,k,m=d.indexOf(a.NumberDecimalSeparator);if(m<0){c=d;k=null}else{c=d.substr(0,m);k=d.substr(m+a.NumberDecimalSeparator.length)}c=c.split(a.NumberGroupSeparator).join("");var n=a.NumberGroupSeparator.replace(/\u00A0/g," ");if(a.NumberGroupSeparator!==n)c=c.split(n).join("");var l=h+c;if(k!==null)l+="."+k;if(j!==null){var i=Number._parseNumberNegativePattern(j,a,1);if(i[0]==="")i[0]="+";l+="e"+i[0]+i[1]}if(l.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/))return parseFloat(l);return Number.NaN};Number._parseNumberNegativePattern=function(a,d,e){var b=d.NegativeSign,c=d.PositiveSign;switch(e){case 4:b=" "+b;c=" "+c;case 3:if(a.endsWith(b))return ["-",a.substr(0,a.length-b.length)];else if(a.endsWith(c))return ["+",a.substr(0,a.length-c.length)];break;case 2:b+=" ";c+=" ";case 1:if(a.startsWith(b))return ["-",a.substr(b.length)];else if(a.startsWith(c))return ["+",a.substr(c.length)];break;case 0:if(a.startsWith("(")&&a.endsWith(")"))return ["-",a.substr(1,a.length-2)]}return ["",a]};Number.prototype.format=function(a){return this._toFormattedString(a,Sys.CultureInfo.InvariantCulture)};Number.prototype.localeFormat=function(a){return this._toFormattedString(a,Sys.CultureInfo.CurrentCulture)};Number.prototype._toFormattedString=function(d,j){if(!d||d.length===0||d==="i")if(j&&j.name.length>0)return this.toLocaleString();else return this.toString();var o=["n %","n%","%n"],n=["-n %","-n%","-%n"],p=["(n)","-n","- n","n-","n -"],m=["$n","n$","$ n","n $"],l=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"];function g(a,c,d){for(var b=a.length;b<c;b++)a=d?"0"+a:a+"0";return a}function i(j,i,l,n,p){var h=l[0],k=1,o=Math.pow(10,i),m=Math.round(j*o)/o;if(!isFinite(m))m=j;j=m;var b=j.toString(),a="",c,e=b.split(/e/i);b=e[0];c=e.length>1?parseInt(e[1]):0;e=b.split(".");b=e[0];a=e.length>1?e[1]:"";var q;if(c>0){a=g(a,c,false);b+=a.slice(0,c);a=a.substr(c)}else if(c<0){c=-c;b=g(b,c+1,true);a=b.slice(-c,b.length)+a;b=b.slice(0,-c)}if(i>0){if(a.length>i)a=a.slice(0,i);else a=g(a,i,false);a=p+a}else a="";var d=b.length-1,f="";while(d>=0){if(h===0||h>d)if(f.length>0)return b.slice(0,d+1)+n+f+a;else return b.slice(0,d+1)+a;if(f.length>0)f=b.slice(d-h+1,d+1)+n+f;else f=b.slice(d-h+1,d+1);d-=h;if(k<l.length){h=l[k];k++}}return b.slice(0,d+1)+n+f+a}var a=j.numberFormat,e=Math.abs(this);if(!d)d="D";var b=-1;if(d.length>1)b=parseInt(d.slice(1),10);var c;switch(d.charAt(0)){case "d":case "D":c="n";if(b!==-1)e=g(""+e,b,true);if(this<0)e=-e;break;case "c":case "C":if(this<0)c=l[a.CurrencyNegativePattern];else c=m[a.CurrencyPositivePattern];if(b===-1)b=a.CurrencyDecimalDigits;e=i(Math.abs(this),b,a.CurrencyGroupSizes,a.CurrencyGroupSeparator,a.CurrencyDecimalSeparator);break;case "n":case "N":if(this<0)c=p[a.NumberNegativePattern];else c="n";if(b===-1)b=a.NumberDecimalDigits;e=i(Math.abs(this),b,a.NumberGroupSizes,a.NumberGroupSeparator,a.NumberDecimalSeparator);break;case "p":case "P":if(this<0)c=n[a.PercentNegativePattern];else c=o[a.PercentPositivePattern];if(b===-1)b=a.PercentDecimalDigits;e=i(Math.abs(this)*100,b,a.PercentGroupSizes,a.PercentGroupSeparator,a.PercentDecimalSeparator);break;default:throw Error.format(Sys.Res.formatBadFormatSpecifier)}var k=/n|\$|-|%/g,f="";for(;true;){var q=k.lastIndex,h=k.exec(c);f+=c.slice(q,h?h.index:c.length);if(!h)break;switch(h[0]){case "n":f+=e;break;case "$":f+=a.CurrencySymbol;break;case "-":f+=a.NegativeSign;break;case "%":f+=a.PercentSymbol}}return f};RegExp.__typeName="RegExp";RegExp.__class=true;Array.__typeName="Array";Array.__class=true;Array.add=Array.enqueue=function(a,b){a[a.length]=b};Array.addRange=function(a,b){a.push.apply(a,b)};Array.clear=function(a){a.length=0};Array.clone=function(a){if(a.length===1)return [a[0]];else return Array.apply(null,a)};Array.contains=function(a,b){return Array.indexOf(a,b)>=0};Array.dequeue=function(a){return a.shift()};Array.forEach=function(b,e,d){for(var a=0,f=b.length;a<f;a++){var c=b[a];if(typeof c!=="undefined")e.call(d,c,a,b)}};Array.indexOf=function(d,e,a){if(typeof e==="undefined")return -1;var c=d.length;if(c!==0){a=a-0;if(isNaN(a))a=0;else{if(isFinite(a))a=a-a%1;if(a<0)a=Math.max(0,c+a)}for(var b=a;b<c;b++)if(typeof d[b]!=="undefined"&&d[b]===e)return b}return -1};Array.insert=function(a,b,c){a.splice(b,0,c)};Array.parse=function(value){if(!value)return [];return eval(value)};Array.remove=function(b,c){var a=Array.indexOf(b,c);if(a>=0)b.splice(a,1);return a>=0};Array.removeAt=function(a,b){a.splice(b,1)};if(!window)this.window=this;window.Type=Function;Type.prototype.callBaseMethod=function(a,d,b){var c=this.getBaseMethod(a,d);if(!b)return c.apply(a);else return c.apply(a,b)};Type.prototype.getBaseMethod=function(d,c){var b=this.getBaseType();if(b){var a=b.prototype[c];return a instanceof Function?a:null}return null};Type.prototype.getBaseType=function(){return typeof this.__baseType==="undefined"?null:this.__baseType};Type.prototype.getInterfaces=function(){var a=[],b=this;while(b){var c=b.__interfaces;if(c)for(var d=0,f=c.length;d<f;d++){var e=c[d];if(!Array.contains(a,e))a[a.length]=e}b=b.__baseType}return a};Type.prototype.getName=function(){return typeof this.__typeName==="undefined"?"":this.__typeName};Type.prototype.implementsInterface=function(d){this.resolveInheritance();var c=d.getName(),a=this.__interfaceCache;if(a){var e=a[c];if(typeof e!=="undefined")return e}else a=this.__interfaceCache={};var b=this;while(b){var f=b.__interfaces;if(f)if(Array.indexOf(f,d)!==-1)return a[c]=true;b=b.__baseType}return a[c]=false};Type.prototype.inheritsFrom=function(b){this.resolveInheritance();var a=this.__baseType;while(a){if(a===b)return true;a=a.__baseType}return false};Type.prototype.initializeBase=function(a,b){this.resolveInheritance();if(this.__baseType)if(!b)this.__baseType.apply(a);else this.__baseType.apply(a,b);return a};Type.prototype.isImplementedBy=function(a){if(typeof a==="undefined"||a===null)return false;var b=Object.getType(a);return !!(b.implementsInterface&&b.implementsInterface(this))};Type.prototype.isInstanceOfType=function(b){if(typeof b==="undefined"||b===null)return false;if(b instanceof this)return true;var a=Object.getType(b);return !!(a===this)||a.inheritsFrom&&a.inheritsFrom(this)||a.implementsInterface&&a.implementsInterface(this)};Type.prototype.registerClass=function(c,b,d){this.prototype.constructor=this;this.__typeName=c;this.__class=true;if(b){this.__baseType=b;this.__basePrototypePending=true}Sys.__upperCaseTypes[c.toUpperCase()]=this;if(d){this.__interfaces=[];for(var a=2,f=arguments.length;a<f;a++){var e=arguments[a];this.__interfaces.push(e)}}return this};Type.prototype.registerInterface=function(a){Sys.__upperCaseTypes[a.toUpperCase()]=this;this.prototype.constructor=this;this.__typeName=a;this.__interface=true;return this};Type.prototype.resolveInheritance=function(){if(this.__basePrototypePending){var b=this.__baseType;b.resolveInheritance();for(var a in b.prototype){var c=b.prototype[a];if(!this.prototype[a])this.prototype[a]=c}delete this.__basePrototypePending}};Type.getRootNamespaces=function(){return Array.clone(Sys.__rootNamespaces)};Type.isClass=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__class};Type.isInterface=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__interface};Type.isNamespace=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__namespace};Type.parse=function(typeName,ns){var fn;if(ns){fn=Sys.__upperCaseTypes[ns.getName().toUpperCase()+"."+typeName.toUpperCase()];return fn||null}if(!typeName)return null;if(!Type.__htClasses)Type.__htClasses={};fn=Type.__htClasses[typeName];if(!fn){fn=eval(typeName);Type.__htClasses[typeName]=fn}return fn};Type.registerNamespace=function(f){var d=window,c=f.split(".");for(var b=0;b<c.length;b++){var e=c[b],a=d[e];if(!a){a=d[e]={__namespace:true,__typeName:c.slice(0,b+1).join(".")};if(b===0)Sys.__rootNamespaces[Sys.__rootNamespaces.length]=a;a.getName=function(){return this.__typeName}}d=a}};window.Sys={__namespace:true,__typeName:"Sys",getName:function(){return "Sys"},__upperCaseTypes:{}};Sys.__rootNamespaces=[Sys];Sys.IDisposable=function(){};Sys.IDisposable.prototype={};Sys.IDisposable.registerInterface("Sys.IDisposable");Sys.StringBuilder=function(a){this._parts=typeof a!=="undefined"&&a!==null&&a!==""?[a.toString()]:[];this._value={};this._len=0};Sys.StringBuilder.prototype={append:function(a){this._parts[this._parts.length]=a},appendLine:function(a){this._parts[this._parts.length]=typeof a==="undefined"||a===null||a===""?"\r\n":a+"\r\n"},clear:function(){this._parts=[];this._value={};this._len=0},isEmpty:function(){if(this._parts.length===0)return true;return this.toString()===""},toString:function(a){a=a||"";var b=this._parts;if(this._len!==b.length){this._value={};this._len=b.length}var d=this._value;if(typeof d[a]==="undefined"){if(a!=="")for(var c=0;c<b.length;)if(typeof b[c]==="undefined"||b[c]===""||b[c]===null)b.splice(c,1);else c++;d[a]=this._parts.join(a)}return d[a]}};Sys.StringBuilder.registerClass("Sys.StringBuilder");if(!window.XMLHttpRequest)window.XMLHttpRequest=function(){var b=["Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP"];for(var a=0,c=b.length;a<c;a++)try{return new ActiveXObject(b[a])}catch(d){}return null};Sys.Browser={};Sys.Browser.InternetExplorer={};Sys.Browser.Firefox={};Sys.Browser.Safari={};Sys.Browser.Opera={};Sys.Browser.agent=null;Sys.Browser.hasDebuggerStatement=false;Sys.Browser.name=navigator.appName;Sys.Browser.version=parseFloat(navigator.appVersion);Sys.Browser.documentMode=0;if(navigator.userAgent.indexOf(" MSIE ")>-1){Sys.Browser.agent=Sys.Browser.InternetExplorer;Sys.Browser.version=parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);if(Sys.Browser.version>=8)if(document.documentMode>=7)Sys.Browser.documentMode=document.documentMode;Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" Firefox/")>-1){Sys.Browser.agent=Sys.Browser.Firefox;Sys.Browser.version=parseFloat(navigator.userAgent.match(/Firefox\/(\d+\.\d+)/)[1]);Sys.Browser.name="Firefox";Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" AppleWebKit/")>-1){Sys.Browser.agent=Sys.Browser.Safari;Sys.Browser.version=parseFloat(navigator.userAgent.match(/AppleWebKit\/(\d+(\.\d+)?)/)[1]);Sys.Browser.name="Safari"}else if(navigator.userAgent.indexOf("Opera/")>-1)Sys.Browser.agent=Sys.Browser.Opera;Type.registerNamespace("Sys.UI");Sys._Debug=function(){};Sys._Debug.prototype={_appendConsole:function(a){if(typeof Debug!=="undefined"&&Debug.writeln)Debug.writeln(a);if(window.console&&window.console.log)window.console.log(a);if(window.opera)window.opera.postError(a);if(window.debugService)window.debugService.trace(a)},_appendTrace:function(b){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value+=b+"\n"},assert:function(c,a,b){if(!c){a=b&&this.assert.caller?String.format(Sys.Res.assertFailedCaller,a,this.assert.caller):String.format(Sys.Res.assertFailed,a);if(confirm(String.format(Sys.Res.breakIntoDebugger,a)))this.fail(a)}},clearTrace:function(){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value=""},fail:function(message){this._appendConsole(message);if(Sys.Browser.hasDebuggerStatement)eval("debugger")},trace:function(a){this._appendConsole(a);this._appendTrace(a)},traceDump:function(a,b){var c=this._traceDump(a,b,true)},_traceDump:function(a,c,f,b,d){c=c?c:"traceDump";b=b?b:"";if(a===null){this.trace(b+c+": null");return}switch(typeof a){case "undefined":this.trace(b+c+": Undefined");break;case "number":case "string":case "boolean":this.trace(b+c+": "+a);break;default:if(Date.isInstanceOfType(a)||RegExp.isInstanceOfType(a)){this.trace(b+c+": "+a.toString());break}if(!d)d=[];else if(Array.contains(d,a)){this.trace(b+c+": ...");return}Array.add(d,a);if(a==window||a===document||window.HTMLElement&&a instanceof HTMLElement||typeof a.nodeName==="string"){var k=a.tagName?a.tagName:"DomElement";if(a.id)k+=" - "+a.id;this.trace(b+c+" {"+k+"}")}else{var i=Object.getTypeName(a);this.trace(b+c+(typeof i==="string"?" {"+i+"}":""));if(b===""||f){b+=" ";var e,j,l,g,h;if(Array.isInstanceOfType(a)){j=a.length;for(e=0;e<j;e++)this._traceDump(a[e],"["+e+"]",f,b,d)}else for(g in a){h=a[g];if(!Function.isInstanceOfType(h))this._traceDump(h,g,f,b,d)}}}Array.remove(d,a)}}};Sys._Debug.registerClass("Sys._Debug");Sys.Debug=new Sys._Debug;Sys.Debug.isDebug=false;function Sys$Enum$parse(c,e){var a,b,i;if(e){a=this.__lowerCaseValues;if(!a){this.__lowerCaseValues=a={};var g=this.prototype;for(var f in g)a[f.toLowerCase()]=g[f]}}else a=this.prototype;if(!this.__flags){i=e?c.toLowerCase():c;b=a[i.trim()];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c,this.__typeName));return b}else{var h=(e?c.toLowerCase():c).split(","),j=0;for(var d=h.length-1;d>=0;d--){var k=h[d].trim();b=a[k];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c.split(",")[d].trim(),this.__typeName));j|=b}return j}}function Sys$Enum$toString(c){if(typeof c==="undefined"||c===null)return this.__string;var d=this.prototype,a;if(!this.__flags||c===0){for(a in d)if(d[a]===c)return a}else{var b=this.__sortedValues;if(!b){b=[];for(a in d)b[b.length]={key:a,value:d[a]};b.sort(function(a,b){return a.value-b.value});this.__sortedValues=b}var e=[],g=c;for(a=b.length-1;a>=0;a--){var h=b[a],f=h.value;if(f===0)continue;if((f&c)===f){e[e.length]=h.key;g-=f;if(g===0)break}}if(e.length&&g===0)return e.reverse().join(", ")}return ""}Type.prototype.registerEnum=function(b,c){Sys.__upperCaseTypes[b.toUpperCase()]=this;for(var a in this.prototype)this[a]=this.prototype[a];this.__typeName=b;this.parse=Sys$Enum$parse;this.__string=this.toString();this.toString=Sys$Enum$toString;this.__flags=c;this.__enum=true};Type.isEnum=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__enum};Type.isFlags=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__flags};Sys.EventHandlerList=function(){this._list={}};Sys.EventHandlerList.prototype={addHandler:function(b,a){Array.add(this._getEvent(b,true),a)},removeHandler:function(c,b){var a=this._getEvent(c);if(!a)return;Array.remove(a,b)},getHandler:function(b){var a=this._getEvent(b);if(!a||a.length===0)return null;a=Array.clone(a);return function(c,d){for(var b=0,e=a.length;b<e;b++)a[b](c,d)}},_getEvent:function(a,b){if(!this._list[a]){if(!b)return null;this._list[a]=[]}return this._list[a]}};Sys.EventHandlerList.registerClass("Sys.EventHandlerList");Sys.EventArgs=function(){};Sys.EventArgs.registerClass("Sys.EventArgs");Sys.EventArgs.Empty=new Sys.EventArgs;Sys.CancelEventArgs=function(){Sys.CancelEventArgs.initializeBase(this);this._cancel=false};Sys.CancelEventArgs.prototype={get_cancel:function(){return this._cancel},set_cancel:function(a){this._cancel=a}};Sys.CancelEventArgs.registerClass("Sys.CancelEventArgs",Sys.EventArgs);Sys.INotifyPropertyChange=function(){};Sys.INotifyPropertyChange.prototype={};Sys.INotifyPropertyChange.registerInterface("Sys.INotifyPropertyChange");Sys.PropertyChangedEventArgs=function(a){Sys.PropertyChangedEventArgs.initializeBase(this);this._propertyName=a};Sys.PropertyChangedEventArgs.prototype={get_propertyName:function(){return this._propertyName}};Sys.PropertyChangedEventArgs.registerClass("Sys.PropertyChangedEventArgs",Sys.EventArgs);Sys.INotifyDisposing=function(){};Sys.INotifyDisposing.prototype={};Sys.INotifyDisposing.registerInterface("Sys.INotifyDisposing");Sys.Component=function(){if(Sys.Application)Sys.Application.registerDisposableObject(this)};Sys.Component.prototype={_id:null,_initialized:false,_updating:false,get_events:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_id:function(){return this._id},set_id:function(a){this._id=a},get_isInitialized:function(){return this._initialized},get_isUpdating:function(){return this._updating},add_disposing:function(a){this.get_events().addHandler("disposing",a)},remove_disposing:function(a){this.get_events().removeHandler("disposing",a)},add_propertyChanged:function(a){this.get_events().addHandler("propertyChanged",a)},remove_propertyChanged:function(a){this.get_events().removeHandler("propertyChanged",a)},beginUpdate:function(){this._updating=true},dispose:function(){if(this._events){var a=this._events.getHandler("disposing");if(a)a(this,Sys.EventArgs.Empty)}delete this._events;Sys.Application.unregisterDisposableObject(this);Sys.Application.removeComponent(this)},endUpdate:function(){this._updating=false;if(!this._initialized)this.initialize();this.updated()},initialize:function(){this._initialized=true},raisePropertyChanged:function(b){if(!this._events)return;var a=this._events.getHandler("propertyChanged");if(a)a(this,new Sys.PropertyChangedEventArgs(b))},updated:function(){}};Sys.Component.registerClass("Sys.Component",null,Sys.IDisposable,Sys.INotifyPropertyChange,Sys.INotifyDisposing);function Sys$Component$_setProperties(a,i){var d,j=Object.getType(a),e=j===Object||j===Sys.UI.DomElement,h=Sys.Component.isInstanceOfType(a)&&!a.get_isUpdating();if(h)a.beginUpdate();for(var c in i){var b=i[c],f=e?null:a["get_"+c];if(e||typeof f!=="function"){var k=a[c];if(!b||typeof b!=="object"||e&&!k)a[c]=b;else Sys$Component$_setProperties(k,b)}else{var l=a["set_"+c];if(typeof l==="function")l.apply(a,[b]);else if(b instanceof Array){d=f.apply(a);for(var g=0,m=d.length,n=b.length;g<n;g++,m++)d[m]=b[g]}else if(typeof b==="object"&&Object.getType(b)===Object){d=f.apply(a);Sys$Component$_setProperties(d,b)}}}if(h)a.endUpdate()}function Sys$Component$_setReferences(c,b){for(var a in b){var e=c["set_"+a],d=$find(b[a]);e.apply(c,[d])}}var $create=Sys.Component.create=function(h,f,d,c,g){var a=g?new h(g):new h,b=Sys.Application,i=b.get_isCreatingComponents();a.beginUpdate();if(f)Sys$Component$_setProperties(a,f);if(d)for(var e in d)a["add_"+e](d[e]);if(a.get_id())b.addComponent(a);if(i){b._createdComponents[b._createdComponents.length]=a;if(c)b._addComponentToSecondPass(a,c);else a.endUpdate()}else{if(c)Sys$Component$_setReferences(a,c);a.endUpdate()}return a};Sys.UI.MouseButton=function(){throw Error.notImplemented()};Sys.UI.MouseButton.prototype={leftButton:0,middleButton:1,rightButton:2};Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton");Sys.UI.Key=function(){throw Error.notImplemented()};Sys.UI.Key.prototype={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};Sys.UI.Key.registerEnum("Sys.UI.Key");Sys.UI.Point=function(a,b){this.x=a;this.y=b};Sys.UI.Point.registerClass("Sys.UI.Point");Sys.UI.Bounds=function(c,d,b,a){this.x=c;this.y=d;this.height=a;this.width=b};Sys.UI.Bounds.registerClass("Sys.UI.Bounds");Sys.UI.DomEvent=function(e){var a=e,b=this.type=a.type.toLowerCase();this.rawEvent=a;this.altKey=a.altKey;if(typeof a.button!=="undefined")this.button=typeof a.which!=="undefined"?a.button:a.button===4?Sys.UI.MouseButton.middleButton:a.button===2?Sys.UI.MouseButton.rightButton:Sys.UI.MouseButton.leftButton;if(b==="keypress")this.charCode=a.charCode||a.keyCode;else if(a.keyCode&&a.keyCode===46)this.keyCode=127;else this.keyCode=a.keyCode;this.clientX=a.clientX;this.clientY=a.clientY;this.ctrlKey=a.ctrlKey;this.target=a.target?a.target:a.srcElement;if(!b.startsWith("key"))if(typeof a.offsetX!=="undefined"&&typeof a.offsetY!=="undefined"){this.offsetX=a.offsetX;this.offsetY=a.offsetY}else if(this.target&&this.target.nodeType!==3&&typeof a.clientX==="number"){var c=Sys.UI.DomElement.getLocation(this.target),d=Sys.UI.DomElement._getWindow(this.target);this.offsetX=(d.pageXOffset||0)+a.clientX-c.x;this.offsetY=(d.pageYOffset||0)+a.clientY-c.y}this.screenX=a.screenX;this.screenY=a.screenY;this.shiftKey=a.shiftKey};Sys.UI.DomEvent.prototype={preventDefault:function(){if(this.rawEvent.preventDefault)this.rawEvent.preventDefault();else if(window.event)this.rawEvent.returnValue=false},stopPropagation:function(){if(this.rawEvent.stopPropagation)this.rawEvent.stopPropagation();else if(window.event)this.rawEvent.cancelBubble=true}};Sys.UI.DomEvent.registerClass("Sys.UI.DomEvent");var $addHandler=Sys.UI.DomEvent.addHandler=function(a,d,e){if(!a._events)a._events={};var c=a._events[d];if(!c)a._events[d]=c=[];var b;if(a.addEventListener){b=function(b){return e.call(a,new Sys.UI.DomEvent(b))};a.addEventListener(d,b,false)}else if(a.attachEvent){b=function(){var b={};try{b=Sys.UI.DomElement._getWindow(a).event}catch(c){}return e.call(a,new Sys.UI.DomEvent(b))};a.attachEvent("on"+d,b)}c[c.length]={handler:e,browserHandler:b}},$addHandlers=Sys.UI.DomEvent.addHandlers=function(e,d,c){for(var b in d){var a=d[b];if(c)a=Function.createDelegate(c,a);$addHandler(e,b,a)}},$clearHandlers=Sys.UI.DomEvent.clearHandlers=function(a){if(a._events){var e=a._events;for(var b in e){var d=e[b];for(var c=d.length-1;c>=0;c--)$removeHandler(a,b,d[c].handler)}a._events=null}},$removeHandler=Sys.UI.DomEvent.removeHandler=function(a,e,f){var d=null,c=a._events[e];for(var b=0,g=c.length;b<g;b++)if(c[b].handler===f){d=c[b].browserHandler;break}if(a.removeEventListener)a.removeEventListener(e,d,false);else if(a.detachEvent)a.detachEvent("on"+e,d);c.splice(b,1)};Sys.UI.DomElement=function(){};Sys.UI.DomElement.registerClass("Sys.UI.DomElement");Sys.UI.DomElement.addCssClass=function(a,b){if(!Sys.UI.DomElement.containsCssClass(a,b))if(a.className==="")a.className=b;else a.className+=" "+b};Sys.UI.DomElement.containsCssClass=function(b,a){return Array.contains(b.className.split(" "),a)};Sys.UI.DomElement.getBounds=function(a){var b=Sys.UI.DomElement.getLocation(a);return new Sys.UI.Bounds(b.x,b.y,a.offsetWidth||0,a.offsetHeight||0)};var $get=Sys.UI.DomElement.getElementById=function(f,e){if(!e)return document.getElementById(f);if(e.getElementById)return e.getElementById(f);var c=[],d=e.childNodes;for(var b=0;b<d.length;b++){var a=d[b];if(a.nodeType==1)c[c.length]=a}while(c.length){a=c.shift();if(a.id==f)return a;d=a.childNodes;for(b=0;b<d.length;b++){a=d[b];if(a.nodeType==1)c[c.length]=a}}return null};switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:Sys.UI.DomElement.getLocation=function(a){if(a.self||a.nodeType===9)return new Sys.UI.Point(0,0);var b=a.getBoundingClientRect();if(!b)return new Sys.UI.Point(0,0);var d=a.ownerDocument.documentElement,e=b.left-2+d.scrollLeft,f=b.top-2+d.scrollTop;try{var c=a.ownerDocument.parentWindow.frameElement||null;if(c){var g=c.frameBorder==="0"||c.frameBorder==="no"?2:0;e+=g;f+=g}}catch(h){}return new Sys.UI.Point(e,f)};break;case Sys.Browser.Safari:Sys.UI.DomElement.getLocation=function(c){if(c.window&&c.window===c||c.nodeType===9)return new Sys.UI.Point(0,0);var f=0,g=0,j=null,e=null,b;for(var a=c;a;j=a,(e=b,a=a.offsetParent)){b=Sys.UI.DomElement._getCurrentStyle(a);var d=a.tagName?a.tagName.toUpperCase():null;if((a.offsetLeft||a.offsetTop)&&(d!=="BODY"||(!e||e.position!=="absolute"))){f+=a.offsetLeft;g+=a.offsetTop}}b=Sys.UI.DomElement._getCurrentStyle(c);var h=b?b.position:null;if(!h||h!=="absolute")for(var a=c.parentNode;a;a=a.parentNode){d=a.tagName?a.tagName.toUpperCase():null;if(d!=="BODY"&&d!=="HTML"&&(a.scrollLeft||a.scrollTop)){f-=a.scrollLeft||0;g-=a.scrollTop||0}b=Sys.UI.DomElement._getCurrentStyle(a);var i=b?b.position:null;if(i&&i==="absolute")break}return new Sys.UI.Point(f,g)};break;case Sys.Browser.Opera:Sys.UI.DomElement.getLocation=function(b){if(b.window&&b.window===b||b.nodeType===9)return new Sys.UI.Point(0,0);var d=0,e=0,i=null;for(var a=b;a;i=a,a=a.offsetParent){var f=a.tagName;d+=a.offsetLeft||0;e+=a.offsetTop||0}var g=b.style.position,c=g&&g!=="static";for(var a=b.parentNode;a;a=a.parentNode){f=a.tagName?a.tagName.toUpperCase():null;if(f!=="BODY"&&f!=="HTML"&&(a.scrollLeft||a.scrollTop)&&(c&&(a.style.overflow==="scroll"||a.style.overflow==="auto"))){d-=a.scrollLeft||0;e-=a.scrollTop||0}var h=a&&a.style?a.style.position:null;c=c||h&&h!=="static"}return new Sys.UI.Point(d,e)};break;default:Sys.UI.DomElement.getLocation=function(d){if(d.window&&d.window===d||d.nodeType===9)return new Sys.UI.Point(0,0);var e=0,f=0,i=null,g=null,b=null;for(var a=d;a;i=a,(g=b,a=a.offsetParent)){var c=a.tagName?a.tagName.toUpperCase():null;b=Sys.UI.DomElement._getCurrentStyle(a);if((a.offsetLeft||a.offsetTop)&&!(c==="BODY"&&(!g||g.position!=="absolute"))){e+=a.offsetLeft;f+=a.offsetTop}if(i!==null&&b){if(c!=="TABLE"&&c!=="TD"&&c!=="HTML"){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}if(c==="TABLE"&&(b.position==="relative"||b.position==="absolute")){e+=parseInt(b.marginLeft)||0;f+=parseInt(b.marginTop)||0}}}b=Sys.UI.DomElement._getCurrentStyle(d);var h=b?b.position:null;if(!h||h!=="absolute")for(var a=d.parentNode;a;a=a.parentNode){c=a.tagName?a.tagName.toUpperCase():null;if(c!=="BODY"&&c!=="HTML"&&(a.scrollLeft||a.scrollTop)){e-=a.scrollLeft||0;f-=a.scrollTop||0;b=Sys.UI.DomElement._getCurrentStyle(a);if(b){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}}}return new Sys.UI.Point(e,f)}}Sys.UI.DomElement.removeCssClass=function(d,c){var a=" "+d.className+" ",b=a.indexOf(" "+c+" ");if(b>=0)d.className=(a.substr(0,b)+" "+a.substring(b+c.length+1,a.length)).trim()};Sys.UI.DomElement.setLocation=function(b,c,d){var a=b.style;a.position="absolute";a.left=c+"px";a.top=d+"px"};Sys.UI.DomElement.toggleCssClass=function(b,a){if(Sys.UI.DomElement.containsCssClass(b,a))Sys.UI.DomElement.removeCssClass(b,a);else Sys.UI.DomElement.addCssClass(b,a)};Sys.UI.DomElement.getVisibilityMode=function(a){return a._visibilityMode===Sys.UI.VisibilityMode.hide?Sys.UI.VisibilityMode.hide:Sys.UI.VisibilityMode.collapse};Sys.UI.DomElement.setVisibilityMode=function(a,b){Sys.UI.DomElement._ensureOldDisplayMode(a);if(a._visibilityMode!==b){a._visibilityMode=b;if(Sys.UI.DomElement.getVisible(a)===false)if(a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none";a._visibilityMode=b}};Sys.UI.DomElement.getVisible=function(b){var a=b.currentStyle||Sys.UI.DomElement._getCurrentStyle(b);if(!a)return true;return a.visibility!=="hidden"&&a.display!=="none"};Sys.UI.DomElement.setVisible=function(a,b){if(b!==Sys.UI.DomElement.getVisible(a)){Sys.UI.DomElement._ensureOldDisplayMode(a);a.style.visibility=b?"visible":"hidden";if(b||a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none"}};Sys.UI.DomElement._ensureOldDisplayMode=function(a){if(!a._oldDisplayMode){var b=a.currentStyle||Sys.UI.DomElement._getCurrentStyle(a);a._oldDisplayMode=b?b.display:null;if(!a._oldDisplayMode||a._oldDisplayMode==="none")switch(a.tagName.toUpperCase()){case "DIV":case "P":case "ADDRESS":case "BLOCKQUOTE":case "BODY":case "COL":case "COLGROUP":case "DD":case "DL":case "DT":case "FIELDSET":case "FORM":case "H1":case "H2":case "H3":case "H4":case "H5":case "H6":case "HR":case "IFRAME":case "LEGEND":case "OL":case "PRE":case "TABLE":case "TD":case "TH":case "TR":case "UL":a._oldDisplayMode="block";break;case "LI":a._oldDisplayMode="list-item";break;default:a._oldDisplayMode="inline"}}};Sys.UI.DomElement._getWindow=function(a){var b=a.ownerDocument||a.document||a;return b.defaultView||b.parentWindow};Sys.UI.DomElement._getCurrentStyle=function(a){if(a.nodeType===3)return null;var c=Sys.UI.DomElement._getWindow(a);if(a.documentElement)a=a.documentElement;var b=c&&a!==c&&c.getComputedStyle?c.getComputedStyle(a,null):a.currentStyle||a.style;if(!b&&Sys.Browser.agent===Sys.Browser.Safari&&a.style){var g=a.style.display,f=a.style.position;a.style.position="absolute";a.style.display="block";var e=c.getComputedStyle(a,null);a.style.display=g;a.style.position=f;b={};for(var d in e)b[d]=e[d];b.display="none"}return b};Sys.IContainer=function(){};Sys.IContainer.prototype={};Sys.IContainer.registerInterface("Sys.IContainer");Sys._ScriptLoader=function(){this._scriptsToLoad=null;this._sessions=[];this._scriptLoadedDelegate=Function.createDelegate(this,this._scriptLoadedHandler)};Sys._ScriptLoader.prototype={dispose:function(){this._stopSession();this._loading=false;if(this._events)delete this._events;this._sessions=null;this._currentSession=null;this._scriptLoadedDelegate=null},loadScripts:function(d,b,c,a){var e={allScriptsLoadedCallback:b,scriptLoadFailedCallback:c,scriptLoadTimeoutCallback:a,scriptsToLoad:this._scriptsToLoad,scriptTimeout:d};this._scriptsToLoad=null;this._sessions[this._sessions.length]=e;if(!this._loading)this._nextSession()},notifyScriptLoaded:function(){if(!this._loading)return;this._currentTask._notified++;if(Sys.Browser.agent===Sys.Browser.Safari)if(this._currentTask._notified===1)window.setTimeout(Function.createDelegate(this,function(){this._scriptLoadedHandler(this._currentTask.get_scriptElement(),true)}),0)},queueCustomScriptTag:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,a)},queueScriptBlock:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,{text:a})},queueScriptReference:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,{src:a})},_createScriptElement:function(c){var a=document.createElement("script");a.type="text/javascript";for(var b in c)a[b]=c[b];return a},_loadScriptsInternal:function(){var b=this._currentSession;if(b.scriptsToLoad&&b.scriptsToLoad.length>0){var c=Array.dequeue(b.scriptsToLoad),a=this._createScriptElement(c);if(a.text&&Sys.Browser.agent===Sys.Browser.Safari){a.innerHTML=a.text;delete a.text}if(typeof c.src==="string"){this._currentTask=new Sys._ScriptLoaderTask(a,this._scriptLoadedDelegate);this._currentTask.execute()}else{document.getElementsByTagName("head")[0].appendChild(a);Sys._ScriptLoader._clearScript(a);this._loadScriptsInternal()}}else{this._stopSession();var d=b.allScriptsLoadedCallback;if(d)d(this);this._nextSession()}},_nextSession:function(){if(this._sessions.length===0){this._loading=false;this._currentSession=null;return}this._loading=true;var a=Array.dequeue(this._sessions);this._currentSession=a;if(a.scriptTimeout>0)this._timeoutCookie=window.setTimeout(Function.createDelegate(this,this._scriptLoadTimeoutHandler),a.scriptTimeout*1000);this._loadScriptsInternal()},_raiseError:function(a){var c=this._currentSession.scriptLoadFailedCallback,b=this._currentTask.get_scriptElement();this._stopSession();if(c){c(this,b,a);this._nextSession()}else{this._loading=false;throw Sys._ScriptLoader._errorScriptLoadFailed(b.src,a)}},_scriptLoadedHandler:function(a,b){if(b&&this._currentTask._notified)if(this._currentTask._notified>1)this._raiseError(true);else{Array.add(Sys._ScriptLoader._getLoadedScripts(),a.src);this._currentTask.dispose();this._currentTask=null;this._loadScriptsInternal()}else this._raiseError(false)},_scriptLoadTimeoutHandler:function(){var a=this._currentSession.scriptLoadTimeoutCallback;this._stopSession();if(a)a(this);this._nextSession()},_stopSession:function(){if(this._timeoutCookie){window.clearTimeout(this._timeoutCookie);this._timeoutCookie=null}if(this._currentTask){this._currentTask.dispose();this._currentTask=null}}};Sys._ScriptLoader.registerClass("Sys._ScriptLoader",null,Sys.IDisposable);Sys._ScriptLoader.getInstance=function(){var a=Sys._ScriptLoader._activeInstance;if(!a)a=Sys._ScriptLoader._activeInstance=new Sys._ScriptLoader;return a};Sys._ScriptLoader.isScriptLoaded=function(b){var a=document.createElement("script");a.src=b;return Array.contains(Sys._ScriptLoader._getLoadedScripts(),a.src)};Sys._ScriptLoader.readLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){var b=Sys._ScriptLoader._referencedScripts=[],c=document.getElementsByTagName("script");for(i=c.length-1;i>=0;i--){var d=c[i],a=d.src;if(a.length)if(!Array.contains(b,a))Array.add(b,a)}}};Sys._ScriptLoader._clearScript=function(a){if(!Sys.Debug.isDebug)a.parentNode.removeChild(a)};Sys._ScriptLoader._errorScriptLoadFailed=function(b,d){var a;if(d)a=Sys.Res.scriptLoadMultipleCallbacks;else a=Sys.Res.scriptLoadFailed;var e="Sys.ScriptLoadFailedException: "+String.format(a,b),c=Error.create(e,{name:"Sys.ScriptLoadFailedException","scriptUrl":b});c.popStackFrame();return c};Sys._ScriptLoader._getLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){Sys._ScriptLoader._referencedScripts=[];Sys._ScriptLoader.readLoadedScripts()}return Sys._ScriptLoader._referencedScripts};Sys._ScriptLoaderTask=function(b,a){this._scriptElement=b;this._completedCallback=a;this._notified=0};Sys._ScriptLoaderTask.prototype={get_scriptElement:function(){return this._scriptElement},dispose:function(){if(this._disposed)return;this._disposed=true;this._removeScriptElementHandlers();Sys._ScriptLoader._clearScript(this._scriptElement);this._scriptElement=null},execute:function(){this._addScriptElementHandlers();document.getElementsByTagName("head")[0].appendChild(this._scriptElement)},_addScriptElementHandlers:function(){this._scriptLoadDelegate=Function.createDelegate(this,this._scriptLoadHandler);if(Sys.Browser.agent!==Sys.Browser.InternetExplorer){this._scriptElement.readyState="loaded";$addHandler(this._scriptElement,"load",this._scriptLoadDelegate)}else $addHandler(this._scriptElement,"readystatechange",this._scriptLoadDelegate);if(this._scriptElement.addEventListener){this._scriptErrorDelegate=Function.createDelegate(this,this._scriptErrorHandler);this._scriptElement.addEventListener("error",this._scriptErrorDelegate,false)}},_removeScriptElementHandlers:function(){if(this._scriptLoadDelegate){var a=this.get_scriptElement();if(Sys.Browser.agent!==Sys.Browser.InternetExplorer)$removeHandler(a,"load",this._scriptLoadDelegate);else $removeHandler(a,"readystatechange",this._scriptLoadDelegate);if(this._scriptErrorDelegate){this._scriptElement.removeEventListener("error",this._scriptErrorDelegate,false);this._scriptErrorDelegate=null}this._scriptLoadDelegate=null}},_scriptErrorHandler:function(){if(this._disposed)return;this._completedCallback(this.get_scriptElement(),false)},_scriptLoadHandler:function(){if(this._disposed)return;var a=this.get_scriptElement();if(a.readyState!=="loaded"&&a.readyState!=="complete")return;var b=this;window.setTimeout(function(){b._completedCallback(a,true)},0)}};Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask",null,Sys.IDisposable);Sys.ApplicationLoadEventArgs=function(b,a){Sys.ApplicationLoadEventArgs.initializeBase(this);this._components=b;this._isPartialLoad=a};Sys.ApplicationLoadEventArgs.prototype={get_components:function(){return this._components},get_isPartialLoad:function(){return this._isPartialLoad}};Sys.ApplicationLoadEventArgs.registerClass("Sys.ApplicationLoadEventArgs",Sys.EventArgs);Sys.HistoryEventArgs=function(a){Sys.HistoryEventArgs.initializeBase(this);this._state=a};Sys.HistoryEventArgs.prototype={get_state:function(){return this._state}};Sys.HistoryEventArgs.registerClass("Sys.HistoryEventArgs",Sys.EventArgs);Sys._Application=function(){Sys._Application.initializeBase(this);this._disposableObjects=[];this._components={};this._createdComponents=[];this._secondPassComponents=[];this._appLoadHandler=null;this._beginRequestHandler=null;this._clientId=null;this._currentEntry="";this._endRequestHandler=null;this._history=null;this._enableHistory=false;this._historyFrame=null;this._historyInitialized=false;this._historyInitialLength=0;this._historyLength=0;this._historyPointIsNew=false;this._ignoreTimer=false;this._initialState=null;this._state={};this._timerCookie=0;this._timerHandler=null;this._uniqueId=null;this._unloadHandlerDelegate=Function.createDelegate(this,this._unloadHandler);this._loadHandlerDelegate=Function.createDelegate(this,this._loadHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._unloadHandlerDelegate);Sys.UI.DomEvent.addHandler(window,"load",this._loadHandlerDelegate)};Sys._Application.prototype={_creatingComponents:false,_disposing:false,get_isCreatingComponents:function(){return this._creatingComponents},get_stateString:function(){var a=window.location.hash;if(this._isSafari2()){var b=this._getHistory();if(b)a=b[window.history.length-this._historyInitialLength]}if(a.length>0&&a.charAt(0)==="#")a=a.substring(1);if(Sys.Browser.agent===Sys.Browser.Firefox)a=this._serializeState(this._deserializeState(a,true));return a},get_enableHistory:function(){return this._enableHistory},set_enableHistory:function(a){this._enableHistory=a},add_init:function(a){if(this._initialized)a(this,Sys.EventArgs.Empty);else this.get_events().addHandler("init",a)},remove_init:function(a){this.get_events().removeHandler("init",a)},add_load:function(a){this.get_events().addHandler("load",a)},remove_load:function(a){this.get_events().removeHandler("load",a)},add_navigate:function(a){this.get_events().addHandler("navigate",a)},remove_navigate:function(a){this.get_events().removeHandler("navigate",a)},add_unload:function(a){this.get_events().addHandler("unload",a)},remove_unload:function(a){this.get_events().removeHandler("unload",a)},addComponent:function(a){this._components[a.get_id()]=a},addHistoryPoint:function(c,f){this._ensureHistory();var b=this._state;for(var a in c){var d=c[a];if(d===null){if(typeof b[a]!=="undefined")delete b[a]}else b[a]=d}var e=this._serializeState(b);this._historyPointIsNew=true;this._setState(e,f);this._raiseNavigate()},beginCreateComponents:function(){this._creatingComponents=true},dispose:function(){if(!this._disposing){this._disposing=true;if(this._timerCookie){window.clearTimeout(this._timerCookie);delete this._timerCookie}if(this._endRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);delete this._endRequestHandler}if(this._beginRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler);delete this._beginRequestHandler}if(window.pageUnload)window.pageUnload(this,Sys.EventArgs.Empty);var c=this.get_events().getHandler("unload");if(c)c(this,Sys.EventArgs.Empty);var b=Array.clone(this._disposableObjects);for(var a=0,e=b.length;a<e;a++)b[a].dispose();Array.clear(this._disposableObjects);Sys.UI.DomEvent.removeHandler(window,"unload",this._unloadHandlerDelegate);if(this._loadHandlerDelegate){Sys.UI.DomEvent.removeHandler(window,"load",this._loadHandlerDelegate);this._loadHandlerDelegate=null}var d=Sys._ScriptLoader.getInstance();if(d)d.dispose();Sys._Application.callBaseMethod(this,"dispose")}},endCreateComponents:function(){var b=this._secondPassComponents;for(var a=0,d=b.length;a<d;a++){var c=b[a].component;Sys$Component$_setReferences(c,b[a].references);c.endUpdate()}this._secondPassComponents=[];this._creatingComponents=false},findComponent:function(b,a){return a?Sys.IContainer.isInstanceOfType(a)?a.findComponent(b):a[b]||null:Sys.Application._components[b]||null},getComponents:function(){var a=[],b=this._components;for(var c in b)a[a.length]=b[c];return a},initialize:function(){if(!this._initialized&&!this._initializing){this._initializing=true;window.setTimeout(Function.createDelegate(this,this._doInitialize),0)}},notifyScriptLoaded:function(){var a=Sys._ScriptLoader.getInstance();if(a)a.notifyScriptLoaded()},registerDisposableObject:function(a){if(!this._disposing)this._disposableObjects[this._disposableObjects.length]=a},raiseLoad:function(){var b=this.get_events().getHandler("load"),a=new Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents),!this._initializing);if(b)b(this,a);if(window.pageLoad)window.pageLoad(this,a);this._createdComponents=[]},removeComponent:function(b){var a=b.get_id();if(a)delete this._components[a]},setServerId:function(a,b){this._clientId=a;this._uniqueId=b},setServerState:function(a){this._ensureHistory();this._state.__s=a;this._updateHiddenField(a)},unregisterDisposableObject:function(a){if(!this._disposing)Array.remove(this._disposableObjects,a)},_addComponentToSecondPass:function(b,a){this._secondPassComponents[this._secondPassComponents.length]={component:b,references:a}},_deserializeState:function(a,i){var e={};a=a||"";var b=a.indexOf("&&");if(b!==-1&&b+2<a.length){e.__s=a.substr(b+2);a=a.substr(0,b)}var g=a.split("&");for(var f=0,k=g.length;f<k;f++){var d=g[f],c=d.indexOf("=");if(c!==-1&&c+1<d.length){var j=d.substr(0,c),h=d.substr(c+1);e[j]=i?h:decodeURIComponent(h)}}return e},_doInitialize:function(){Sys._Application.callBaseMethod(this,"initialize");var b=this.get_events().getHandler("init");if(b){this.beginCreateComponents();b(this,Sys.EventArgs.Empty);this.endCreateComponents()}if(Sys.WebForms){this._beginRequestHandler=Function.createDelegate(this,this._onPageRequestManagerBeginRequest);Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._beginRequestHandler);this._endRequestHandler=Function.createDelegate(this,this._onPageRequestManagerEndRequest);Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler)}var a=this.get_stateString();if(a!==this._currentEntry)this._navigate(a);this.raiseLoad();this._initializing=false},_enableHistoryInScriptManager:function(){this._enableHistory=true},_ensureHistory:function(){if(!this._historyInitialized&&this._enableHistory){if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.documentMode<8){this._historyFrame=document.getElementById("__historyFrame");this._ignoreIFrame=true}if(this._isSafari2()){var a=document.getElementById("__history");this._setHistory([window.location.hash]);this._historyInitialLength=window.history.length}this._timerHandler=Function.createDelegate(this,this._onIdle);this._timerCookie=window.setTimeout(this._timerHandler,100);try{this._initialState=this._deserializeState(this.get_stateString())}catch(b){}this._historyInitialized=true}},_getHistory:function(){var a=document.getElementById("__history");if(!a)return "";var b=a.value;return b?Sys.Serialization.JavaScriptSerializer.deserialize(b,true):""},_isSafari2:function(){return Sys.Browser.agent===Sys.Browser.Safari&&Sys.Browser.version<=419.3},_loadHandler:function(){if(this._loadHandlerDelegate){Sys.UI.DomEvent.removeHandler(window,"load",this._loadHandlerDelegate);this._loadHandlerDelegate=null}this.initialize()},_navigate:function(c){this._ensureHistory();var b=this._deserializeState(c);if(this._uniqueId){var d=this._state.__s||"",a=b.__s||"";if(a!==d){this._updateHiddenField(a);__doPostBack(this._uniqueId,a);this._state=b;return}}this._setState(c);this._state=b;this._raiseNavigate()},_onIdle:function(){delete this._timerCookie;var a=this.get_stateString();if(a!==this._currentEntry){if(!this._ignoreTimer){this._historyPointIsNew=false;this._navigate(a);this._historyLength=window.history.length}}else this._ignoreTimer=false;this._timerCookie=window.setTimeout(this._timerHandler,100)},_onIFrameLoad:function(a){this._ensureHistory();if(!this._ignoreIFrame){this._historyPointIsNew=false;this._navigate(a)}this._ignoreIFrame=false},_onPageRequestManagerBeginRequest:function(){this._ignoreTimer=true},_onPageRequestManagerEndRequest:function(e,d){var b=d.get_dataItems()[this._clientId],a=document.getElementById("__EVENTTARGET");if(a&&a.value===this._uniqueId)a.value="";if(typeof b!=="undefined"){this.setServerState(b);this._historyPointIsNew=true}else this._ignoreTimer=false;var c=this._serializeState(this._state);if(c!==this._currentEntry){this._ignoreTimer=true;this._setState(c);this._raiseNavigate()}},_raiseNavigate:function(){var c=this.get_events().getHandler("navigate"),b={};for(var a in this._state)if(a!=="__s")b[a]=this._state[a];var d=new Sys.HistoryEventArgs(b);if(c)c(this,d)},_serializeState:function(d){var b=[];for(var a in d){var e=d[a];if(a==="__s")var c=e;else b[b.length]=a+"="+encodeURIComponent(e)}return b.join("&")+(c?"&&"+c:"")},_setHistory:function(b){var a=document.getElementById("__history");if(a)a.value=Sys.Serialization.JavaScriptSerializer.serialize(b)},_setState:function(a,c){a=a||"";if(a!==this._currentEntry){if(window.theForm){var e=window.theForm.action,f=e.indexOf("#");window.theForm.action=(f!==-1?e.substring(0,f):e)+"#"+a}if(this._historyFrame&&this._historyPointIsNew){this._ignoreIFrame=true;this._historyPointIsNew=false;var d=this._historyFrame.contentWindow.document;d.open("javascript:'<html></html>'");d.write("<html><head><title>"+(c||document.title)+"</title><scri"+'pt type="text/javascript">parent.Sys.Application._onIFrameLoad(\''+a+"');</scri"+"pt></head><body></body></html>");d.close()}this._ignoreTimer=false;var h=this.get_stateString();this._currentEntry=a;if(a!==h){if(this._isSafari2()){var g=this._getHistory();g[window.history.length-this._historyInitialLength+1]=a;this._setHistory(g);this._historyLength=window.history.length+1;var b=document.createElement("form");b.method="get";b.action="#"+a;document.appendChild(b);b.submit();document.removeChild(b)}else window.location.hash=a;if(typeof c!=="undefined"&&c!==null)document.title=c}}},_unloadHandler:function(){this.dispose()},_updateHiddenField:function(b){if(this._clientId){var a=document.getElementById(this._clientId);if(a)a.value=b}}};Sys._Application.registerClass("Sys._Application",Sys.Component,Sys.IContainer);Sys.Application=new Sys._Application;var $find=Sys.Application.findComponent;Type.registerNamespace("Sys.Net");Sys.Net.WebRequestExecutor=function(){this._webRequest=null;this._resultObject=null};Sys.Net.WebRequestExecutor.prototype={get_webRequest:function(){return this._webRequest},_set_webRequest:function(a){this._webRequest=a},get_started:function(){throw Error.notImplemented()},get_responseAvailable:function(){throw Error.notImplemented()},get_timedOut:function(){throw Error.notImplemented()},get_aborted:function(){throw Error.notImplemented()},get_responseData:function(){throw Error.notImplemented()},get_statusCode:function(){throw Error.notImplemented()},get_statusText:function(){throw Error.notImplemented()},get_xml:function(){throw Error.notImplemented()},get_object:function(){if(!this._resultObject)this._resultObject=Sys.Serialization.JavaScriptSerializer.deserialize(this.get_responseData());return this._resultObject},executeRequest:function(){throw Error.notImplemented()},abort:function(){throw Error.notImplemented()},getResponseHeader:function(){throw Error.notImplemented()},getAllResponseHeaders:function(){throw Error.notImplemented()}};Sys.Net.WebRequestExecutor.registerClass("Sys.Net.WebRequestExecutor");Sys.Net.XMLDOM=function(d){if(!window.DOMParser){var c=["Msxml2.DOMDocument.3.0","Msxml2.DOMDocument"];for(var b=0,f=c.length;b<f;b++)try{var a=new ActiveXObject(c[b]);a.async=false;a.loadXML(d);a.setProperty("SelectionLanguage","XPath");return a}catch(g){}}else try{var e=new window.DOMParser;return e.parseFromString(d,"text/xml")}catch(g){}return null};Sys.Net.XMLHttpExecutor=function(){Sys.Net.XMLHttpExecutor.initializeBase(this);var a=this;this._xmlHttpRequest=null;this._webRequest=null;this._responseAvailable=false;this._timedOut=false;this._timer=null;this._aborted=false;this._started=false;this._onReadyStateChange=function(){if(a._xmlHttpRequest.readyState===4){try{if(typeof a._xmlHttpRequest.status==="undefined")return}catch(b){return}a._clearTimer();a._responseAvailable=true;try{a._webRequest.completed(Sys.EventArgs.Empty)}finally{if(a._xmlHttpRequest!=null){a._xmlHttpRequest.onreadystatechange=Function.emptyMethod;a._xmlHttpRequest=null}}}};this._clearTimer=function(){if(a._timer!=null){window.clearTimeout(a._timer);a._timer=null}};this._onTimeout=function(){if(!a._responseAvailable){a._clearTimer();a._timedOut=true;a._xmlHttpRequest.onreadystatechange=Function.emptyMethod;a._xmlHttpRequest.abort();a._webRequest.completed(Sys.EventArgs.Empty);a._xmlHttpRequest=null}}};Sys.Net.XMLHttpExecutor.prototype={get_timedOut:function(){return this._timedOut},get_started:function(){return this._started},get_responseAvailable:function(){return this._responseAvailable},get_aborted:function(){return this._aborted},executeRequest:function(){this._webRequest=this.get_webRequest();var c=this._webRequest.get_body(),a=this._webRequest.get_headers();this._xmlHttpRequest=new XMLHttpRequest;this._xmlHttpRequest.onreadystatechange=this._onReadyStateChange;var e=this._webRequest.get_httpVerb();this._xmlHttpRequest.open(e,this._webRequest.getResolvedUrl(),true);if(a)for(var b in a){var f=a[b];if(typeof f!=="function")this._xmlHttpRequest.setRequestHeader(b,f)}if(e.toLowerCase()==="post"){if(a===null||!a["Content-Type"])this._xmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");if(!c)c=""}var d=this._webRequest.get_timeout();if(d>0)this._timer=window.setTimeout(Function.createDelegate(this,this._onTimeout),d);this._xmlHttpRequest.send(c);this._started=true},getResponseHeader:function(b){var a;try{a=this._xmlHttpRequest.getResponseHeader(b)}catch(c){}if(!a)a="";return a},getAllResponseHeaders:function(){return this._xmlHttpRequest.getAllResponseHeaders()},get_responseData:function(){return this._xmlHttpRequest.responseText},get_statusCode:function(){var a=0;try{a=this._xmlHttpRequest.status}catch(b){}return a},get_statusText:function(){return this._xmlHttpRequest.statusText},get_xml:function(){var a=this._xmlHttpRequest.responseXML;if(!a||!a.documentElement){a=Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);if(!a||!a.documentElement)return null}else if(navigator.userAgent.indexOf("MSIE")!==-1)a.setProperty("SelectionLanguage","XPath");if(a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml"&&a.documentElement.tagName==="parsererror")return null;if(a.documentElement.firstChild&&a.documentElement.firstChild.tagName==="parsererror")return null;return a},abort:function(){if(this._aborted||this._responseAvailable||this._timedOut)return;this._aborted=true;this._clearTimer();if(this._xmlHttpRequest&&!this._responseAvailable){this._xmlHttpRequest.onreadystatechange=Function.emptyMethod;this._xmlHttpRequest.abort();this._xmlHttpRequest=null;this._webRequest.completed(Sys.EventArgs.Empty)}}};Sys.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor",Sys.Net.WebRequestExecutor);Sys.Net._WebRequestManager=function(){this._defaultTimeout=0;this._defaultExecutorType="Sys.Net.XMLHttpExecutor"};Sys.Net._WebRequestManager.prototype={add_invokingRequest:function(a){this._get_eventHandlerList().addHandler("invokingRequest",a)},remove_invokingRequest:function(a){this._get_eventHandlerList().removeHandler("invokingRequest",a)},add_completedRequest:function(a){this._get_eventHandlerList().addHandler("completedRequest",a)},remove_completedRequest:function(a){this._get_eventHandlerList().removeHandler("completedRequest",a)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_defaultTimeout:function(){return this._defaultTimeout},set_defaultTimeout:function(a){this._defaultTimeout=a},get_defaultExecutorType:function(){return this._defaultExecutorType},set_defaultExecutorType:function(a){this._defaultExecutorType=a},executeRequest:function(webRequest){var executor=webRequest.get_executor();if(!executor){var failed=false;try{var executorType=eval(this._defaultExecutorType);executor=new executorType}catch(a){failed=true}webRequest.set_executor(executor)}if(executor.get_aborted())return;var evArgs=new Sys.Net.NetworkRequestEventArgs(webRequest),handler=this._get_eventHandlerList().getHandler("invokingRequest");if(handler)handler(this,evArgs);if(!evArgs.get_cancel())executor.executeRequest()}};Sys.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");Sys.Net.WebRequestManager=new Sys.Net._WebRequestManager;Sys.Net.NetworkRequestEventArgs=function(a){Sys.Net.NetworkRequestEventArgs.initializeBase(this);this._webRequest=a};Sys.Net.NetworkRequestEventArgs.prototype={get_webRequest:function(){return this._webRequest}};Sys.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs",Sys.CancelEventArgs);Sys.Net.WebRequest=function(){this._url="";this._headers={};this._body=null;this._userContext=null;this._httpVerb=null;this._executor=null;this._invokeCalled=false;this._timeout=0};Sys.Net.WebRequest.prototype={add_completed:function(a){this._get_eventHandlerList().addHandler("completed",a)},remove_completed:function(a){this._get_eventHandlerList().removeHandler("completed",a)},completed:function(b){var a=Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");if(a)a(this._executor,b);a=this._get_eventHandlerList().getHandler("completed");if(a)a(this._executor,b)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_url:function(){return this._url},set_url:function(a){this._url=a},get_headers:function(){return this._headers},get_httpVerb:function(){if(this._httpVerb===null){if(this._body===null)return "GET";return "POST"}return this._httpVerb},set_httpVerb:function(a){this._httpVerb=a},get_body:function(){return this._body},set_body:function(a){this._body=a},get_userContext:function(){return this._userContext},set_userContext:function(a){this._userContext=a},get_executor:function(){return this._executor},set_executor:function(a){this._executor=a;this._executor._set_webRequest(this)},get_timeout:function(){if(this._timeout===0)return Sys.Net.WebRequestManager.get_defaultTimeout();return this._timeout},set_timeout:function(a){this._timeout=a},getResolvedUrl:function(){return Sys.Net.WebRequest._resolveUrl(this._url)},invoke:function(){Sys.Net.WebRequestManager.executeRequest(this);this._invokeCalled=true}};Sys.Net.WebRequest._resolveUrl=function(b,a){if(b&&b.indexOf("://")!==-1)return b;if(!a||a.length===0){var d=document.getElementsByTagName("base")[0];if(d&&d.href&&d.href.length>0)a=d.href;else a=document.URL}var c=a.indexOf("?");if(c!==-1)a=a.substr(0,c);c=a.indexOf("#");if(c!==-1)a=a.substr(0,c);a=a.substr(0,a.lastIndexOf("/")+1);if(!b||b.length===0)return a;if(b.charAt(0)==="/"){var e=a.indexOf("://"),g=a.indexOf("/",e+3);return a.substr(0,g)+b}else{var f=a.lastIndexOf("/");return a.substr(0,f+1)+b}};Sys.Net.WebRequest._createQueryString=function(d,b){if(!b)b=encodeURIComponent;var a=new Sys.StringBuilder,f=0;for(var c in d){var e=d[c];if(typeof e==="function")continue;var g=Sys.Serialization.JavaScriptSerializer.serialize(e);if(f!==0)a.append("&");a.append(c);a.append("=");a.append(b(g));f++}return a.toString()};Sys.Net.WebRequest._createUrl=function(a,b){if(!b)return a;var d=Sys.Net.WebRequest._createQueryString(b);if(d.length>0){var c="?";if(a&&a.indexOf("?")!==-1)c="&";return a+c+d}else return a};Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");Sys.Net.WebServiceProxy=function(){};Sys.Net.WebServiceProxy.prototype={get_timeout:function(){return this._timeout},set_timeout:function(a){if(a<0)throw Error.argumentOutOfRange("value",a,Sys.Res.invalidTimeout);this._timeout=a},get_defaultUserContext:function(){return this._userContext},set_defaultUserContext:function(a){this._userContext=a},get_defaultSucceededCallback:function(){return this._succeeded},set_defaultSucceededCallback:function(a){this._succeeded=a},get_defaultFailedCallback:function(){return this._failed},set_defaultFailedCallback:function(a){this._failed=a},get_path:function(){return this._path},set_path:function(a){this._path=a},_invoke:function(d,e,g,f,c,b,a){if(c===null||typeof c==="undefined")c=this.get_defaultSucceededCallback();if(b===null||typeof b==="undefined")b=this.get_defaultFailedCallback();if(a===null||typeof a==="undefined")a=this.get_defaultUserContext();return Sys.Net.WebServiceProxy.invoke(d,e,g,f,c,b,a,this.get_timeout())}};Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");Sys.Net.WebServiceProxy.invoke=function(k,a,j,d,i,c,f,h){var b=new Sys.Net.WebRequest;b.get_headers()["Content-Type"]="application/json; charset=utf-8";if(!d)d={};var g=d;if(!j||!g)g={};b.set_url(Sys.Net.WebRequest._createUrl(k+"/"+encodeURIComponent(a),g));var e=null;if(!j){e=Sys.Serialization.JavaScriptSerializer.serialize(d);if(e==="{}")e=""}b.set_body(e);b.add_completed(l);if(h&&h>0)b.set_timeout(h);b.invoke();function l(d){if(d.get_responseAvailable()){var g=d.get_statusCode(),b=null;try{var e=d.getResponseHeader("Content-Type");if(e.startsWith("application/json"))b=d.get_object();else if(e.startsWith("text/xml"))b=d.get_xml();else b=d.get_responseData()}catch(m){}var k=d.getResponseHeader("jsonerror"),h=k==="true";if(h){if(b)b=new Sys.Net.WebServiceError(false,b.Message,b.StackTrace,b.ExceptionType)}else if(e.startsWith("application/json"))b=b.d;if(g<200||g>=300||h){if(c){if(!b||!h)b=new Sys.Net.WebServiceError(false,String.format(Sys.Res.webServiceFailedNoMsg,a),"","");b._statusCode=g;c(b,f,a)}}else if(i)i(b,f,a)}else{var j;if(d.get_timedOut())j=String.format(Sys.Res.webServiceTimedOut,a);else j=String.format(Sys.Res.webServiceFailedNoMsg,a);if(c)c(new Sys.Net.WebServiceError(d.get_timedOut(),j,"",""),f,a)}}return b};Sys.Net.WebServiceProxy._generateTypedConstructor=function(a){return function(b){if(b)for(var c in b)this[c]=b[c];this.__type=a}};Sys.Net.WebServiceError=function(c,d,b,a){this._timedOut=c;this._message=d;this._stackTrace=b;this._exceptionType=a;this._statusCode=-1};Sys.Net.WebServiceError.prototype={get_timedOut:function(){return this._timedOut},get_statusCode:function(){return this._statusCode},get_message:function(){return this._message},get_stackTrace:function(){return this._stackTrace},get_exceptionType:function(){return this._exceptionType}};Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError");Type.registerNamespace("Sys.Services");Sys.Services._ProfileService=function(){Sys.Services._ProfileService.initializeBase(this);this.properties={}};Sys.Services._ProfileService.DefaultWebServicePath="";Sys.Services._ProfileService.prototype={_defaultLoadCompletedCallback:null,_defaultSaveCompletedCallback:null,_path:"",_timeout:0,get_defaultLoadCompletedCallback:function(){return this._defaultLoadCompletedCallback},set_defaultLoadCompletedCallback:function(a){this._defaultLoadCompletedCallback=a},get_defaultSaveCompletedCallback:function(){return this._defaultSaveCompletedCallback},set_defaultSaveCompletedCallback:function(a){this._defaultSaveCompletedCallback=a},get_path:function(){return this._path||""},load:function(c,d,e,f){var b,a;if(!c){a="GetAllPropertiesForCurrentUser";b={authenticatedUserOnly:false}}else{a="GetPropertiesForCurrentUser";b={properties:this._clonePropertyNames(c),authenticatedUserOnly:false}}this._invoke(this._get_path(),a,false,b,Function.createDelegate(this,this._onLoadComplete),Function.createDelegate(this,this._onLoadFailed),[d,e,f])},save:function(d,b,c,e){var a=this._flattenProperties(d,this.properties);this._invoke(this._get_path(),"SetPropertiesForCurrentUser",false,{values:a.value,authenticatedUserOnly:false},Function.createDelegate(this,this._onSaveComplete),Function.createDelegate(this,this._onSaveFailed),[b,c,e,a.count])},_clonePropertyNames:function(e){var c=[],d={};for(var b=0;b<e.length;b++){var a=e[b];if(!d[a]){Array.add(c,a);d[a]=true}}return c},_flattenProperties:function(a,i,j){var b={},e,d,g=0;if(a&&a.length===0)return {value:b,count:0};for(var c in i){e=i[c];d=j?j+"."+c:c;if(Sys.Services.ProfileGroup.isInstanceOfType(e)){var k=this._flattenProperties(a,e,d),h=k.value;g+=k.count;for(var f in h){var l=h[f];b[f]=l}}else if(!a||Array.indexOf(a,d)!==-1){b[d]=e;g++}}return {value:b,count:g}},_get_path:function(){var a=this.get_path();if(!a.length)a=Sys.Services._ProfileService.DefaultWebServicePath;if(!a||!a.length)throw Error.invalidOperation(Sys.Res.servicePathNotSet);return a},_onLoadComplete:function(a,e,g){if(typeof a!=="object")throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,g,"Object"));var c=this._unflattenProperties(a);for(var b in c)this.properties[b]=c[b];var d=e[0]||this.get_defaultLoadCompletedCallback()||this.get_defaultSucceededCallback();if(d){var f=e[2]||this.get_defaultUserContext();d(a.length,f,"Sys.Services.ProfileService.load")}},_onLoadFailed:function(d,b){var a=b[1]||this.get_defaultFailedCallback();if(a){var c=b[2]||this.get_defaultUserContext();a(d,c,"Sys.Services.ProfileService.load")}},_onSaveComplete:function(a,b,f){var c=b[3];if(a!==null)if(a instanceof Array)c-=a.length;else if(typeof a==="number")c=a;else throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,f,"Array"));var d=b[0]||this.get_defaultSaveCompletedCallback()||this.get_defaultSucceededCallback();if(d){var e=b[2]||this.get_defaultUserContext();d(c,e,"Sys.Services.ProfileService.save")}},_onSaveFailed:function(d,b){var a=b[1]||this.get_defaultFailedCallback();if(a){var c=b[2]||this.get_defaultUserContext();a(d,c,"Sys.Services.ProfileService.save")}},_unflattenProperties:function(e){var c={},d,f,h=0;for(var a in e){h++;f=e[a];d=a.indexOf(".");if(d!==-1){var g=a.substr(0,d);a=a.substr(d+1);var b=c[g];if(!b||!Sys.Services.ProfileGroup.isInstanceOfType(b)){b=new Sys.Services.ProfileGroup;c[g]=b}b[a]=f}else c[a]=f}e.length=h;return c}};Sys.Services._ProfileService.registerClass("Sys.Services._ProfileService",Sys.Net.WebServiceProxy);Sys.Services.ProfileService=new Sys.Services._ProfileService;Sys.Services.ProfileGroup=function(a){if(a)for(var b in a)this[b]=a[b]};Sys.Services.ProfileGroup.registerClass("Sys.Services.ProfileGroup");Sys.Services._AuthenticationService=function(){Sys.Services._AuthenticationService.initializeBase(this)};Sys.Services._AuthenticationService.DefaultWebServicePath="";Sys.Services._AuthenticationService.prototype={_defaultLoginCompletedCallback:null,_defaultLogoutCompletedCallback:null,_path:"",_timeout:0,_authenticated:false,get_defaultLoginCompletedCallback:function(){return this._defaultLoginCompletedCallback},set_defaultLoginCompletedCallback:function(a){this._defaultLoginCompletedCallback=a},get_defaultLogoutCompletedCallback:function(){return this._defaultLogoutCompletedCallback},set_defaultLogoutCompletedCallback:function(a){this._defaultLogoutCompletedCallback=a},get_isLoggedIn:function(){return this._authenticated},get_path:function(){return this._path||""},login:function(c,b,a,h,f,d,e,g){this._invoke(this._get_path(),"Login",false,{userName:c,password:b,createPersistentCookie:a},Function.createDelegate(this,this._onLoginComplete),Function.createDelegate(this,this._onLoginFailed),[c,b,a,h,f,d,e,g])},logout:function(c,a,b,d){this._invoke(this._get_path(),"Logout",false,{},Function.createDelegate(this,this._onLogoutComplete),Function.createDelegate(this,this._onLogoutFailed),[c,a,b,d])},_get_path:function(){var a=this.get_path();if(!a.length)a=Sys.Services._AuthenticationService.DefaultWebServicePath;if(!a||!a.length)throw Error.invalidOperation(Sys.Res.servicePathNotSet);return a},_onLoginComplete:function(e,c,f){if(typeof e!=="boolean")throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,f,"Boolean"));var b=c[4],d=c[7]||this.get_defaultUserContext(),a=c[5]||this.get_defaultLoginCompletedCallback()||this.get_defaultSucceededCallback();if(e){this._authenticated=true;if(a)a(true,d,"Sys.Services.AuthenticationService.login");if(typeof b!=="undefined"&&b!==null)window.location.href=b}else if(a)a(false,d,"Sys.Services.AuthenticationService.login")},_onLoginFailed:function(d,b){var a=b[6]||this.get_defaultFailedCallback();if(a){var c=b[7]||this.get_defaultUserContext();a(d,c,"Sys.Services.AuthenticationService.login")}},_onLogoutComplete:function(f,a,e){if(f!==null)throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,e,"null"));var b=a[0],d=a[3]||this.get_defaultUserContext(),c=a[1]||this.get_defaultLogoutCompletedCallback()||this.get_defaultSucceededCallback();this._authenticated=false;if(c)c(null,d,"Sys.Services.AuthenticationService.logout");if(!b)window.location.reload();else window.location.href=b},_onLogoutFailed:function(c,b){var a=b[2]||this.get_defaultFailedCallback();if(a)a(c,b[3],"Sys.Services.AuthenticationService.logout")},_setAuthenticated:function(a){this._authenticated=a}};Sys.Services._AuthenticationService.registerClass("Sys.Services._AuthenticationService",Sys.Net.WebServiceProxy);Sys.Services.AuthenticationService=new Sys.Services._AuthenticationService;Sys.Services._RoleService=function(){Sys.Services._RoleService.initializeBase(this);this._roles=[]};Sys.Services._RoleService.DefaultWebServicePath="";Sys.Services._RoleService.prototype={_defaultLoadCompletedCallback:null,_rolesIndex:null,_timeout:0,_path:"",get_defaultLoadCompletedCallback:function(){return this._defaultLoadCompletedCallback},set_defaultLoadCompletedCallback:function(a){this._defaultLoadCompletedCallback=a},get_path:function(){return this._path||""},get_roles:function(){return Array.clone(this._roles)},isUserInRole:function(a){var b=this._get_rolesIndex()[a.trim().toLowerCase()];return !!b},load:function(a,b,c){Sys.Net.WebServiceProxy.invoke(this._get_path(),"GetRolesForCurrentUser",false,{},Function.createDelegate(this,this._onLoadComplete),Function.createDelegate(this,this._onLoadFailed),[a,b,c],this.get_timeout())},_get_path:function(){var a=this.get_path();if(!a||!a.length)a=Sys.Services._RoleService.DefaultWebServicePath;if(!a||!a.length)throw Error.invalidOperation(Sys.Res.servicePathNotSet);return a},_get_rolesIndex:function(){if(!this._rolesIndex){var b={};for(var a=0;a<this._roles.length;a++)b[this._roles[a].toLowerCase()]=true;this._rolesIndex=b}return this._rolesIndex},_onLoadComplete:function(a,c,f){if(a&&!(a instanceof Array))throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,f,"Array"));this._roles=a;this._rolesIndex=null;var b=c[0]||this.get_defaultLoadCompletedCallback()||this.get_defaultSucceededCallback();if(b){var e=c[2]||this.get_defaultUserContext(),d=Array.clone(a);b(d,e,"Sys.Services.RoleService.load")}},_onLoadFailed:function(d,b){var a=b[1]||this.get_defaultFailedCallback();if(a){var c=b[2]||this.get_defaultUserContext();a(d,c,"Sys.Services.RoleService.load")}}};Sys.Services._RoleService.registerClass("Sys.Services._RoleService",Sys.Net.WebServiceProxy);Sys.Services.RoleService=new Sys.Services._RoleService;Type.registerNamespace("Sys.Serialization");Sys.Serialization.JavaScriptSerializer=function(){};Sys.Serialization.JavaScriptSerializer.registerClass("Sys.Serialization.JavaScriptSerializer");Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs=[];Sys.Serialization.JavaScriptSerializer._charsToEscape=[];Sys.Serialization.JavaScriptSerializer._dateRegEx=new RegExp('(^|[^\\\\])\\"\\\\/Date\\((-?[0-9]+)(?:[a-zA-Z]|(?:\\+|-)[0-9]{4})?\\)\\\\/\\"',"g");Sys.Serialization.JavaScriptSerializer._escapeChars={};Sys.Serialization.JavaScriptSerializer._escapeRegEx=new RegExp('["\\\\\\x00-\\x1F]',"i");Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal=new RegExp('["\\\\\\x00-\\x1F]',"g");Sys.Serialization.JavaScriptSerializer._jsonRegEx=new RegExp("[^,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]","g");Sys.Serialization.JavaScriptSerializer._jsonStringRegEx=new RegExp('"(\\\\.|[^"\\\\])*"',"g");Sys.Serialization.JavaScriptSerializer._serverTypeFieldName="__type";Sys.Serialization.JavaScriptSerializer._init=function(){var c=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000b","\\f","\\r","\\u000e","\\u000f","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001a","\\u001b","\\u001c","\\u001d","\\u001e","\\u001f"];Sys.Serialization.JavaScriptSerializer._charsToEscape[0]="\\";Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs["\\"]=new RegExp("\\\\","g");Sys.Serialization.JavaScriptSerializer._escapeChars["\\"]="\\\\";Sys.Serialization.JavaScriptSerializer._charsToEscape[1]='"';Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['"']=new RegExp('"',"g");Sys.Serialization.JavaScriptSerializer._escapeChars['"']='\\"';for(var a=0;a<32;a++){var b=String.fromCharCode(a);Sys.Serialization.JavaScriptSerializer._charsToEscape[a+2]=b;Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b]=new RegExp(b,"g");Sys.Serialization.JavaScriptSerializer._escapeChars[b]=c[a]}};Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder=function(b,a){a.append(b.toString())};Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder=function(a,b){if(isFinite(a))b.append(String(a));else throw Error.invalidOperation(Sys.Res.cannotSerializeNonFiniteNumbers)};Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder=function(a,c){c.append('"');if(Sys.Serialization.JavaScriptSerializer._escapeRegEx.test(a)){if(Sys.Serialization.JavaScriptSerializer._charsToEscape.length===0)Sys.Serialization.JavaScriptSerializer._init();if(a.length<128)a=a.replace(Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal,function(a){return Sys.Serialization.JavaScriptSerializer._escapeChars[a]});else for(var d=0;d<34;d++){var b=Sys.Serialization.JavaScriptSerializer._charsToEscape[d];if(a.indexOf(b)!==-1)if(Sys.Browser.agent===Sys.Browser.Opera||Sys.Browser.agent===Sys.Browser.FireFox)a=a.split(b).join(Sys.Serialization.JavaScriptSerializer._escapeChars[b]);else a=a.replace(Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b],Sys.Serialization.JavaScriptSerializer._escapeChars[b])}}c.append(a);c.append('"')};Sys.Serialization.JavaScriptSerializer._serializeWithBuilder=function(b,a,i,g){var c;switch(typeof b){case "object":if(b)if(Number.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b,a);else if(Boolean.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b,a);else if(String.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b,a);else if(Array.isInstanceOfType(b)){a.append("[");for(c=0;c<b.length;++c){if(c>0)a.append(",");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b[c],a,false,g)}a.append("]")}else{if(Date.isInstanceOfType(b)){a.append('"\\/Date(');a.append(b.getTime());a.append(')\\/"');break}var d=[],f=0;for(var e in b){if(e.startsWith("$"))continue;if(e===Sys.Serialization.JavaScriptSerializer._serverTypeFieldName&&f!==0){d[f++]=d[0];d[0]=e}else d[f++]=e}if(i)d.sort();a.append("{");var j=false;for(c=0;c<f;c++){var h=b[d[c]];if(typeof h!=="undefined"&&typeof h!=="function"){if(j)a.append(",");else j=true;Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(d[c],a,i,g);a.append(":");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(h,a,i,g)}}a.append("}")}else a.append("null");break;case "number":Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b,a);break;case "string":Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b,a);break;case "boolean":Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b,a);break;default:a.append("null")}};Sys.Serialization.JavaScriptSerializer.serialize=function(b){var a=new Sys.StringBuilder;Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b,a,false);return a.toString()};Sys.Serialization.JavaScriptSerializer.deserialize=function(data,secure){if(data.length===0)throw Error.argument("data",Sys.Res.cannotDeserializeEmptyString);try{var exp=data.replace(Sys.Serialization.JavaScriptSerializer._dateRegEx,"$1new Date($2)");if(secure&&Sys.Serialization.JavaScriptSerializer._jsonRegEx.test(exp.replace(Sys.Serialization.JavaScriptSerializer._jsonStringRegEx,"")))throw null;return eval("("+exp+")")}catch(a){throw Error.argument("data",Sys.Res.cannotDeserializeInvalidJson)}};Sys.CultureInfo=function(c,b,a){this.name=c;this.numberFormat=b;this.dateTimeFormat=a};Sys.CultureInfo.prototype={_getDateTimeFormats:function(){if(!this._dateTimeFormats){var a=this.dateTimeFormat;this._dateTimeFormats=[a.MonthDayPattern,a.YearMonthPattern,a.ShortDatePattern,a.ShortTimePattern,a.LongDatePattern,a.LongTimePattern,a.FullDateTimePattern,a.RFC1123Pattern,a.SortableDateTimePattern,a.UniversalSortableDateTimePattern]}return this._dateTimeFormats},_getMonthIndex:function(a){if(!this._upperMonths)this._upperMonths=this._toUpperArray(this.dateTimeFormat.MonthNames);return Array.indexOf(this._upperMonths,this._toUpper(a))},_getAbbrMonthIndex:function(a){if(!this._upperAbbrMonths)this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);return Array.indexOf(this._upperAbbrMonths,this._toUpper(a))},_getDayIndex:function(a){if(!this._upperDays)this._upperDays=this._toUpperArray(this.dateTimeFormat.DayNames);return Array.indexOf(this._upperDays,this._toUpper(a))},_getAbbrDayIndex:function(a){if(!this._upperAbbrDays)this._upperAbbrDays=this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);return Array.indexOf(this._upperAbbrDays,this._toUpper(a))},_toUpperArray:function(c){var b=[];for(var a=0,d=c.length;a<d;a++)b[a]=this._toUpper(c[a]);return b},_toUpper:function(a){return a.split("\u00a0").join(" ").toUpperCase()}};Sys.CultureInfo._parse=function(b){var a=Sys.Serialization.JavaScriptSerializer.deserialize(b);return new Sys.CultureInfo(a.name,a.numberFormat,a.dateTimeFormat)};Sys.CultureInfo.registerClass("Sys.CultureInfo");Sys.CultureInfo.InvariantCulture=Sys.CultureInfo._parse('{"name":"","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":true,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"\u00a4","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":true},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, dd MMMM yyyy HH:mm:ss","LongDatePattern":"dddd, dd MMMM yyyy","LongTimePattern":"HH:mm:ss","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"MM/dd/yyyy","ShortTimePattern":"HH:mm","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"yyyy MMMM","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":true,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]}}');if(typeof __cultureInfo==="undefined")var __cultureInfo='{"name":"en-US","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":false,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"$","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":false},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, MMMM dd, yyyy h:mm:ss tt","LongDatePattern":"dddd, MMMM dd, yyyy","LongTimePattern":"h:mm:ss tt","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"M/d/yyyy","ShortTimePattern":"h:mm tt","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"MMMM, yyyy","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":false,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]}}';Sys.CultureInfo.CurrentCulture=Sys.CultureInfo._parse(__cultureInfo);delete __cultureInfo;Sys.UI.Behavior=function(b){Sys.UI.Behavior.initializeBase(this);this._element=b;var a=b._behaviors;if(!a)b._behaviors=[this];else a[a.length]=this};Sys.UI.Behavior.prototype={_name:null,get_element:function(){return this._element},get_id:function(){var a=Sys.UI.Behavior.callBaseMethod(this,"get_id");if(a)return a;if(!this._element||!this._element.id)return "";return this._element.id+"$"+this.get_name()},get_name:function(){if(this._name)return this._name;var a=Object.getTypeName(this),b=a.lastIndexOf(".");if(b!=-1)a=a.substr(b+1);if(!this.get_isInitialized())this._name=a;return a},set_name:function(a){this._name=a},initialize:function(){Sys.UI.Behavior.callBaseMethod(this,"initialize");var a=this.get_name();if(a)this._element[a]=this},dispose:function(){Sys.UI.Behavior.callBaseMethod(this,"dispose");if(this._element){var a=this.get_name();if(a)this._element[a]=null;Array.remove(this._element._behaviors,this);delete this._element}}};Sys.UI.Behavior.registerClass("Sys.UI.Behavior",Sys.Component);Sys.UI.Behavior.getBehaviorByName=function(b,c){var a=b[c];return a&&Sys.UI.Behavior.isInstanceOfType(a)?a:null};Sys.UI.Behavior.getBehaviors=function(a){if(!a._behaviors)return [];return Array.clone(a._behaviors)};Sys.UI.Behavior.getBehaviorsByType=function(d,e){var a=d._behaviors,c=[];if(a)for(var b=0,f=a.length;b<f;b++)if(e.isInstanceOfType(a[b]))c[c.length]=a[b];return c};Sys.UI.VisibilityMode=function(){throw Error.notImplemented()};Sys.UI.VisibilityMode.prototype={hide:0,collapse:1};Sys.UI.VisibilityMode.registerEnum("Sys.UI.VisibilityMode");Sys.UI.Control=function(a){Sys.UI.Control.initializeBase(this);this._element=a;a.control=this};Sys.UI.Control.prototype={_parent:null,_visibilityMode:Sys.UI.VisibilityMode.hide,get_element:function(){return this._element},get_id:function(){if(!this._element)return "";return this._element.id},set_id:function(){throw Error.invalidOperation(Sys.Res.cantSetId)},get_parent:function(){if(this._parent)return this._parent;if(!this._element)return null;var a=this._element.parentNode;while(a){if(a.control)return a.control;a=a.parentNode}return null},set_parent:function(a){this._parent=a},get_visibilityMode:function(){return Sys.UI.DomElement.getVisibilityMode(this._element)},set_visibilityMode:function(a){Sys.UI.DomElement.setVisibilityMode(this._element,a)},get_visible:function(){return Sys.UI.DomElement.getVisible(this._element)},set_visible:function(a){Sys.UI.DomElement.setVisible(this._element,a)},addCssClass:function(a){Sys.UI.DomElement.addCssClass(this._element,a)},dispose:function(){Sys.UI.Control.callBaseMethod(this,"dispose");if(this._element){this._element.control=undefined;delete this._element}if(this._parent)delete this._parent},onBubbleEvent:function(){return false},raiseBubbleEvent:function(b,c){var a=this.get_parent();while(a){if(a.onBubbleEvent(b,c))return;a=a.get_parent()}},removeCssClass:function(a){Sys.UI.DomElement.removeCssClass(this._element,a)},toggleCssClass:function(a){Sys.UI.DomElement.toggleCssClass(this._element,a)}};Sys.UI.Control.registerClass("Sys.UI.Control",Sys.Component); -Type.registerNamespace('Sys');Sys.Res={'argumentInteger':'Value must be an integer.','scriptLoadMultipleCallbacks':'The script \'{0}\' contains multiple calls to Sys.Application.notifyScriptLoaded(). Only one is allowed.','invokeCalledTwice':'Cannot call invoke more than once.','webServiceFailed':'The server method \'{0}\' failed with the following error: {1}','webServiceInvalidJsonWrapper':'The server method \'{0}\' returned invalid data. The \'d\' property is missing from the JSON wrapper.','argumentType':'Object cannot be converted to the required type.','argumentNull':'Value cannot be null.','controlCantSetId':'The id property can\'t be set on a control.','formatBadFormatSpecifier':'Format specifier was invalid.','webServiceFailedNoMsg':'The server method \'{0}\' failed.','argumentDomElement':'Value must be a DOM element.','invalidExecutorType':'Could not create a valid Sys.Net.WebRequestExecutor from: {0}.','cannotCallBeforeResponse':'Cannot call {0} when responseAvailable is false.','actualValue':'Actual value was {0}.','enumInvalidValue':'\'{0}\' is not a valid value for enum {1}.','scriptLoadFailed':'The script \'{0}\' could not be loaded.','parameterCount':'Parameter count mismatch.','cannotDeserializeEmptyString':'Cannot deserialize empty string.','formatInvalidString':'Input string was not in a correct format.','invalidTimeout':'Value must be greater than or equal to zero.','cannotAbortBeforeStart':'Cannot abort when executor has not started.','argument':'Value does not fall within the expected range.','cannotDeserializeInvalidJson':'Cannot deserialize. The data does not correspond to valid JSON.','invalidHttpVerb':'httpVerb cannot be set to an empty or null string.','nullWebRequest':'Cannot call executeRequest with a null webRequest.','eventHandlerInvalid':'Handler was not added through the Sys.UI.DomEvent.addHandler method.','cannotSerializeNonFiniteNumbers':'Cannot serialize non finite numbers.','argumentUndefined':'Value cannot be undefined.','webServiceInvalidReturnType':'The server method \'{0}\' returned an invalid type. Expected type: {1}','servicePathNotSet':'The path to the web service has not been set.','argumentTypeWithTypes':'Object of type \'{0}\' cannot be converted to type \'{1}\'.','cannotCallOnceStarted':'Cannot call {0} once started.','badBaseUrl1':'Base URL does not contain ://.','badBaseUrl2':'Base URL does not contain another /.','badBaseUrl3':'Cannot find last / in base URL.','setExecutorAfterActive':'Cannot set executor after it has become active.','paramName':'Parameter name: {0}','cannotCallOutsideHandler':'Cannot call {0} outside of a completed event handler.','cannotSerializeObjectWithCycle':'Cannot serialize object with cyclic reference within child properties.','format':'One of the identified items was in an invalid format.','assertFailedCaller':'Assertion Failed: {0}\r\nat {1}','argumentOutOfRange':'Specified argument was out of the range of valid values.','webServiceTimedOut':'The server method \'{0}\' timed out.','notImplemented':'The method or operation is not implemented.','assertFailed':'Assertion Failed: {0}','invalidOperation':'Operation is not valid due to the current state of the object.','breakIntoDebugger':'{0}\r\n\r\nBreak into debugger?'}; -if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded(); diff --git a/projecttemplates/MvcRelyingParty/Scripts/MicrosoftMvcAjax.debug.js b/projecttemplates/MvcRelyingParty/Scripts/MicrosoftMvcAjax.debug.js deleted file mode 100644 index afd4566..0000000 --- a/projecttemplates/MvcRelyingParty/Scripts/MicrosoftMvcAjax.debug.js +++ /dev/null @@ -1,337 +0,0 @@ -//!---------------------------------------------------------- -//! Copyright (C) Microsoft Corporation. All rights reserved. -//!---------------------------------------------------------- -//! MicrosoftMvcAjax.js - -Type.registerNamespace('Sys.Mvc'); - -//////////////////////////////////////////////////////////////////////////////// -// Sys.Mvc.AjaxOptions - -Sys.Mvc.$create_AjaxOptions = function Sys_Mvc_AjaxOptions() { return {}; } - - -//////////////////////////////////////////////////////////////////////////////// -// Sys.Mvc.InsertionMode - -Sys.Mvc.InsertionMode = function() { - /// <field name="replace" type="Number" integer="true" static="true"> - /// </field> - /// <field name="insertBefore" type="Number" integer="true" static="true"> - /// </field> - /// <field name="insertAfter" type="Number" integer="true" static="true"> - /// </field> -}; -Sys.Mvc.InsertionMode.prototype = { - replace: 0, - insertBefore: 1, - insertAfter: 2 -} -Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode', false); - - -//////////////////////////////////////////////////////////////////////////////// -// Sys.Mvc.AjaxContext - -Sys.Mvc.AjaxContext = function Sys_Mvc_AjaxContext(request, updateTarget, loadingElement, insertionMode) { - /// <param name="request" type="Sys.Net.WebRequest"> - /// </param> - /// <param name="updateTarget" type="Object" domElement="true"> - /// </param> - /// <param name="loadingElement" type="Object" domElement="true"> - /// </param> - /// <param name="insertionMode" type="Sys.Mvc.InsertionMode"> - /// </param> - /// <field name="_insertionMode" type="Sys.Mvc.InsertionMode"> - /// </field> - /// <field name="_loadingElement" type="Object" domElement="true"> - /// </field> - /// <field name="_response" type="Sys.Net.WebRequestExecutor"> - /// </field> - /// <field name="_request" type="Sys.Net.WebRequest"> - /// </field> - /// <field name="_updateTarget" type="Object" domElement="true"> - /// </field> - this._request = request; - this._updateTarget = updateTarget; - this._loadingElement = loadingElement; - this._insertionMode = insertionMode; -} -Sys.Mvc.AjaxContext.prototype = { - _insertionMode: 0, - _loadingElement: null, - _response: null, - _request: null, - _updateTarget: null, - - get_data: function Sys_Mvc_AjaxContext$get_data() { - /// <value type="String"></value> - if (this._response) { - return this._response.get_responseData(); - } - else { - return null; - } - }, - - get_insertionMode: function Sys_Mvc_AjaxContext$get_insertionMode() { - /// <value type="Sys.Mvc.InsertionMode"></value> - return this._insertionMode; - }, - - get_loadingElement: function Sys_Mvc_AjaxContext$get_loadingElement() { - /// <value type="Object" domElement="true"></value> - return this._loadingElement; - }, - - get_response: function Sys_Mvc_AjaxContext$get_response() { - /// <value type="Sys.Net.WebRequestExecutor"></value> - return this._response; - }, - set_response: function Sys_Mvc_AjaxContext$set_response(value) { - /// <value type="Sys.Net.WebRequestExecutor"></value> - this._response = value; - return value; - }, - - get_request: function Sys_Mvc_AjaxContext$get_request() { - /// <value type="Sys.Net.WebRequest"></value> - return this._request; - }, - - get_updateTarget: function Sys_Mvc_AjaxContext$get_updateTarget() { - /// <value type="Object" domElement="true"></value> - return this._updateTarget; - } -} - - -//////////////////////////////////////////////////////////////////////////////// -// Sys.Mvc.AsyncHyperlink - -Sys.Mvc.AsyncHyperlink = function Sys_Mvc_AsyncHyperlink() { -} -Sys.Mvc.AsyncHyperlink.handleClick = function Sys_Mvc_AsyncHyperlink$handleClick(anchor, evt, ajaxOptions) { - /// <param name="anchor" type="Object" domElement="true"> - /// </param> - /// <param name="evt" type="Sys.UI.DomEvent"> - /// </param> - /// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions"> - /// </param> - evt.preventDefault(); - Sys.Mvc.MvcHelpers._asyncRequest(anchor.href, 'post', '', anchor, ajaxOptions); -} - - -//////////////////////////////////////////////////////////////////////////////// -// Sys.Mvc.MvcHelpers - -Sys.Mvc.MvcHelpers = function Sys_Mvc_MvcHelpers() { -} -Sys.Mvc.MvcHelpers._serializeForm = function Sys_Mvc_MvcHelpers$_serializeForm(form) { - /// <param name="form" type="Object" domElement="true"> - /// </param> - /// <returns type="String"></returns> - var formElements = form.elements; - var formBody = new Sys.StringBuilder(); - var count = formElements.length; - for (var i = 0; i < count; i++) { - var element = formElements[i]; - var name = element.name; - if (!name || !name.length) { - continue; - } - var tagName = element.tagName.toUpperCase(); - if (tagName === 'INPUT') { - var inputElement = element; - var type = inputElement.type; - if ((type === 'text') || (type === 'password') || (type === 'hidden') || (((type === 'checkbox') || (type === 'radio')) && element.checked)) { - formBody.append(encodeURIComponent(name)); - formBody.append('='); - formBody.append(encodeURIComponent(inputElement.value)); - formBody.append('&'); - } - } - else if (tagName === 'SELECT') { - var selectElement = element; - var optionCount = selectElement.options.length; - for (var j = 0; j < optionCount; j++) { - var optionElement = selectElement.options[j]; - if (optionElement.selected) { - formBody.append(encodeURIComponent(name)); - formBody.append('='); - formBody.append(encodeURIComponent(optionElement.value)); - formBody.append('&'); - } - } - } - else if (tagName === 'TEXTAREA') { - formBody.append(encodeURIComponent(name)); - formBody.append('='); - formBody.append(encodeURIComponent((element.value))); - formBody.append('&'); - } - } - return formBody.toString(); -} -Sys.Mvc.MvcHelpers._asyncRequest = function Sys_Mvc_MvcHelpers$_asyncRequest(url, verb, body, triggerElement, ajaxOptions) { - /// <param name="url" type="String"> - /// </param> - /// <param name="verb" type="String"> - /// </param> - /// <param name="body" type="String"> - /// </param> - /// <param name="triggerElement" type="Object" domElement="true"> - /// </param> - /// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions"> - /// </param> - if (ajaxOptions.confirm) { - if (!confirm(ajaxOptions.confirm)) { - return; - } - } - if (ajaxOptions.url) { - url = ajaxOptions.url; - } - if (ajaxOptions.httpMethod) { - verb = ajaxOptions.httpMethod; - } - if (body.length > 0 && !body.endsWith('&')) { - body += '&'; - } - body += 'X-Requested-With=XMLHttpRequest'; - var requestBody = ''; - if (verb.toUpperCase() === 'GET' || verb.toUpperCase() === 'DELETE') { - if (url.indexOf('?') > -1) { - if (!url.endsWith('&')) { - url += '&'; - } - url += body; - } - else { - url += '?'; - url += body; - } - } - else { - requestBody = body; - } - var request = new Sys.Net.WebRequest(); - request.set_url(url); - request.set_httpVerb(verb); - request.set_body(requestBody); - if (verb.toUpperCase() === 'PUT') { - request.get_headers()['Content-Type'] = 'application/x-www-form-urlencoded;'; - } - request.get_headers()['X-Requested-With'] = 'XMLHttpRequest'; - var updateElement = null; - if (ajaxOptions.updateTargetId) { - updateElement = $get(ajaxOptions.updateTargetId); - } - var loadingElement = null; - if (ajaxOptions.loadingElementId) { - loadingElement = $get(ajaxOptions.loadingElementId); - } - var ajaxContext = new Sys.Mvc.AjaxContext(request, updateElement, loadingElement, ajaxOptions.insertionMode); - var continueRequest = true; - if (ajaxOptions.onBegin) { - continueRequest = ajaxOptions.onBegin(ajaxContext) !== false; - } - if (loadingElement) { - Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), true); - } - if (continueRequest) { - request.add_completed(Function.createDelegate(null, function(executor) { - Sys.Mvc.MvcHelpers._onComplete(request, ajaxOptions, ajaxContext); - })); - request.invoke(); - } -} -Sys.Mvc.MvcHelpers._onComplete = function Sys_Mvc_MvcHelpers$_onComplete(request, ajaxOptions, ajaxContext) { - /// <param name="request" type="Sys.Net.WebRequest"> - /// </param> - /// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions"> - /// </param> - /// <param name="ajaxContext" type="Sys.Mvc.AjaxContext"> - /// </param> - ajaxContext.set_response(request.get_executor()); - if (ajaxOptions.onComplete && ajaxOptions.onComplete(ajaxContext) === false) { - return; - } - var statusCode = ajaxContext.get_response().get_statusCode(); - if ((statusCode >= 200 && statusCode < 300) || statusCode === 304 || statusCode === 1223) { - if (statusCode !== 204 && statusCode !== 304 && statusCode !== 1223) { - var contentType = ajaxContext.get_response().getResponseHeader('Content-Type'); - if ((contentType) && (contentType.indexOf('application/x-javascript') !== -1)) { - eval(ajaxContext.get_data()); - } - else { - Sys.Mvc.MvcHelpers.updateDomElement(ajaxContext.get_updateTarget(), ajaxContext.get_insertionMode(), ajaxContext.get_data()); - } - } - if (ajaxOptions.onSuccess) { - ajaxOptions.onSuccess(ajaxContext); - } - } - else { - if (ajaxOptions.onFailure) { - ajaxOptions.onFailure(ajaxContext); - } - } - if (ajaxContext.get_loadingElement()) { - Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), false); - } -} -Sys.Mvc.MvcHelpers.updateDomElement = function Sys_Mvc_MvcHelpers$updateDomElement(target, insertionMode, content) { - /// <param name="target" type="Object" domElement="true"> - /// </param> - /// <param name="insertionMode" type="Sys.Mvc.InsertionMode"> - /// </param> - /// <param name="content" type="String"> - /// </param> - if (target) { - switch (insertionMode) { - case Sys.Mvc.InsertionMode.replace: - target.innerHTML = content; - break; - case Sys.Mvc.InsertionMode.insertBefore: - if (content && content.length > 0) { - target.innerHTML = content + target.innerHTML.trimStart(); - } - break; - case Sys.Mvc.InsertionMode.insertAfter: - if (content && content.length > 0) { - target.innerHTML = target.innerHTML.trimEnd() + content; - } - break; - } - } -} - - -//////////////////////////////////////////////////////////////////////////////// -// Sys.Mvc.AsyncForm - -Sys.Mvc.AsyncForm = function Sys_Mvc_AsyncForm() { -} -Sys.Mvc.AsyncForm.handleSubmit = function Sys_Mvc_AsyncForm$handleSubmit(form, evt, ajaxOptions) { - /// <param name="form" type="Object" domElement="true"> - /// </param> - /// <param name="evt" type="Sys.UI.DomEvent"> - /// </param> - /// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions"> - /// </param> - evt.preventDefault(); - var body = Sys.Mvc.MvcHelpers._serializeForm(form); - Sys.Mvc.MvcHelpers._asyncRequest(form.action, form.method || 'post', body, form, ajaxOptions); -} - - -Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext'); -Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink'); -Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers'); -Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm'); - -// ---- Do not remove this footer ---- -// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) -// ----------------------------------- diff --git a/projecttemplates/MvcRelyingParty/Scripts/MicrosoftMvcAjax.js b/projecttemplates/MvcRelyingParty/Scripts/MicrosoftMvcAjax.js deleted file mode 100644 index 6d6a7e8..0000000 --- a/projecttemplates/MvcRelyingParty/Scripts/MicrosoftMvcAjax.js +++ /dev/null @@ -1,23 +0,0 @@ -//---------------------------------------------------------- -// Copyright (C) Microsoft Corporation. All rights reserved. -//---------------------------------------------------------- -// MicrosoftMvcAjax.js - -Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_AjaxOptions=function(){return {};} -Sys.Mvc.InsertionMode=function(){};Sys.Mvc.InsertionMode.prototype = {replace:0,insertBefore:1,insertAfter:2} -Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode',false);Sys.Mvc.AjaxContext=function(request,updateTarget,loadingElement,insertionMode){this.$3=request;this.$4=updateTarget;this.$1=loadingElement;this.$0=insertionMode;} -Sys.Mvc.AjaxContext.prototype={$0:0,$1:null,$2:null,$3:null,$4:null,get_data:function(){if(this.$2){return this.$2.get_responseData();}else{return null;}},get_insertionMode:function(){return this.$0;},get_loadingElement:function(){return this.$1;},get_response:function(){return this.$2;},set_response:function(value){this.$2=value;return value;},get_request:function(){return this.$3;},get_updateTarget:function(){return this.$4;}} -Sys.Mvc.AsyncHyperlink=function(){} -Sys.Mvc.AsyncHyperlink.handleClick=function(anchor,evt,ajaxOptions){evt.preventDefault();Sys.Mvc.MvcHelpers.$1(anchor.href,'post','',anchor,ajaxOptions);} -Sys.Mvc.MvcHelpers=function(){} -Sys.Mvc.MvcHelpers.$0=function($p0){var $0=$p0.elements;var $1=new Sys.StringBuilder();var $2=$0.length;for(var $3=0;$3<$2;$3++){var $4=$0[$3];var $5=$4.name;if(!$5||!$5.length){continue;}var $6=$4.tagName.toUpperCase();if($6==='INPUT'){var $7=$4;var $8=$7.type;if(($8==='text')||($8==='password')||($8==='hidden')||((($8==='checkbox')||($8==='radio'))&&$4.checked)){$1.append(encodeURIComponent($5));$1.append('=');$1.append(encodeURIComponent($7.value));$1.append('&');}}else if($6==='SELECT'){var $9=$4;var $A=$9.options.length;for(var $B=0;$B<$A;$B++){var $C=$9.options[$B];if($C.selected){$1.append(encodeURIComponent($5));$1.append('=');$1.append(encodeURIComponent($C.value));$1.append('&');}}}else if($6==='TEXTAREA'){$1.append(encodeURIComponent($5));$1.append('=');$1.append(encodeURIComponent(($4.value)));$1.append('&');}}return $1.toString();} -Sys.Mvc.MvcHelpers.$1=function($p0,$p1,$p2,$p3,$p4){if($p4.confirm){if(!confirm($p4.confirm)){return;}}if($p4.url){$p0=$p4.url;}if($p4.httpMethod){$p1=$p4.httpMethod;}if($p2.length>0&&!$p2.endsWith('&')){$p2+='&';}$p2+='X-Requested-With=XMLHttpRequest';var $0='';if($p1.toUpperCase()==='GET'||$p1.toUpperCase()==='DELETE'){if($p0.indexOf('?')>-1){if(!$p0.endsWith('&')){$p0+='&';}$p0+=$p2;}else{$p0+='?';$p0+=$p2;}}else{$0=$p2;}var $1=new Sys.Net.WebRequest();$1.set_url($p0);$1.set_httpVerb($p1);$1.set_body($0);if($p1.toUpperCase()==='PUT'){$1.get_headers()['Content-Type']='application/x-www-form-urlencoded;';}$1.get_headers()['X-Requested-With']='XMLHttpRequest';var $2=null;if($p4.updateTargetId){$2=$get($p4.updateTargetId);}var $3=null;if($p4.loadingElementId){$3=$get($p4.loadingElementId);}var $4=new Sys.Mvc.AjaxContext($1,$2,$3,$p4.insertionMode);var $5=true;if($p4.onBegin){$5=$p4.onBegin($4)!==false;}if($3){Sys.UI.DomElement.setVisible($4.get_loadingElement(),true);}if($5){$1.add_completed(Function.createDelegate(null,function($p1_0){ -Sys.Mvc.MvcHelpers.$2($1,$p4,$4);}));$1.invoke();}} -Sys.Mvc.MvcHelpers.$2=function($p0,$p1,$p2){$p2.set_response($p0.get_executor());if($p1.onComplete&&$p1.onComplete($p2)===false){return;}var $0=$p2.get_response().get_statusCode();if(($0>=200&&$0<300)||$0===304||$0===1223){if($0!==204&&$0!==304&&$0!==1223){var $1=$p2.get_response().getResponseHeader('Content-Type');if(($1)&&($1.indexOf('application/x-javascript')!==-1)){eval($p2.get_data());}else{Sys.Mvc.MvcHelpers.updateDomElement($p2.get_updateTarget(),$p2.get_insertionMode(),$p2.get_data());}}if($p1.onSuccess){$p1.onSuccess($p2);}}else{if($p1.onFailure){$p1.onFailure($p2);}}if($p2.get_loadingElement()){Sys.UI.DomElement.setVisible($p2.get_loadingElement(),false);}} -Sys.Mvc.MvcHelpers.updateDomElement=function(target,insertionMode,content){if(target){switch(insertionMode){case 0:target.innerHTML=content;break;case 1:if(content&&content.length>0){target.innerHTML=content+target.innerHTML.trimStart();}break;case 2:if(content&&content.length>0){target.innerHTML=target.innerHTML.trimEnd()+content;}break;}}} -Sys.Mvc.AsyncForm=function(){} -Sys.Mvc.AsyncForm.handleSubmit=function(form,evt,ajaxOptions){evt.preventDefault();var $0=Sys.Mvc.MvcHelpers.$0(form);Sys.Mvc.MvcHelpers.$1(form.action,form.method||'post',$0,form,ajaxOptions);} -Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext');Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink');Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers');Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm'); -// ---- Do not remove this footer ---- -// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) -// ----------------------------------- diff --git a/projecttemplates/MvcRelyingParty/Scripts/jquery-1.3.2-vsdoc.js b/projecttemplates/MvcRelyingParty/Scripts/jquery-1.3.2-vsdoc.js deleted file mode 100644 index 27aefb8..0000000 --- a/projecttemplates/MvcRelyingParty/Scripts/jquery-1.3.2-vsdoc.js +++ /dev/null @@ -1,6255 +0,0 @@ -/* - * This file has been commented to support Visual Studio Intellisense. - * You should not use this file at runtime inside the browser--it is only - * intended to be used only for design-time IntelliSense. Please use the - * standard jQuery library for all production use. - * - * Comment version: 1.3.2a - */ - -/* - * jQuery JavaScript Library v1.3.2 - * - * Copyright (c) 2009 John Resig, http://jquery.com/ - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ - -(function(){ - -var - // Will speed up references to window, and allows munging its name. - window = this, - // Will speed up references to undefined, and allows munging its name. - undefined, - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - // Map over the $ in case of overwrite - _$ = window.$, - - jQuery = window.jQuery = window.$ = function(selector, context) { - /// <summary> - /// 1: $(expression, context) - This function accepts a string containing a CSS selector which is then used to match a set of elements. - /// 2: $(html) - Create DOM elements on-the-fly from the provided String of raw HTML. - /// 3: $(elements) - Wrap jQuery functionality around a single or multiple DOM Element(s). - /// 4: $(callback) - A shorthand for $(document).ready(). - /// </summary> - /// <param name="selector" type="String"> - /// 1: expression - An expression to search with. - /// 2: html - A string of HTML to create on the fly. - /// 3: elements - DOM element(s) to be encapsulated by a jQuery object. - /// 4: callback - The function to execute when the DOM is ready. - /// </param> - /// <param name="context" type="jQuery"> - /// 1: context - A DOM Element, Document or jQuery to use as context. - /// </param> - /// <field name="selector" Type="Object"> - /// The DOM node context originally passed to jQuery() (if none was passed then context will be equal to the document). - /// </field> - /// <field name="context" Type="String"> - /// A selector representing selector originally passed to jQuery(). - /// </field> - /// <returns type="jQuery" /> - - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context ); - }, - - // A simple way to check for HTML strings or ID strings - // (both of which we optimize for) - quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, - // Is it a simple selector - isSimple = /^.[^:#\[\.,]*$/; - -jQuery.fn = jQuery.prototype = { - init: function( selector, context ) { - /// <summary> - /// 1: $(expression, context) - This function accepts a string containing a CSS selector which is then used to match a set of elements. - /// 2: $(html) - Create DOM elements on-the-fly from the provided String of raw HTML. - /// 3: $(elements) - Wrap jQuery functionality around a single or multiple DOM Element(s). - /// 4: $(callback) - A shorthand for $(document).ready(). - /// </summary> - /// <param name="selector" type="String"> - /// 1: expression - An expression to search with. - /// 2: html - A string of HTML to create on the fly. - /// 3: elements - DOM element(s) to be encapsulated by a jQuery object. - /// 4: callback - The function to execute when the DOM is ready. - /// </param> - /// <param name="context" type="jQuery"> - /// 1: context - A DOM Element, Document or jQuery to use as context. - /// </param> - /// <returns type="jQuery" /> - - // Make sure that a selection was provided - selector = selector || document; - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this[0] = selector; - this.length = 1; - this.context = selector; - return this; - } - // Handle HTML strings - if (typeof selector === "string") { - // Are we dealing with HTML string or an ID? - var match = quickExpr.exec(selector); - - // Verify a match, and that no context was specified for #id - if (match && (match[1] || !context)) { - - // HANDLE: $(html) -> $(array) - if (match[1]) - selector = jQuery.clean([match[1]], context); - - // HANDLE: $("#id") - else { - var elem = document.getElementById(match[3]); - - // Handle the case where IE and Opera return items - // by name instead of ID - if (elem && elem.id != match[3]) - return jQuery().find(selector); - - // Otherwise, we inject the element directly into the jQuery object - var ret = jQuery(elem || []); - ret.context = document; - ret.selector = selector; - return ret; - } - - // HANDLE: $(expr, [context]) - // (which is just equivalent to: $(content).find(expr) - } else - return jQuery(context).find(selector); - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) - return jQuery( document ).ready( selector ); - - // Make sure that old selector state is passed along - if ( selector.selector && selector.context ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return this.setArray(jQuery.isArray( selector ) ? - selector : - jQuery.makeArray(selector)); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.3.2", - - // The number of elements contained in the matched element set - size: function() { - /// <summary> - /// The number of elements currently matched. - /// Part of Core - /// </summary> - /// <returns type="Number" /> - - return this.length; - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - /// <summary> - /// Access a single matched element. num is used to access the - /// Nth element matched. - /// Part of Core - /// </summary> - /// <returns type="Element" /> - /// <param name="num" type="Number"> - /// Access the element in the Nth position. - /// </param> - - return num == undefined ? - - // Return a 'clean' array - Array.prototype.slice.call( this ) : - - // Return just the object - this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - /// <summary> - /// Set the jQuery object to an array of elements, while maintaining - /// the stack. - /// Part of Core - /// </summary> - /// <returns type="jQuery" /> - /// <param name="elems" type="Elements"> - /// An array of elements - /// </param> - - // Build a new jQuery matched element set - var ret = jQuery( elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) - ret.selector = this.selector + (this.selector ? " " : "") + selector; - else if ( name ) - ret.selector = this.selector + "." + name + "(" + selector + ")"; - - // Return the newly-formed element set - return ret; - }, - - // Force the current matched set of elements to become - // the specified array of elements (destroying the stack in the process) - // You should use pushStack() in order to do this, but maintain the stack - setArray: function( elems ) { - /// <summary> - /// Set the jQuery object to an array of elements. This operation is - /// completely destructive - be sure to use .pushStack() if you wish to maintain - /// the jQuery stack. - /// Part of Core - /// </summary> - /// <returns type="jQuery" /> - /// <param name="elems" type="Elements"> - /// An array of elements - /// </param> - - // Resetting the length to 0, then using the native Array push - // is a super-fast way to populate an object with array-like properties - this.length = 0; - Array.prototype.push.apply( this, elems ); - - return this; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - /// <summary> - /// Execute a function within the context of every matched element. - /// This means that every time the passed-in function is executed - /// (which is once for every element matched) the 'this' keyword - /// points to the specific element. - /// Additionally, the function, when executed, is passed a single - /// argument representing the position of the element in the matched - /// set. - /// Part of Core - /// </summary> - /// <returns type="jQuery" /> - /// <param name="callback" type="Function"> - /// A function to execute - /// </param> - - return jQuery.each( this, callback, args ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - /// <summary> - /// Searches every matched element for the object and returns - /// the index of the element, if found, starting with zero. - /// Returns -1 if the object wasn't found. - /// Part of Core - /// </summary> - /// <returns type="Number" /> - /// <param name="elem" type="Element"> - /// Object to search for - /// </param> - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem && elem.jquery ? elem[0] : elem - , this ); - }, - - attr: function( name, value, type ) { - /// <summary> - /// Set a single property to a computed value, on all matched elements. - /// Instead of a value, a function is provided, that computes the value. - /// Part of DOM/Attributes - /// </summary> - /// <returns type="jQuery" /> - /// <param name="name" type="String"> - /// The name of the property to set. - /// </param> - /// <param name="value" type="Function"> - /// A function returning the value to set. - /// </param> - - var options = name; - - // Look for the case where we're accessing a style value - if ( typeof name === "string" ) - if ( value === undefined ) - return this[0] && jQuery[ type || "attr" ]( this[0], name ); - - else { - options = {}; - options[ name ] = value; - } - - // Check to see if we're setting style values - return this.each(function(i){ - // Set all the styles - for ( name in options ) - jQuery.attr( - type ? - this.style : - this, - name, jQuery.prop( this, options[ name ], type, i, name ) - ); - }); - }, - - css: function( key, value ) { - /// <summary> - /// Set a single style property to a value, on all matched elements. - /// If a number is provided, it is automatically converted into a pixel value. - /// Part of CSS - /// </summary> - /// <returns type="jQuery" /> - /// <param name="key" type="String"> - /// The name of the property to set. - /// </param> - /// <param name="value" type="String"> - /// The value to set the property to. - /// </param> - - // ignore negative width and height values - if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) - value = undefined; - return this.attr( key, value, "curCSS" ); - }, - - text: function( text ) { - /// <summary> - /// Set the text contents of all matched elements. - /// Similar to html(), but escapes HTML (replace "<" and ">" with their - /// HTML entities). - /// Part of DOM/Attributes - /// </summary> - /// <returns type="String" /> - /// <param name="text" type="String"> - /// The text value to set the contents of the element to. - /// </param> - - if ( typeof text !== "object" && text != null ) - return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); - - var ret = ""; - - jQuery.each( text || this, function(){ - jQuery.each( this.childNodes, function(){ - if ( this.nodeType != 8 ) - ret += this.nodeType != 1 ? - this.nodeValue : - jQuery.fn.text( [ this ] ); - }); - }); - - return ret; - }, - - wrapAll: function( html ) { - /// <summary> - /// Wrap all matched elements with a structure of other elements. - /// This wrapping process is most useful for injecting additional - /// stucture into a document, without ruining the original semantic - /// qualities of a document. - /// This works by going through the first element - /// provided and finding the deepest ancestor element within its - /// structure - it is that element that will en-wrap everything else. - /// This does not work with elements that contain text. Any necessary text - /// must be added after the wrapping is done. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - /// <param name="html" type="Element"> - /// A DOM element that will be wrapped around the target. - /// </param> - - if ( this[0] ) { - // The elements to wrap the target around - var wrap = jQuery( html, this[0].ownerDocument ).clone(); - - if ( this[0].parentNode ) - wrap.insertBefore( this[0] ); - - wrap.map(function(){ - var elem = this; - - while ( elem.firstChild ) - elem = elem.firstChild; - - return elem; - }).append(this); - } - - return this; - }, - - wrapInner: function( html ) { - /// <summary> - /// Wraps the inner child contents of each matched elemenht (including text nodes) with an HTML structure. - /// </summary> - /// <param name="html" type="String"> - /// A string of HTML or a DOM element that will be wrapped around the target contents. - /// </param> - /// <returns type="jQuery" /> - - return this.each(function(){ - jQuery( this ).contents().wrapAll( html ); - }); - }, - - wrap: function( html ) { - /// <summary> - /// Wrap all matched elements with a structure of other elements. - /// This wrapping process is most useful for injecting additional - /// stucture into a document, without ruining the original semantic - /// qualities of a document. - /// This works by going through the first element - /// provided and finding the deepest ancestor element within its - /// structure - it is that element that will en-wrap everything else. - /// This does not work with elements that contain text. Any necessary text - /// must be added after the wrapping is done. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - /// <param name="html" type="Element"> - /// A DOM element that will be wrapped around the target. - /// </param> - - return this.each(function(){ - jQuery( this ).wrapAll( html ); - }); - }, - - append: function() { - /// <summary> - /// Append content to the inside of every matched element. - /// This operation is similar to doing an appendChild to all the - /// specified elements, adding them into the document. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - /// <param name="content" type="Content"> - /// Content to append to the target - /// </param> - - return this.domManip(arguments, true, function(elem){ - if (this.nodeType == 1) - this.appendChild( elem ); - }); - }, - - prepend: function() { - /// <summary> - /// Prepend content to the inside of every matched element. - /// This operation is the best way to insert elements - /// inside, at the beginning, of all matched elements. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - /// <param name="" type="Content"> - /// Content to prepend to the target. - /// </param> - - return this.domManip(arguments, true, function(elem){ - if (this.nodeType == 1) - this.insertBefore( elem, this.firstChild ); - }); - }, - - before: function() { - /// <summary> - /// Insert content before each of the matched elements. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - /// <param name="" type="Content"> - /// Content to insert before each target. - /// </param> - - return this.domManip(arguments, false, function(elem){ - this.parentNode.insertBefore( elem, this ); - }); - }, - - after: function() { - /// <summary> - /// Insert content after each of the matched elements. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - /// <param name="" type="Content"> - /// Content to insert after each target. - /// </param> - - return this.domManip(arguments, false, function(elem){ - this.parentNode.insertBefore( elem, this.nextSibling ); - }); - }, - - end: function() { - /// <summary> - /// End the most recent 'destructive' operation, reverting the list of matched elements - /// back to its previous state. After an end operation, the list of matched elements will - /// revert to the last state of matched elements. - /// If there was no destructive operation before, an empty set is returned. - /// Part of DOM/Traversing - /// </summary> - /// <returns type="jQuery" /> - - return this.prevObject || jQuery( [] ); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: [].push, - sort: [].sort, - splice: [].splice, - - find: function( selector ) { - /// <summary> - /// Searches for all elements that match the specified expression. - /// This method is a good way to find additional descendant - /// elements with which to process. - /// All searching is done using a jQuery expression. The expression can be - /// written using CSS 1-3 Selector syntax, or basic XPath. - /// Part of DOM/Traversing - /// </summary> - /// <returns type="jQuery" /> - /// <param name="selector" type="String"> - /// An expression to search with. - /// </param> - /// <returns type="jQuery" /> - - if ( this.length === 1 ) { - var ret = this.pushStack( [], "find", selector ); - ret.length = 0; - jQuery.find( selector, this[0], ret ); - return ret; - } else { - return this.pushStack( jQuery.unique(jQuery.map(this, function(elem){ - return jQuery.find( selector, elem ); - })), "find", selector ); - } - }, - - clone: function( events ) { - /// <summary> - /// Clone matched DOM Elements and select the clones. - /// This is useful for moving copies of the elements to another - /// location in the DOM. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - /// <param name="deep" type="Boolean" optional="true"> - /// (Optional) Set to false if you don't want to clone all descendant nodes, in addition to the element itself. - /// </param> - - // Do the clone - var ret = this.map(function(){ - if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) { - // IE copies events bound via attachEvent when - // using cloneNode. Calling detachEvent on the - // clone will also remove the events from the orignal - // In order to get around this, we use innerHTML. - // Unfortunately, this means some modifications to - // attributes in IE that are actually only stored - // as properties will not be copied (such as the - // the name attribute on an input). - var html = this.outerHTML; - if ( !html ) { - var div = this.ownerDocument.createElement("div"); - div.appendChild( this.cloneNode(true) ); - html = div.innerHTML; - } - - return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0]; - } else - return this.cloneNode(true); - }); - - // Copy the events from the original to the clone - if ( events === true ) { - var orig = this.find("*").andSelf(), i = 0; - - ret.find("*").andSelf().each(function(){ - if ( this.nodeName !== orig[i].nodeName ) - return; - - var events = jQuery.data( orig[i], "events" ); - - for ( var type in events ) { - for ( var handler in events[ type ] ) { - jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data ); - } - } - - i++; - }); - } - - // Return the cloned set - return ret; - }, - - filter: function( selector ) { - /// <summary> - /// Removes all elements from the set of matched elements that do not - /// pass the specified filter. This method is used to narrow down - /// the results of a search. - /// }) - /// Part of DOM/Traversing - /// </summary> - /// <returns type="jQuery" /> - /// <param name="selector" type="Function"> - /// A function to use for filtering - /// </param> - /// <returns type="jQuery" /> - - return this.pushStack( - jQuery.isFunction( selector ) && - jQuery.grep(this, function(elem, i){ - return selector.call( elem, i ); - }) || - - jQuery.multiFilter( selector, jQuery.grep(this, function(elem){ - return elem.nodeType === 1; - }) ), "filter", selector ); - }, - - closest: function( selector ) { - /// <summary> - /// Get a set of elements containing the closest parent element that matches the specified selector, the starting element included. - /// </summary> - /// <returns type="jQuery" /> - /// <param name="selector" type="Function"> - /// An expression to filter the elements with. - /// </param> - /// <returns type="jQuery" /> - - var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null, - closer = 0; - - return this.map(function(){ - var cur = this; - while ( cur && cur.ownerDocument ) { - if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) { - jQuery.data(cur, "closest", closer); - return cur; - } - cur = cur.parentNode; - closer++; - } - }); - }, - - not: function( selector ) { - /// <summary> - /// Removes any elements inside the array of elements from the set - /// of matched elements. This method is used to remove one or more - /// elements from a jQuery object. - /// Part of DOM/Traversing - /// </summary> - /// <param name="selector" type="jQuery"> - /// A set of elements to remove from the jQuery set of matched elements. - /// </param> - /// <returns type="jQuery" /> - - if ( typeof selector === "string" ) - // test special case where just one selector is passed in - if ( isSimple.test( selector ) ) - return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector ); - else - selector = jQuery.multiFilter( selector, this ); - - var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; - return this.filter(function() { - return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; - }); - }, - - add: function( selector ) { - /// <summary> - /// Adds one or more Elements to the set of matched elements. - /// Part of DOM/Traversing - /// </summary> - /// <param name="elements" type="Element"> - /// One or more Elements to add - /// </param> - /// <returns type="jQuery" /> - - return this.pushStack( jQuery.unique( jQuery.merge( - this.get(), - typeof selector === "string" ? - jQuery( selector ) : - jQuery.makeArray( selector ) - ))); - }, - - is: function( selector ) { - /// <summary> - /// Checks the current selection against an expression and returns true, - /// if at least one element of the selection fits the given expression. - /// Does return false, if no element fits or the expression is not valid. - /// filter(String) is used internally, therefore all rules that apply there - /// apply here, too. - /// Part of DOM/Traversing - /// </summary> - /// <returns type="Boolean" /> - /// <param name="expr" type="String"> - /// The expression with which to filter - /// </param> - - return !!selector && jQuery.multiFilter( selector, this ).length > 0; - }, - - hasClass: function( selector ) { - /// <summary> - /// Checks the current selection against a class and returns whether at least one selection has a given class. - /// </summary> - /// <param name="selector" type="String">The class to check against</param> - /// <returns type="Boolean">True if at least one element in the selection has the class, otherwise false.</returns> - - return !!selector && this.is( "." + selector ); - }, - - val: function( value ) { - /// <summary> - /// Set the value of every matched element. - /// Part of DOM/Attributes - /// </summary> - /// <returns type="jQuery" /> - /// <param name="val" type="String"> - /// Set the property to the specified value. - /// </param> - - if ( value === undefined ) { - var elem = this[0]; - - if ( elem ) { - if( jQuery.nodeName( elem, 'option' ) ) - return (elem.attributes.value || {}).specified ? elem.value : elem.text; - - // We need to handle select boxes special - if ( jQuery.nodeName( elem, "select" ) ) { - var index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type == "select-one"; - - // Nothing was selected - if ( index < 0 ) - return null; - - // Loop through all the selected options - for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { - var option = options[ i ]; - - if ( option.selected ) { - // Get the specifc value for the option - value = jQuery(option).val(); - - // We don't need an array for one selects - if ( one ) - return value; - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - } - - // Everything else, we just grab the value - return (elem.value || "").replace(/\r/g, ""); - - } - - return undefined; - } - - if ( typeof value === "number" ) - value += ''; - - return this.each(function(){ - if ( this.nodeType != 1 ) - return; - - if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) ) - this.checked = (jQuery.inArray(this.value, value) >= 0 || - jQuery.inArray(this.name, value) >= 0); - - else if ( jQuery.nodeName( this, "select" ) ) { - var values = jQuery.makeArray(value); - - jQuery( "option", this ).each(function(){ - this.selected = (jQuery.inArray( this.value, values ) >= 0 || - jQuery.inArray( this.text, values ) >= 0); - }); - - if ( !values.length ) - this.selectedIndex = -1; - - } else - this.value = value; - }); - }, - - html: function( value ) { - /// <summary> - /// Set the html contents of every matched element. - /// This property is not available on XML documents. - /// Part of DOM/Attributes - /// </summary> - /// <returns type="jQuery" /> - /// <param name="val" type="String"> - /// Set the html contents to the specified value. - /// </param> - - return value === undefined ? - (this[0] ? - this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") : - null) : - this.empty().append( value ); - }, - - replaceWith: function( value ) { - /// <summary> - /// Replaces all matched element with the specified HTML or DOM elements. - /// </summary> - /// <param name="value" type="String"> - /// The content with which to replace the matched elements. - /// </param> - /// <returns type="jQuery">The element that was just replaced.</returns> - - return this.after( value ).remove(); - }, - - eq: function( i ) { - /// <summary> - /// Reduce the set of matched elements to a single element. - /// The position of the element in the set of matched elements - /// starts at 0 and goes to length - 1. - /// Part of Core - /// </summary> - /// <returns type="jQuery" /> - /// <param name="num" type="Number"> - /// pos The index of the element that you wish to limit to. - /// </param> - - return this.slice( i, +i + 1 ); - }, - - slice: function() { - /// <summary> - /// Selects a subset of the matched elements. Behaves exactly like the built-in Array slice method. - /// </summary> - /// <param name="start" type="Number" integer="true">Where to start the subset (0-based).</param> - /// <param name="end" optional="true" type="Number" integer="true">Where to end the subset (not including the end element itself). - /// If omitted, ends at the end of the selection</param> - /// <returns type="jQuery">The sliced elements</returns> - - return this.pushStack( Array.prototype.slice.apply( this, arguments ), - "slice", Array.prototype.slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - /// <summary> - /// This member is internal. - /// </summary> - /// <private /> - /// <returns type="jQuery" /> - - return this.pushStack( jQuery.map(this, function(elem, i){ - return callback.call( elem, i, elem ); - })); - }, - - andSelf: function() { - /// <summary> - /// Adds the previous selection to the current selection. - /// </summary> - /// <returns type="jQuery" /> - - return this.add( this.prevObject ); - }, - - domManip: function( args, table, callback ) { - /// <param name="args" type="Array"> - /// Args - /// </param> - /// <param name="table" type="Boolean"> - /// Insert TBODY in TABLEs if one is not found. - /// </param> - /// <param name="dir" type="Number"> - /// If dir<0, process args in reverse order. - /// </param> - /// <param name="fn" type="Function"> - /// The function doing the DOM manipulation. - /// </param> - /// <returns type="jQuery" /> - /// <summary> - /// Part of Core - /// </summary> - - if ( this[0] ) { - var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(), - scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ), - first = fragment.firstChild; - - if ( first ) - for ( var i = 0, l = this.length; i < l; i++ ) - callback.call( root(this[i], first), this.length > 1 || i > 0 ? - fragment.cloneNode(true) : fragment ); - - if ( scripts ) - jQuery.each( scripts, evalScript ); - } - - return this; - - function root( elem, cur ) { - return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ? - (elem.getElementsByTagName("tbody")[0] || - elem.appendChild(elem.ownerDocument.createElement("tbody"))) : - elem; - } - } -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -function evalScript( i, elem ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - if ( elem.src ) - jQuery.ajax({ - url: elem.src, - async: false, - dataType: "script" - }); - - else - jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); - - if ( elem.parentNode ) - elem.parentNode.removeChild( elem ); -} - -function now(){ - /// <summary> - /// Gets the current date. - /// </summary> - /// <returns type="Date">The current date.</returns> - return +new Date; -} - -jQuery.extend = jQuery.fn.extend = function() { - /// <summary> - /// Extend one object with one or more others, returning the original, - /// modified, object. This is a great utility for simple inheritance. - /// jQuery.extend(settings, options); - /// var settings = jQuery.extend({}, defaults, options); - /// Part of JavaScript - /// </summary> - /// <param name="target" type="Object"> - /// The object to extend - /// </param> - /// <param name="prop1" type="Object"> - /// The object that will be merged into the first. - /// </param> - /// <param name="propN" type="Object" optional="true" parameterArray="true"> - /// (optional) More objects to merge into the first - /// </param> - /// <returns type="Object" /> - - // copy reference to target object - var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) - target = {}; - - // extend jQuery itself if only one argument is passed - if ( length == i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) - // Extend the base object - for ( var name in options ) { - var src = target[ name ], copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) - continue; - - // Recurse if we're merging object values - if ( deep && copy && typeof copy === "object" && !copy.nodeType ) - target[ name ] = jQuery.extend( deep, - // Never move original objects, clone them - src || ( copy.length != null ? [ ] : { } ) - , copy ); - - // Don't bring in undefined values - else if ( copy !== undefined ) - target[ name ] = copy; - - } - - // Return the modified object - return target; -}; - -// exclude the following css properties to add px -var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, - // cache defaultView - defaultView = document.defaultView || {}, - toString = Object.prototype.toString; - -jQuery.extend({ - noConflict: function( deep ) { - /// <summary> - /// Run this function to give control of the $ variable back - /// to whichever library first implemented it. This helps to make - /// sure that jQuery doesn't conflict with the $ object - /// of other libraries. - /// By using this function, you will only be able to access jQuery - /// using the 'jQuery' variable. For example, where you used to do - /// $("div p"), you now must do jQuery("div p"). - /// Part of Core - /// </summary> - /// <returns type="undefined" /> - - window.$ = _$; - - if ( deep ) - window.jQuery = _jQuery; - - return jQuery; - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - /// <summary> - /// Determines if the parameter passed is a function. - /// </summary> - /// <param name="obj" type="Object">The object to check</param> - /// <returns type="Boolean">True if the parameter is a function; otherwise false.</returns> - - return toString.call(obj) === "[object Function]"; - }, - - isArray: function(obj) { - /// <summary> - /// Determine if the parameter passed is an array. - /// </summary> - /// <param name="obj" type="Object">Object to test whether or not it is an array.</param> - /// <returns type="Boolean">True if the parameter is a function; otherwise false.</returns> - - return toString.call(obj) === "[object Array]"; - }, - - // check if an element is in a (or is an) XML document - isXMLDoc: function( elem ) { - /// <summary> - /// Determines if the parameter passed is an XML document. - /// </summary> - /// <param name="elem" type="Object">The object to test</param> - /// <returns type="Boolean">True if the parameter is an XML document; otherwise false.</returns> - - return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || - !!elem.ownerDocument && jQuery.isXMLDoc(elem.ownerDocument); - }, - - // Evalulates a script in a global context - globalEval: function( data ) { - /// <summary> - /// Internally evaluates a script in a global context. - /// </summary> - /// <private /> - - if ( data && /\S/.test(data) ) { - // Inspired by code by Andrea Giammarchi - // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html - var head = document.getElementsByTagName("head")[0] || document.documentElement, - script = document.createElement("script"); - - script.type = "text/javascript"; - if ( jQuery.support.scriptEval ) - script.appendChild( document.createTextNode( data ) ); - else - script.text = data; - - // Use insertBefore instead of appendChild to circumvent an IE6 bug. - // This arises when a base node is used (#2709). - head.insertBefore( script, head.firstChild ); - head.removeChild( script ); - } - }, - - nodeName: function( elem, name ) { - /// <summary> - /// Checks whether the specified element has the specified DOM node name. - /// </summary> - /// <param name="elem" type="Element">The element to examine</param> - /// <param name="name" type="String">The node name to check</param> - /// <returns type="Boolean">True if the specified node name matches the node's DOM node name; otherwise false</returns> - - return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); - }, - - // args is for internal usage only - each: function( object, callback, args ) { - /// <summary> - /// A generic iterator function, which can be used to seemlessly - /// iterate over both objects and arrays. This function is not the same - /// as $().each() - which is used to iterate, exclusively, over a jQuery - /// object. This function can be used to iterate over anything. - /// The callback has two arguments:the key (objects) or index (arrays) as first - /// the first, and the value as the second. - /// Part of JavaScript - /// </summary> - /// <param name="obj" type="Object"> - /// The object, or array, to iterate over. - /// </param> - /// <param name="fn" type="Function"> - /// The function that will be executed on every object. - /// </param> - /// <returns type="Object" /> - - var name, i = 0, length = object.length; - - if ( args ) { - if ( length === undefined ) { - for ( name in object ) - if ( callback.apply( object[ name ], args ) === false ) - break; - } else - for ( ; i < length; ) - if ( callback.apply( object[ i++ ], args ) === false ) - break; - - // A special, fast, case for the most common use of each - } else { - if ( length === undefined ) { - for ( name in object ) - if ( callback.call( object[ name ], name, object[ name ] ) === false ) - break; - } else - for ( var value = object[0]; - i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} - } - - return object; - }, - - prop: function( elem, value, type, i, name ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - // This member is not documented within the jQuery API: http://docs.jquery.com/action/edit/Internals/jQuery.prop - - // Handle executable functions - if ( jQuery.isFunction( value ) ) - value = value.call( elem, i ); - - // Handle passing in a number to a CSS property - return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ? - value + "px" : - value; - }, - - className: { - // internal only, use addClass("class") - add: function( elem, classNames ) { - /// <summary> - /// Internal use only; use addClass('class') - /// </summary> - /// <private /> - - jQuery.each((classNames || "").split(/\s+/), function(i, className){ - if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) ) - elem.className += (elem.className ? " " : "") + className; - }); - }, - - // internal only, use removeClass("class") - remove: function( elem, classNames ) { - /// <summary> - /// Internal use only; use removeClass('class') - /// </summary> - /// <private /> - - if (elem.nodeType == 1) - elem.className = classNames !== undefined ? - jQuery.grep(elem.className.split(/\s+/), function(className){ - return !jQuery.className.has( classNames, className ); - }).join(" ") : - ""; - }, - - // internal only, use hasClass("class") - has: function( elem, className ) { - /// <summary> - /// Internal use only; use hasClass('class') - /// </summary> - /// <private /> - - return elem && jQuery.inArray(className, (elem.className || elem).toString().split(/\s+/)) > -1; - } - }, - - // A method for quickly swapping in/out CSS properties to get correct calculations - swap: function( elem, options, callback ) { - /// <summary> - /// Swap in/out style options. - /// </summary> - - var old = {}; - // Remember the old values, and insert the new ones - for ( var name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - callback.call( elem ); - - // Revert the old values - for ( var name in options ) - elem.style[ name ] = old[ name ]; - }, - - css: function( elem, name, force, extra ) { - /// <summary> - /// This method is internal only. - /// </summary> - /// <private /> - // This method is undocumented in jQuery API: http://docs.jquery.com/action/edit/Internals/jQuery.css - - if ( name == "width" || name == "height" ) { - var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; - - function getWH() { - val = name == "width" ? elem.offsetWidth : elem.offsetHeight; - - if ( extra === "border" ) - return; - - jQuery.each( which, function() { - if ( !extra ) - val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0; - if ( extra === "margin" ) - val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0; - else - val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0; - }); - } - - if ( elem.offsetWidth !== 0 ) - getWH(); - else - jQuery.swap( elem, props, getWH ); - - return Math.max(0, Math.round(val)); - } - - return jQuery.curCSS( elem, name, force ); - }, - - curCSS: function( elem, name, force ) { - /// <summary> - /// This method is internal only. - /// </summary> - /// <private /> - // This method is undocumented in jQuery API: http://docs.jquery.com/action/edit/Internals/jQuery.curCSS - - var ret, style = elem.style; - - // We need to handle opacity special in IE - if ( name == "opacity" && !jQuery.support.opacity ) { - ret = jQuery.attr( style, "opacity" ); - - return ret == "" ? - "1" : - ret; - } - - // Make sure we're using the right name for getting the float value - if ( name.match( /float/i ) ) - name = styleFloat; - - if ( !force && style && style[ name ] ) - ret = style[ name ]; - - else if ( defaultView.getComputedStyle ) { - - // Only "float" is needed here - if ( name.match( /float/i ) ) - name = "float"; - - name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); - - var computedStyle = defaultView.getComputedStyle( elem, null ); - - if ( computedStyle ) - ret = computedStyle.getPropertyValue( name ); - - // We should always get a number back from opacity - if ( name == "opacity" && ret == "" ) - ret = "1"; - - } else if ( elem.currentStyle ) { - var camelCase = name.replace(/\-(\w)/g, function(all, letter){ - return letter.toUpperCase(); - }); - - ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; - - // From the awesome hack by Dean Edwards - // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 - - // If we're not dealing with a regular pixel number - // but a number that has a weird ending, we need to convert it to pixels - if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { - // Remember the original values - var left = style.left, rsLeft = elem.runtimeStyle.left; - - // Put in the new values to get a computed value out - elem.runtimeStyle.left = elem.currentStyle.left; - style.left = ret || 0; - ret = style.pixelLeft + "px"; - - // Revert the changed values - style.left = left; - elem.runtimeStyle.left = rsLeft; - } - } - - return ret; - }, - - clean: function( elems, context, fragment ) { - /// <summary> - /// This method is internal only. - /// </summary> - /// <private /> - // This method is undocumented in the jQuery API: http://docs.jquery.com/action/edit/Internals/jQuery.clean - - - context = context || document; - - // !context.createElement fails in IE with an error but returns typeof 'object' - if ( typeof context.createElement === "undefined" ) - context = context.ownerDocument || context[0] && context[0].ownerDocument || document; - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) { - var match = /^<(\w+)\s*\/?>$/.exec(elems[0]); - if ( match ) - return [ context.createElement( match[1] ) ]; - } - - var ret = [], scripts = [], div = context.createElement("div"); - - jQuery.each(elems, function(i, elem){ - if ( typeof elem === "number" ) - elem += ''; - - if ( !elem ) - return; - - // Convert html string into DOM nodes - if ( typeof elem === "string" ) { - // Fix "XHTML"-style tags in all browsers - elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ - return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? - all : - front + "></" + tag + ">"; - }); - - // Trim whitespace, otherwise indexOf won't work as expected - var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase(); - - var wrap = - // option or optgroup - !tags.indexOf("<opt") && - [ 1, "<select multiple='multiple'>", "</select>" ] || - - !tags.indexOf("<leg") && - [ 1, "<fieldset>", "</fieldset>" ] || - - tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && - [ 1, "<table>", "</table>" ] || - - !tags.indexOf("<tr") && - [ 2, "<table><tbody>", "</tbody></table>" ] || - - // <thead> matched above - (!tags.indexOf("<td") || !tags.indexOf("<th")) && - [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] || - - !tags.indexOf("<col") && - [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] || - - // IE can't serialize <link> and <script> tags normally - !jQuery.support.htmlSerialize && - [ 1, "div<div>", "</div>" ] || - - [ 0, "", "" ]; - - // Go to html and back, then peel off extra wrappers - div.innerHTML = wrap[1] + elem + wrap[2]; - - // Move to the right depth - while ( wrap[0]-- ) - div = div.lastChild; - - // Remove IE's autoinserted <tbody> from table fragments - if ( !jQuery.support.tbody ) { - - // String was a <table>, *may* have spurious <tbody> - var hasBody = /<tbody/i.test(elem), - tbody = !tags.indexOf("<table") && !hasBody ? - div.firstChild && div.firstChild.childNodes : - - // String was a bare <thead> or <tfoot> - wrap[1] == "<table>" && !hasBody ? - div.childNodes : - []; - - for ( var j = tbody.length - 1; j >= 0 ; --j ) - if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) - tbody[ j ].parentNode.removeChild( tbody[ j ] ); - - } - - // IE completely kills leading whitespace when innerHTML is used - if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) ) - div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild ); - - elem = jQuery.makeArray( div.childNodes ); - } - - if ( elem.nodeType ) - ret.push( elem ); - else - ret = jQuery.merge( ret, elem ); - - }); - - if ( fragment ) { - for ( var i = 0; ret[i]; i++ ) { - if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { - scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); - } else { - if ( ret[i].nodeType === 1 ) - ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); - fragment.appendChild( ret[i] ); - } - } - - return scripts; - } - - return ret; - }, - - attr: function( elem, name, value ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - // don't set attributes on text and comment nodes - if (!elem || elem.nodeType == 3 || elem.nodeType == 8) - return undefined; - - var notxml = !jQuery.isXMLDoc( elem ), - // Whether we are setting (or getting) - set = value !== undefined; - - // Try to normalize/fix the name - name = notxml && jQuery.props[ name ] || name; - - // Only do all the following if this is a node (faster for style) - // IE elem.getAttribute passes even for style - if ( elem.tagName ) { - - // These attributes require special treatment - var special = /href|src|style/.test( name ); - - // Safari mis-reports the default selected property of a hidden option - // Accessing the parent's selectedIndex property fixes it - if ( name == "selected" && elem.parentNode ) - elem.parentNode.selectedIndex; - - // If applicable, access the attribute via the DOM 0 way - if ( name in elem && notxml && !special ) { - if ( set ){ - // We can't allow the type property to be changed (since it causes problems in IE) - if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode ) - throw "type property can't be changed"; - - elem[ name ] = value; - } - - // browsers index elements by id/name on forms, give priority to attributes. - if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) - return elem.getAttributeNode( name ).nodeValue; - - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - if ( name == "tabIndex" ) { - var attributeNode = elem.getAttributeNode( "tabIndex" ); - return attributeNode && attributeNode.specified - ? attributeNode.value - : elem.nodeName.match(/(button|input|object|select|textarea)/i) - ? 0 - : elem.nodeName.match(/^(a|area)$/i) && elem.href - ? 0 - : undefined; - } - - return elem[ name ]; - } - - if ( !jQuery.support.style && notxml && name == "style" ) - return jQuery.attr( elem.style, "cssText", value ); - - if ( set ) - // convert the value to a string (all browsers do this but IE) see #1070 - elem.setAttribute( name, "" + value ); - - var attr = !jQuery.support.hrefNormalized && notxml && special - // Some attributes require a special call on IE - ? elem.getAttribute( name, 2 ) - : elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return attr === null ? undefined : attr; - } - - // elem is actually elem.style ... set the style - - // IE uses filters for opacity - if ( !jQuery.support.opacity && name == "opacity" ) { - if ( set ) { - // IE has trouble with opacity if it does not have layout - // Force it by setting the zoom level - elem.zoom = 1; - - // Set the alpha filter to set the opacity - elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) + - (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"); - } - - return elem.filter && elem.filter.indexOf("opacity=") >= 0 ? - (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '': - ""; - } - - name = name.replace(/-([a-z])/ig, function(all, letter){ - return letter.toUpperCase(); - }); - - if ( set ) - elem[ name ] = value; - - return elem[ name ]; - }, - - trim: function( text ) { - /// <summary> - /// Remove the whitespace from the beginning and end of a string. - /// Part of JavaScript - /// </summary> - /// <returns type="String" /> - /// <param name="text" type="String"> - /// The string to trim. - /// </param> - - return (text || "").replace( /^\s+|\s+$/g, "" ); - }, - - makeArray: function( array ) { - /// <summary> - /// Turns anything into a true array. This is an internal method. - /// </summary> - /// <param name="array" type="Object">Anything to turn into an actual Array</param> - /// <returns type="Array" /> - /// <private /> - - var ret = []; - - if( array != null ){ - var i = array.length; - // The window, strings (and functions) also have 'length' - if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval ) - ret[0] = array; - else - while( i ) - ret[--i] = array[i]; - } - - return ret; - }, - - inArray: function( elem, array ) { - /// <summary> - /// Determines the index of the first parameter in the array. - /// </summary> - /// <param name="elem">The value to see if it exists in the array.</param> - /// <param name="array" type="Array">The array to look through for the value</param> - /// <returns type="Number" integer="true">The 0-based index of the item if it was found, otherwise -1.</returns> - - for ( var i = 0, length = array.length; i < length; i++ ) - // Use === because on IE, window == document - if ( array[ i ] === elem ) - return i; - - return -1; - }, - - merge: function( first, second ) { - /// <summary> - /// Merge two arrays together, removing all duplicates. - /// The new array is: All the results from the first array, followed - /// by the unique results from the second array. - /// Part of JavaScript - /// </summary> - /// <returns type="Array" /> - /// <param name="first" type="Array"> - /// The first array to merge. - /// </param> - /// <param name="second" type="Array"> - /// The second array to merge. - /// </param> - - // We have to loop this way because IE & Opera overwrite the length - // expando of getElementsByTagName - var i = 0, elem, pos = first.length; - // Also, we need to make sure that the correct elements are being returned - // (IE returns comment nodes in a '*' query) - if ( !jQuery.support.getAll ) { - while ( (elem = second[ i++ ]) != null ) - if ( elem.nodeType != 8 ) - first[ pos++ ] = elem; - - } else - while ( (elem = second[ i++ ]) != null ) - first[ pos++ ] = elem; - - return first; - }, - - unique: function( array ) { - /// <summary> - /// Removes all duplicate elements from an array of elements. - /// </summary> - /// <param name="array" type="Array<Element>">The array to translate</param> - /// <returns type="Array<Element>">The array after translation.</returns> - - var ret = [], done = {}; - - try { - - for ( var i = 0, length = array.length; i < length; i++ ) { - var id = jQuery.data( array[ i ] ); - - if ( !done[ id ] ) { - done[ id ] = true; - ret.push( array[ i ] ); - } - } - - } catch( e ) { - ret = array; - } - - return ret; - }, - - grep: function( elems, callback, inv ) { - /// <summary> - /// Filter items out of an array, by using a filter function. - /// The specified function will be passed two arguments: The - /// current array item and the index of the item in the array. The - /// function must return 'true' to keep the item in the array, - /// false to remove it. - /// }); - /// Part of JavaScript - /// </summary> - /// <returns type="Array" /> - /// <param name="elems" type="Array"> - /// array The Array to find items in. - /// </param> - /// <param name="fn" type="Function"> - /// The function to process each item against. - /// </param> - /// <param name="inv" type="Boolean"> - /// Invert the selection - select the opposite of the function. - /// </param> - - var ret = []; - - // Go through the array, only saving the items - // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) - if ( !inv != !callback( elems[ i ], i ) ) - ret.push( elems[ i ] ); - - return ret; - }, - - map: function( elems, callback ) { - /// <summary> - /// Translate all items in an array to another array of items. - /// The translation function that is provided to this method is - /// called for each item in the array and is passed one argument: - /// The item to be translated. - /// The function can then return the translated value, 'null' - /// (to remove the item), or an array of values - which will - /// be flattened into the full array. - /// Part of JavaScript - /// </summary> - /// <returns type="Array" /> - /// <param name="elems" type="Array"> - /// array The Array to translate. - /// </param> - /// <param name="fn" type="Function"> - /// The function to process each item against. - /// </param> - - var ret = []; - - // Go through the array, translating each of the items to their - // new value (or values). - for ( var i = 0, length = elems.length; i < length; i++ ) { - var value = callback( elems[ i ], i ); - - if ( value != null ) - ret[ ret.length ] = value; - } - - return ret.concat.apply( [], ret ); - } -}); - -// Use of jQuery.browser is deprecated. -// It's included for backwards compatibility and plugins, -// although they should work to migrate away. - -var userAgent = navigator.userAgent.toLowerCase(); - -// Figure out what browser is being used -jQuery.browser = { - version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1], - safari: /webkit/.test( userAgent ), - opera: /opera/.test( userAgent ), - msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), - mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) -}; - -// [vsdoc] The following section has been denormalized from original sources for IntelliSense. -// jQuery.each({ -// parent: function(elem){return elem.parentNode;}, -// parents: function(elem){return jQuery.dir(elem,"parentNode");}, -// next: function(elem){return jQuery.nth(elem,2,"nextSibling");}, -// prev: function(elem){return jQuery.nth(elem,2,"previousSibling");}, -// nextAll: function(elem){return jQuery.dir(elem,"nextSibling");}, -// prevAll: function(elem){return jQuery.dir(elem,"previousSibling");}, -// siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);}, -// children: function(elem){return jQuery.sibling(elem.firstChild);}, -// contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);} -// }, function(name, fn){ -// jQuery.fn[ name ] = function( selector ) { -// /// <summary> -// /// Get a set of elements containing the unique parents of the matched -// /// set of elements. -// /// Can be filtered with an optional expressions. -// /// Part of DOM/Traversing -// /// </summary> -// /// <param name="expr" type="String" optional="true"> -// /// (optional) An expression to filter the parents with -// /// </param> -// /// <returns type="jQuery" /> -// -// var ret = jQuery.map( this, fn ); -// -// if ( selector && typeof selector == "string" ) -// ret = jQuery.multiFilter( selector, ret ); -// -// return this.pushStack( jQuery.unique( ret ), name, selector ); -// }; -// }); - -jQuery.each({ - parent: function(elem){return elem.parentNode;} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary> - /// Get a set of elements containing the unique parents of the matched - /// set of elements. - /// Can be filtered with an optional expressions. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the parents with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - parents: function(elem){return jQuery.dir(elem,"parentNode");} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary> - /// Get a set of elements containing the unique ancestors of the matched - /// set of elements (except for the root element). - /// Can be filtered with an optional expressions. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the ancestors with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - next: function(elem){return jQuery.nth(elem,2,"nextSibling");} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary> - /// Get a set of elements containing the unique next siblings of each of the - /// matched set of elements. - /// It only returns the very next sibling, not all next siblings. - /// Can be filtered with an optional expressions. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the next Elements with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - prev: function(elem){return jQuery.nth(elem,2,"previousSibling");} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary> - /// Get a set of elements containing the unique previous siblings of each of the - /// matched set of elements. - /// Can be filtered with an optional expressions. - /// It only returns the immediately previous sibling, not all previous siblings. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the previous Elements with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - nextAll: function(elem){return jQuery.dir(elem,"nextSibling");} -}, function(name, fn){ - jQuery.fn[name] = function(selector) { - /// <summary> - /// Finds all sibling elements after the current element. - /// Can be filtered with an optional expressions. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the next Elements with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - prevAll: function(elem){return jQuery.dir(elem,"previousSibling");} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary> - /// Finds all sibling elements before the current element. - /// Can be filtered with an optional expressions. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the previous Elements with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary> - /// Get a set of elements containing all of the unique siblings of each of the - /// matched set of elements. - /// Can be filtered with an optional expressions. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the sibling Elements with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - children: function(elem){return jQuery.sibling(elem.firstChild);} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary> - /// Get a set of elements containing all of the unique children of each of the - /// matched set of elements. - /// Can be filtered with an optional expressions. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the child Elements with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary>Finds all the child nodes inside the matched elements including text nodes, or the content document if the element is an iframe.</summary> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -// [vsdoc] The following section has been denormalized from original sources for IntelliSense. -// jQuery.each({ -// appendTo: "append", -// prependTo: "prepend", -// insertBefore: "before", -// insertAfter: "after", -// replaceAll: "replaceWith" -// }, function(name, original){ -// jQuery.fn[ name ] = function() { -// var args = arguments; -// -// return this.each(function(){ -// for ( var i = 0, length = args.length; i < length; i++ ) -// jQuery( args[ i ] )[ original ]( this ); -// }); -// }; -// }); - -jQuery.fn.appendTo = function( selector ) { - /// <summary> - /// Append all of the matched elements to another, specified, set of elements. - /// As of jQuery 1.3.2, returns all of the inserted elements. - /// This operation is, essentially, the reverse of doing a regular - /// $(A).append(B), in that instead of appending B to A, you're appending - /// A to B. - /// </summary> - /// <param name="selector" type="Selector"> - /// target to which the content will be appended. - /// </param> - /// <returns type="jQuery" /> - var ret = [], insert = jQuery( selector ); - - for ( var i = 0, l = insert.length; i < l; i++ ) { - var elems = (i > 0 ? this.clone(true) : this).get(); - jQuery.fn[ "append" ].apply( jQuery(insert[i]), elems ); - ret = ret.concat( elems ); - } - - return this.pushStack( ret, "appendTo", selector ); -}; - -jQuery.fn.prependTo = function( selector ) { - /// <summary> - /// Prepend all of the matched elements to another, specified, set of elements. - /// As of jQuery 1.3.2, returns all of the inserted elements. - /// This operation is, essentially, the reverse of doing a regular - /// $(A).prepend(B), in that instead of prepending B to A, you're prepending - /// A to B. - /// </summary> - /// <param name="selector" type="Selector"> - /// target to which the content will be appended. - /// </param> - /// <returns type="jQuery" /> - var ret = [], insert = jQuery( selector ); - - for ( var i = 0, l = insert.length; i < l; i++ ) { - var elems = (i > 0 ? this.clone(true) : this).get(); - jQuery.fn[ "prepend" ].apply( jQuery(insert[i]), elems ); - ret = ret.concat( elems ); - } - - return this.pushStack( ret, "prependTo", selector ); -}; - -jQuery.fn.insertBefore = function( selector ) { - /// <summary> - /// Insert all of the matched elements before another, specified, set of elements. - /// As of jQuery 1.3.2, returns all of the inserted elements. - /// This operation is, essentially, the reverse of doing a regular - /// $(A).before(B), in that instead of inserting B before A, you're inserting - /// A before B. - /// </summary> - /// <param name="content" type="String"> - /// Content after which the selected element(s) is inserted. - /// </param> - /// <returns type="jQuery" /> - var ret = [], insert = jQuery( selector ); - - for ( var i = 0, l = insert.length; i < l; i++ ) { - var elems = (i > 0 ? this.clone(true) : this).get(); - jQuery.fn[ "before" ].apply( jQuery(insert[i]), elems ); - ret = ret.concat( elems ); - } - - return this.pushStack( ret, "insertBefore", selector ); -}; - -jQuery.fn.insertAfter = function( selector ) { - /// <summary> - /// Insert all of the matched elements after another, specified, set of elements. - /// As of jQuery 1.3.2, returns all of the inserted elements. - /// This operation is, essentially, the reverse of doing a regular - /// $(A).after(B), in that instead of inserting B after A, you're inserting - /// A after B. - /// </summary> - /// <param name="content" type="String"> - /// Content after which the selected element(s) is inserted. - /// </param> - /// <returns type="jQuery" /> - var ret = [], insert = jQuery( selector ); - - for ( var i = 0, l = insert.length; i < l; i++ ) { - var elems = (i > 0 ? this.clone(true) : this).get(); - jQuery.fn[ "after" ].apply( jQuery(insert[i]), elems ); - ret = ret.concat( elems ); - } - - return this.pushStack( ret, "insertAfter", selector ); -}; - -jQuery.fn.replaceAll = function( selector ) { - /// <summary> - /// Replaces the elements matched by the specified selector with the matched elements. - /// As of jQuery 1.3.2, returns all of the inserted elements. - /// </summary> - /// <param name="selector" type="Selector">The elements to find and replace the matched elements with.</param> - /// <returns type="jQuery" /> - var ret = [], insert = jQuery( selector ); - - for ( var i = 0, l = insert.length; i < l; i++ ) { - var elems = (i > 0 ? this.clone(true) : this).get(); - jQuery.fn[ "replaceWith" ].apply( jQuery(insert[i]), elems ); - ret = ret.concat( elems ); - } - - return this.pushStack( ret, "replaceAll", selector ); -}; - -// [vsdoc] The following section has been denormalized from original sources for IntelliSense. -// jQuery.each({ -// removeAttr: function( name ) { -// jQuery.attr( this, name, "" ); -// if (this.nodeType == 1) -// this.removeAttribute( name ); -// }, -// -// addClass: function( classNames ) { -// jQuery.className.add( this, classNames ); -// }, -// -// removeClass: function( classNames ) { -// jQuery.className.remove( this, classNames ); -// }, -// -// toggleClass: function( classNames, state ) { -// if( typeof state !== "boolean" ) -// state = !jQuery.className.has( this, classNames ); -// jQuery.className[ state ? "add" : "remove" ]( this, classNames ); -// }, -// -// remove: function( selector ) { -// if ( !selector || jQuery.filter( selector, [ this ] ).length ) { -// // Prevent memory leaks -// jQuery( "*", this ).add([this]).each(function(){ -// jQuery.event.remove(this); -// jQuery.removeData(this); -// }); -// if (this.parentNode) -// this.parentNode.removeChild( this ); -// } -// }, -// -// empty: function() { -// // Remove element nodes and prevent memory leaks -// jQuery( ">*", this ).remove(); -// -// // Remove any remaining nodes -// while ( this.firstChild ) -// this.removeChild( this.firstChild ); -// } -// }, function(name, fn){ -// jQuery.fn[ name ] = function(){ -// return this.each( fn, arguments ); -// }; -// }); - -jQuery.fn.removeAttr = function(){ - /// <summary> - /// Remove an attribute from each of the matched elements. - /// Part of DOM/Attributes - /// </summary> - /// <param name="key" type="String"> - /// name The name of the attribute to remove. - /// </param> - /// <returns type="jQuery" /> - return this.each( function( name ) { - jQuery.attr( this, name, "" ); - if (this.nodeType == 1) - this.removeAttribute( name ); - }, arguments ); -}; - -jQuery.fn.addClass = function(){ - /// <summary> - /// Adds the specified class(es) to each of the set of matched elements. - /// Part of DOM/Attributes - /// </summary> - /// <param name="classNames" type="String"> - /// lass One or more CSS classes to add to the elements - /// </param> - /// <returns type="jQuery" /> - return this.each( function( classNames ) { - jQuery.className.add( this, classNames ); - }, arguments ); -}; - -jQuery.fn.removeClass = function(){ - /// <summary> - /// Removes all or the specified class(es) from the set of matched elements. - /// Part of DOM/Attributes - /// </summary> - /// <param name="cssClasses" type="String" optional="true"> - /// (Optional) One or more CSS classes to remove from the elements - /// </param> - /// <returns type="jQuery" /> - return this.each( function( classNames ) { - jQuery.className.remove( this, classNames ); - }, arguments ); -}; - -jQuery.fn.toggleClass = function(){ - /// <summary> - /// Adds the specified class if it is not present, removes it if it is - /// present. - /// Part of DOM/Attributes - /// </summary> - /// <param name="cssClass" type="String"> - /// A CSS class with which to toggle the elements - /// </param> - /// <returns type="jQuery" /> - return this.each( function( classNames, state ) { - if( typeof state !== "boolean" ) - state = !jQuery.className.has( this, classNames ); - jQuery.className[ state ? "add" : "remove" ]( this, classNames ); - }, arguments ); -}; - -jQuery.fn.remove = function(){ - /// <summary> - /// Removes all matched elements from the DOM. This does NOT remove them from the - /// jQuery object, allowing you to use the matched elements further. - /// Can be filtered with an optional expressions. - /// Part of DOM/Manipulation - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) A jQuery expression to filter elements by. - /// </param> - /// <returns type="jQuery" /> - return this.each( function( selector ) { - if ( !selector || jQuery.filter( selector, [ this ] ).length ) { - // Prevent memory leaks - jQuery( "*", this ).add([this]).each(function(){ - jQuery.event.remove(this); - jQuery.removeData(this); - }); - if (this.parentNode) - this.parentNode.removeChild( this ); - } - }, arguments ); -}; - -jQuery.fn.empty = function(){ - /// <summary> - /// Removes all child nodes from the set of matched elements. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - return this.each( function() { - // Remove element nodes and prevent memory leaks - jQuery(this).children().remove(); - - // Remove any remaining nodes - while ( this.firstChild ) - this.removeChild( this.firstChild ); - }, arguments ); -}; - -// Helper function used by the dimensions and offset modules -function num(elem, prop) { - return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0; -} -var expando = "jQuery" + now(), uuid = 0, windowData = {}; - -jQuery.extend({ - cache: {}, - - data: function( elem, name, data ) { - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ]; - - // Compute a unique ID for the element - if ( !id ) - id = elem[ expando ] = ++uuid; - - // Only generate the data cache if we're - // trying to access or manipulate it - if ( name && !jQuery.cache[ id ] ) - jQuery.cache[ id ] = {}; - - // Prevent overriding the named cache with undefined values - if ( data !== undefined ) - jQuery.cache[ id ][ name ] = data; - - // Return the named cache data, or the ID for the element - return name ? - jQuery.cache[ id ][ name ] : - id; - }, - - removeData: function( elem, name ) { - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ]; - - // If we want to remove a specific section of the element's data - if ( name ) { - if ( jQuery.cache[ id ] ) { - // Remove the section of cache data - delete jQuery.cache[ id ][ name ]; - - // If we've removed all the data, remove the element's cache - name = ""; - - for ( name in jQuery.cache[ id ] ) - break; - - if ( !name ) - jQuery.removeData( elem ); - } - - // Otherwise, we want to remove all of the element's data - } else { - // Clean up the element expando - try { - delete elem[ expando ]; - } catch(e){ - // IE has trouble directly removing the expando - // but it's ok with using removeAttribute - if ( elem.removeAttribute ) - elem.removeAttribute( expando ); - } - - // Completely remove the data cache - delete jQuery.cache[ id ]; - } - }, - queue: function( elem, type, data ) { - if ( elem ){ - - type = (type || "fx") + "queue"; - - var q = jQuery.data( elem, type ); - - if ( !q || jQuery.isArray(data) ) - q = jQuery.data( elem, type, jQuery.makeArray(data) ); - else if( data ) - q.push( data ); - - } - return q; - }, - - dequeue: function( elem, type ){ - var queue = jQuery.queue( elem, type ), - fn = queue.shift(); - - if( !type || type === "fx" ) - fn = queue[0]; - - if( fn !== undefined ) - fn.call(elem); - } -}); - -jQuery.fn.extend({ - data: function( key, value ){ - var parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if ( value === undefined ) { - var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - if ( data === undefined && this.length ) - data = jQuery.data( this[0], key ); - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - } else - return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ - jQuery.data( this, key, value ); - }); - }, - - removeData: function( key ){ - return this.each(function(){ - jQuery.removeData( this, key ); - }); - }, - queue: function(type, data){ - /// <summary> - /// 1: queue() - Returns a reference to the first element's queue (which is an array of functions). - /// 2: queue(callback) - Adds a new function, to be executed, onto the end of the queue of all matched elements. - /// 3: queue(queue) - Replaces the queue of all matched element with this new queue (the array of functions). - /// </summary> - /// <param name="type" type="Function">The function to add to the queue.</param> - /// <returns type="jQuery" /> - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - } - - if ( data === undefined ) - return jQuery.queue( this[0], type ); - - return this.each(function(){ - var queue = jQuery.queue( this, type, data ); - - if( type == "fx" && queue.length == 1 ) - queue[0].call(this); - }); - }, - dequeue: function(type){ - /// <summary> - /// Removes a queued function from the front of the queue and executes it. - /// </summary> - /// <param name="type" type="String" optional="true">The type of queue to access.</param> - /// <returns type="jQuery" /> - - return this.each(function(){ - jQuery.dequeue( this, type ); - }); - } -});/*! - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * More information: http://sizzlejs.com/ - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g, - done = 0, - toString = Object.prototype.toString; - -var Sizzle = function(selector, context, results, seed) { - results = results || []; - context = context || document; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) - return []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var parts = [], m, set, checkSet, check, mode, extra, prune = true; - - // Reset the position of the chunker regexp (start from head) - chunker.lastIndex = 0; - - while ( (m = chunker.exec(selector)) !== null ) { - parts.push( m[1] ); - - if ( m[2] ) { - extra = RegExp.rightContext; - break; - } - } - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context ); - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) - selector += parts.shift(); - - set = posProcess( selector, set ); - } - } - } else { - var ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context) ); - set = Sizzle.filter( ret.expr, ret.set ); - - if ( parts.length > 0 ) { - checkSet = makeArray(set); - } else { - prune = false; - } - - while ( parts.length ) { - var cur = parts.pop(), pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, isXML(context) ); - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - throw "Syntax error, unrecognized expression: " + (cur || selector); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - } else if ( context.nodeType === 1 ) { - for ( var i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - } else { - for ( var i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, context, results, seed ); - - if ( sortOrder ) { - hasDuplicate = false; - results.sort(sortOrder); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[i-1] ) { - results.splice(i--, 1); - } - } - } - } - } - - return results; -}; - -Sizzle.matches = function(expr, set){ - return Sizzle(expr, null, null, set); -}; - -Sizzle.find = function(expr, context, isXML){ - var set, match; - - if ( !expr ) { - return []; - } - - for ( var i = 0, l = Expr.order.length; i < l; i++ ) { - var type = Expr.order[i], match; - - if ( (match = Expr.match[ type ].exec( expr )) ) { - var left = RegExp.leftContext; - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace(/\\/g, ""); - set = Expr.find[ type ]( match, context, isXML ); - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = context.getElementsByTagName("*"); - } - - return {set: set, expr: expr}; -}; - -Sizzle.filter = function(expr, set, inplace, not){ - var old = expr, result = [], curLoop = set, match, anyFound, - isXMLFilter = set && set[0] && isXML(set[0]); - - while ( expr && set.length ) { - for ( var type in Expr.filter ) { - if ( (match = Expr.match[ type ].exec( expr )) != null ) { - var filter = Expr.filter[ type ], found, item; - anyFound = false; - - if ( curLoop == result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( var i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - var pass = not ^ !!found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - } else { - curLoop[i] = false; - } - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr == old ) { - if ( anyFound == null ) { - throw "Syntax error, unrecognized expression: " + expr; - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - match: { - ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/ - }, - attrMap: { - "class": "className", - "for": "htmlFor" - }, - attrHandle: { - href: function(elem){ - return elem.getAttribute("href"); - } - }, - relative: { - "+": function(checkSet, part, isXML){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !/\W/.test(part), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag && !isXML ) { - part = part.toUpperCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - ">": function(checkSet, part, isXML){ - var isPartStr = typeof part === "string"; - - if ( isPartStr && !/\W/.test(part) ) { - part = isXML ? part : part.toUpperCase(); - - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName === part ? parent : false; - } - } - } else { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - "": function(checkSet, part, isXML){ - var doneName = done++, checkFn = dirCheck; - - if ( !part.match(/\W/) ) { - var nodeCheck = part = isXML ? part : part.toUpperCase(); - checkFn = dirNodeCheck; - } - - checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); - }, - "~": function(checkSet, part, isXML){ - var doneName = done++, checkFn = dirCheck; - - if ( typeof part === "string" && !part.match(/\W/) ) { - var nodeCheck = part = isXML ? part : part.toUpperCase(); - checkFn = dirNodeCheck; - } - - checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); - } - }, - find: { - ID: function(match, context, isXML){ - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - return m ? [m] : []; - } - }, - NAME: function(match, context, isXML){ - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], results = context.getElementsByName(match[1]); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - TAG: function(match, context){ - return context.getElementsByTagName(match[1]); - } - }, - preFilter: { - CLASS: function(match, curLoop, inplace, result, not, isXML){ - match = " " + match[1].replace(/\\/g, "") + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) { - if ( !inplace ) - result.push( elem ); - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - ID: function(match){ - return match[1].replace(/\\/g, ""); - }, - TAG: function(match, curLoop){ - for ( var i = 0; curLoop[i] === false; i++ ){} - return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase(); - }, - CHILD: function(match){ - if ( match[1] == "nth" ) { - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( - match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - ATTR: function(match, curLoop, inplace, result, not, isXML){ - var name = match[1].replace(/\\/g, ""); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - PSEUDO: function(match, curLoop, inplace, result, not){ - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - if ( !inplace ) { - result.push.apply( result, ret ); - } - return false; - } - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - POS: function(match){ - match.unshift( true ); - return match; - } - }, - filters: { - enabled: function(elem){ - return elem.disabled === false && elem.type !== "hidden"; - }, - disabled: function(elem){ - return elem.disabled === true; - }, - checked: function(elem){ - return elem.checked === true; - }, - selected: function(elem){ - // Accessing this property makes selected-by-default - // options in Safari work properly - elem.parentNode.selectedIndex; - return elem.selected === true; - }, - parent: function(elem){ - return !!elem.firstChild; - }, - empty: function(elem){ - return !elem.firstChild; - }, - has: function(elem, i, match){ - return !!Sizzle( match[3], elem ).length; - }, - header: function(elem){ - return /h\d/i.test( elem.nodeName ); - }, - text: function(elem){ - return "text" === elem.type; - }, - radio: function(elem){ - return "radio" === elem.type; - }, - checkbox: function(elem){ - return "checkbox" === elem.type; - }, - file: function(elem){ - return "file" === elem.type; - }, - password: function(elem){ - return "password" === elem.type; - }, - submit: function(elem){ - return "submit" === elem.type; - }, - image: function(elem){ - return "image" === elem.type; - }, - reset: function(elem){ - return "reset" === elem.type; - }, - button: function(elem){ - return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON"; - }, - input: function(elem){ - return /input|select|textarea|button/i.test(elem.nodeName); - } - }, - setFilters: { - first: function(elem, i){ - return i === 0; - }, - last: function(elem, i, match, array){ - return i === array.length - 1; - }, - even: function(elem, i){ - return i % 2 === 0; - }, - odd: function(elem, i){ - return i % 2 === 1; - }, - lt: function(elem, i, match){ - return i < match[3] - 0; - }, - gt: function(elem, i, match){ - return i > match[3] - 0; - }, - nth: function(elem, i, match){ - return match[3] - 0 == i; - }, - eq: function(elem, i, match){ - return match[3] - 0 == i; - } - }, - filter: { - PSEUDO: function(elem, match, i, array){ - var name = match[1], filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0; - } else if ( name === "not" ) { - var not = match[3]; - - for ( var i = 0, l = not.length; i < l; i++ ) { - if ( not[i] === elem ) { - return false; - } - } - - return true; - } - }, - CHILD: function(elem, match){ - var type = match[1], node = elem; - switch (type) { - case 'only': - case 'first': - while (node = node.previousSibling) { - if ( node.nodeType === 1 ) return false; - } - if ( type == 'first') return true; - node = elem; - case 'last': - while (node = node.nextSibling) { - if ( node.nodeType === 1 ) return false; - } - return true; - case 'nth': - var first = match[2], last = match[3]; - - if ( first == 1 && last == 0 ) { - return true; - } - - var doneName = match[0], - parent = elem.parentNode; - - if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { - var count = 0; - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - parent.sizcache = doneName; - } - - var diff = elem.nodeIndex - last; - if ( first == 0 ) { - return diff == 0; - } else { - return ( diff % first == 0 && diff / first >= 0 ); - } - } - }, - ID: function(elem, match){ - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - TAG: function(elem, match){ - return (match === "*" && elem.nodeType === 1) || elem.nodeName === match; - }, - CLASS: function(elem, match){ - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - ATTR: function(elem, match){ - var name = match[1], - result = Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value != check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - POS: function(elem, match, i, array){ - var name = match[2], filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS; - -for ( var type in Expr.match ) { - Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); -} - -var makeArray = function(array, results) { - array = Array.prototype.slice.call( array ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -try { - Array.prototype.slice.call( document.documentElement.childNodes ); - -// Provide a fallback method if it does not work -} catch(e){ - makeArray = function(array, results) { - var ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - } else { - if ( typeof array.length === "number" ) { - for ( var i = 0, l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - } else { - for ( var i = 0; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} else if ( "sourceIndex" in document.documentElement ) { - sortOrder = function( a, b ) { - var ret = a.sourceIndex - b.sourceIndex; - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} else if ( document.createRange ) { - sortOrder = function( a, b ) { - var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); - aRange.selectNode(a); - aRange.collapse(true); - bRange.selectNode(b); - bRange.collapse(true); - var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} - -// [vsdoc] The following function has been commented out for IntelliSense. -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -//(function(){ -// // We're going to inject a fake input element with a specified name -// var form = document.createElement("form"), -// id = "script" + (new Date).getTime(); -// form.innerHTML = "<input name='" + id + "'/>"; - -// // Inject it into the root element, check its status, and remove it quickly -// var root = document.documentElement; -// root.insertBefore( form, root.firstChild ); - -// // The workaround has to do additional checks after a getElementById -// // Which slows things down for other browsers (hence the branching) -// if ( !!document.getElementById( id ) ) { -// Expr.find.ID = function(match, context, isXML){ -// if ( typeof context.getElementById !== "undefined" && !isXML ) { -// var m = context.getElementById(match[1]); -// return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; -// } -// }; - -// Expr.filter.ID = function(elem, match){ -// var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); -// return elem.nodeType === 1 && node && node.nodeValue === match; -// }; -// } - -// root.removeChild( form ); -//})(); - -// [vsdoc] The following function has been commented out for IntelliSense. -//(function(){ -// // Check to see if the browser returns only elements -// // when doing getElementsByTagName("*") - -// // Create a fake element -// var div = document.createElement("div"); -// div.appendChild( document.createComment("") ); - -// // Make sure no comments are found -// if ( div.getElementsByTagName("*").length > 0 ) { -// Expr.find.TAG = function(match, context){ -// var results = context.getElementsByTagName(match[1]); - -// // Filter out possible comments -// if ( match[1] === "*" ) { -// var tmp = []; - -// for ( var i = 0; results[i]; i++ ) { -// if ( results[i].nodeType === 1 ) { -// tmp.push( results[i] ); -// } -// } - -// results = tmp; -// } - -// return results; -// }; -// } - -// // Check to see if an attribute returns normalized href attributes -// div.innerHTML = "<a href='#'></a>"; -// if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && -// div.firstChild.getAttribute("href") !== "#" ) { -// Expr.attrHandle.href = function(elem){ -// return elem.getAttribute("href", 2); -// }; -// } -// })(); - -if ( document.querySelectorAll ) (function(){ - var oldSizzle = Sizzle, div = document.createElement("div"); - div.innerHTML = "<p class='TEST'></p>"; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function(query, context, extra, seed){ - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && context.nodeType === 9 && !isXML(context) ) { - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(e){} - } - - return oldSizzle(query, context, extra, seed); - }; - - Sizzle.find = oldSizzle.find; - Sizzle.filter = oldSizzle.filter; - Sizzle.selectors = oldSizzle.selectors; - Sizzle.matches = oldSizzle.matches; -})(); - -if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){ - var div = document.createElement("div"); - div.innerHTML = "<div class='test e'></div><div class='test'></div>"; - - // Opera can't find a second classname (in 9.6) - if ( div.getElementsByClassName("e").length === 0 ) - return; - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) - return; - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function(match, context, isXML) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - var sibDir = dir == "previousSibling" && !isXML; - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - if ( sibDir && elem.nodeType === 1 ){ - elem.sizcache = doneName; - elem.sizset = i; - } - elem = elem[dir]; - var match = false; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem.sizcache = doneName; - elem.sizset = i; - } - - if ( elem.nodeName === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - var sibDir = dir == "previousSibling" && !isXML; - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - if ( sibDir && elem.nodeType === 1 ) { - elem.sizcache = doneName; - elem.sizset = i; - } - elem = elem[dir]; - var match = false; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem.sizcache = doneName; - elem.sizset = i; - } - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -var contains = document.compareDocumentPosition ? function(a, b){ - return a.compareDocumentPosition(b) & 16; -} : function(a, b){ - return a !== b && (a.contains ? a.contains(b) : true); -}; - -var isXML = function(elem){ - return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || - !!elem.ownerDocument && isXML( elem.ownerDocument ); -}; - -var posProcess = function(selector, context){ - var tmpSet = [], later = "", match, - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE -jQuery.find = Sizzle; -jQuery.filter = Sizzle.filter; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; - -Sizzle.selectors.filters.hidden = function(elem){ - return elem.offsetWidth === 0 || elem.offsetHeight === 0; -}; - -Sizzle.selectors.filters.visible = function(elem){ - return elem.offsetWidth > 0 || elem.offsetHeight > 0; -}; - -Sizzle.selectors.filters.animated = function(elem){ - return jQuery.grep(jQuery.timers, function(fn){ - return elem === fn.elem; - }).length; -}; - -jQuery.multiFilter = function( expr, elems, not ) { - /// <summary> - /// This member is internal only. - /// </summary> - /// <private /> - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return Sizzle.matches(expr, elems); -}; - -jQuery.dir = function( elem, dir ){ - /// <summary> - /// This member is internal only. - /// </summary> - /// <private /> - // This member is not documented in the jQuery API: http://docs.jquery.com/Special:Search?ns0=1&search=dir - var matched = [], cur = elem[dir]; - while ( cur && cur != document ) { - if ( cur.nodeType == 1 ) - matched.push( cur ); - cur = cur[dir]; - } - return matched; -}; - -jQuery.nth = function(cur, result, dir, elem){ - /// <summary> - /// This member is internal only. - /// </summary> - /// <private /> - // This member is not documented in the jQuery API: http://docs.jquery.com/Special:Search?ns0=1&search=nth - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) - if ( cur.nodeType == 1 && ++num == result ) - break; - - return cur; -}; - -jQuery.sibling = function(n, elem){ - /// <summary> - /// This member is internal only. - /// </summary> - /// <private /> - // This member is not documented in the jQuery API: http://docs.jquery.com/Special:Search?ns0=1&search=nth - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType == 1 && n != elem ) - r.push( n ); - } - - return r; -}; - -return; - -window.Sizzle = Sizzle; - -})(); -/* - * A number of helper functions used for managing events. - * Many of the ideas behind this code originated from - * Dean Edwards' addEvent library. - */ -jQuery.event = { - - // Bind an event to an element - // Original by Dean Edwards - add: function(elem, types, handler, data) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - if ( elem.nodeType == 3 || elem.nodeType == 8 ) - return; - - // For whatever reason, IE has trouble passing the window object - // around, causing it to be cloned in the process - if ( elem.setInterval && elem != window ) - elem = window; - - // Make sure that the function being executed has a unique ID - if ( !handler.guid ) - handler.guid = this.guid++; - - // if data is passed, bind to handler - if ( data !== undefined ) { - // Create temporary function pointer to original handler - var fn = handler; - - // Create unique handler function, wrapped around original handler - handler = this.proxy( fn ); - - // Store data in unique handler - handler.data = data; - } - - // Init the element's event structure - var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}), - handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){ - // Handle the second event of a trigger and when - // an event is called after a page has unloaded - return typeof jQuery !== "undefined" && !jQuery.event.triggered ? - jQuery.event.handle.apply(arguments.callee.elem, arguments) : - undefined; - }); - // Add elem as a property of the handle function - // This is to prevent a memory leak with non-native - // event in IE. - handle.elem = elem; - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - jQuery.each(types.split(/\s+/), function(index, type) { - // Namespaced event handlers - var namespaces = type.split("."); - type = namespaces.shift(); - handler.type = namespaces.slice().sort().join("."); - - // Get the current list of functions bound to this event - var handlers = events[type]; - - if ( jQuery.event.specialAll[type] ) - jQuery.event.specialAll[type].setup.call(elem, data, namespaces); - - // Init the event handler queue - if (!handlers) { - handlers = events[type] = {}; - - // Check for a special event handler - // Only use addEventListener/attachEvent if the special - // events handler returns false - if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) { - // Bind the global event handler to the element - if (elem.addEventListener) - elem.addEventListener(type, handle, false); - else if (elem.attachEvent) - elem.attachEvent("on" + type, handle); - } - } - - // Add the function to the element's handler list - handlers[handler.guid] = handler; - - // Keep track of which events have been used, for global triggering - jQuery.event.global[type] = true; - }); - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - guid: 1, - global: {}, - - // Detach an event or set of events from an element - remove: function(elem, types, handler) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - // don't do events on text and comment nodes - if ( elem.nodeType == 3 || elem.nodeType == 8 ) - return; - - var events = jQuery.data(elem, "events"), ret, index; - - if ( events ) { - // Unbind all events for the element - if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") ) - for ( var type in events ) - this.remove( elem, type + (types || "") ); - else { - // types is actually an event object here - if ( types.type ) { - handler = types.handler; - types = types.type; - } - - // Handle multiple events seperated by a space - // jQuery(...).unbind("mouseover mouseout", fn); - jQuery.each(types.split(/\s+/), function(index, type){ - // Namespaced event handlers - var namespaces = type.split("."); - type = namespaces.shift(); - var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); - - if ( events[type] ) { - // remove the given handler for the given type - if ( handler ) - delete events[type][handler.guid]; - - // remove all handlers for the given type - else - for ( var handle in events[type] ) - // Handle the removal of namespaced events - if ( namespace.test(events[type][handle].type) ) - delete events[type][handle]; - - if ( jQuery.event.specialAll[type] ) - jQuery.event.specialAll[type].teardown.call(elem, namespaces); - - // remove generic event handler if no more handlers exist - for ( ret in events[type] ) break; - if ( !ret ) { - if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) { - if (elem.removeEventListener) - elem.removeEventListener(type, jQuery.data(elem, "handle"), false); - else if (elem.detachEvent) - elem.detachEvent("on" + type, jQuery.data(elem, "handle")); - } - ret = null; - delete events[type]; - } - } - }); - } - - // Remove the expando if it's no longer used - for ( ret in events ) break; - if ( !ret ) { - var handle = jQuery.data( elem, "handle" ); - if ( handle ) handle.elem = null; - jQuery.removeData( elem, "events" ); - jQuery.removeData( elem, "handle" ); - } - } - }, - - // bubbling is internal - trigger: function( event, data, elem, bubbling ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - // Event object or event type - var type = event.type || event; - - if( !bubbling ){ - event = typeof event === "object" ? - // jQuery.Event object - event[expando] ? event : - // Object literal - jQuery.extend( jQuery.Event(type), event ) : - // Just the event type (string) - jQuery.Event(type); - - if ( type.indexOf("!") >= 0 ) { - event.type = type = type.slice(0, -1); - event.exclusive = true; - } - - // Handle a global trigger - if ( !elem ) { - // Don't bubble custom events when global (to avoid too much overhead) - event.stopPropagation(); - // Only trigger if we've ever bound an event for it - if ( this.global[type] ) - jQuery.each( jQuery.cache, function(){ - if ( this.events && this.events[type] ) - jQuery.event.trigger( event, data, this.handle.elem ); - }); - } - - // Handle triggering a single element - - // don't do events on text and comment nodes - if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 ) - return undefined; - - // Clean up in case it is reused - event.result = undefined; - event.target = elem; - - // Clone the incoming data, if any - data = jQuery.makeArray(data); - data.unshift( event ); - } - - event.currentTarget = elem; - - // Trigger the event, it is assumed that "handle" is a function - var handle = jQuery.data(elem, "handle"); - if ( handle ) - handle.apply( elem, data ); - - // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links) - if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false ) - event.result = false; - - // Trigger the native events (except for clicks on links) - if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) { - this.triggered = true; - try { - elem[ type ](); - // prevent IE from throwing an error for some hidden elements - } catch (e) {} - } - - this.triggered = false; - - if ( !event.isPropagationStopped() ) { - var parent = elem.parentNode || elem.ownerDocument; - if ( parent ) - jQuery.event.trigger(event, data, parent, true); - } - }, - - handle: function(event) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - // returned undefined or false - var all, handlers; - - event = arguments[0] = jQuery.event.fix( event || window.event ); - event.currentTarget = this; - - // Namespaced event handlers - var namespaces = event.type.split("."); - event.type = namespaces.shift(); - - // Cache this now, all = true means, any handler - all = !namespaces.length && !event.exclusive; - - var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); - - handlers = ( jQuery.data(this, "events") || {} )[event.type]; - - for ( var j in handlers ) { - var handler = handlers[j]; - - // Filter the functions by class - if ( all || namespace.test(handler.type) ) { - // Pass in a reference to the handler function itself - // So that we can later remove it - event.handler = handler; - event.data = handler.data; - - var ret = handler.apply(this, arguments); - - if( ret !== undefined ){ - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - - if( event.isImmediatePropagationStopped() ) - break; - - } - } - }, - - props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), - - fix: function(event) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - if ( event[expando] ) - return event; - - // store a copy of the original event object - // and "clone" to set read-only properties - var originalEvent = event; - event = jQuery.Event( originalEvent ); - - for ( var i = this.props.length, prop; i; ){ - prop = this.props[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary - if ( !event.target ) - event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either - - // check if target is a textnode (safari) - if ( event.target.nodeType == 3 ) - event.target = event.target.parentNode; - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && event.fromElement ) - event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && event.clientX != null ) { - var doc = document.documentElement, body = document.body; - event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0); - event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0); - } - - // Add which for key events - if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) - event.which = event.charCode || event.keyCode; - - // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) - if ( !event.metaKey && event.ctrlKey ) - event.metaKey = event.ctrlKey; - - // Add which for click: 1 == left; 2 == middle; 3 == right - // Note: button is not normalized, so don't use it - if ( !event.which && event.button ) - event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); - - return event; - }, - - proxy: function( fn, proxy ){ - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - proxy = proxy || function(){ return fn.apply(this, arguments); }; - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++; - // So proxy can be declared as an argument - return proxy; - }, - - special: { - ready: { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - // Make sure the ready event is setup - setup: bindReady, - teardown: function() {} - } - }, - - specialAll: { - live: { - setup: function( selector, namespaces ){ - jQuery.event.add( this, namespaces[0], liveHandler ); - }, - teardown: function( namespaces ){ - if ( namespaces.length ) { - var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)"); - - jQuery.each( (jQuery.data(this, "events").live || {}), function(){ - if ( name.test(this.type) ) - remove++; - }); - - if ( remove < 1 ) - jQuery.event.remove( this, namespaces[0], liveHandler ); - } - } - } - } -}; - -jQuery.Event = function( src ){ - // Allow instantiation without the 'new' keyword - if( !this.preventDefault ) - return new jQuery.Event(src); - - // Event object - if( src && src.type ){ - this.originalEvent = src; - this.type = src.type; - // Event type - }else - this.type = src; - - // timeStamp is buggy for some events on Firefox(#3843) - // So we won't rely on the native value - this.timeStamp = now(); - - // Mark it as fixed - this[expando] = true; -}; - -function returnFalse(){ - return false; -} -function returnTrue(){ - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if( !e ) - return; - // if preventDefault exists run it on the original event - if (e.preventDefault) - e.preventDefault(); - // otherwise set the returnValue property of the original event to false (IE) - e.returnValue = false; - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if( !e ) - return; - // if stopPropagation exists run it on the original event - if (e.stopPropagation) - e.stopPropagation(); - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation:function(){ - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; -// Checks if an event happened on an element within another element -// Used in jQuery.event.special.mouseenter and mouseleave handlers -var withinElement = function(event) { - // Check if mouse(over|out) are still within the same parent element - var parent = event.relatedTarget; - // Traverse up the tree - while ( parent && parent != this ) - try { parent = parent.parentNode; } - catch(e) { parent = this; } - - if( parent != this ){ - // set the correct event type - event.type = event.data; - // handle event if we actually just moused on to a non sub-element - jQuery.event.handle.apply( this, arguments ); - } -}; - -jQuery.each({ - mouseover: 'mouseenter', - mouseout: 'mouseleave' -}, function( orig, fix ){ - jQuery.event.special[ fix ] = { - setup: function(){ - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - jQuery.event.add( this, orig, withinElement, fix ); - }, - teardown: function(){ - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - jQuery.event.remove( this, orig, withinElement ); - } - }; -}); - -jQuery.fn.extend({ - bind: function( type, data, fn ) { - /// <summary> - /// Binds a handler to one or more events for each matched element. Can also bind custom events. - /// </summary> - /// <param name="type" type="String">One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error .</param> - /// <param name="data" optional="true" type="Object">Additional data passed to the event handler as event.data</param> - /// <param name="fn" type="Function">A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element.</param> - - return type == "unload" ? this.one(type, data, fn) : this.each(function(){ - jQuery.event.add( this, type, fn || data, fn && data ); - }); - }, - - one: function( type, data, fn ) { - /// <summary> - /// Binds a handler to one or more events to be executed exactly once for each matched element. - /// </summary> - /// <param name="type" type="String">One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error .</param> - /// <param name="data" optional="true" type="Object">Additional data passed to the event handler as event.data</param> - /// <param name="fn" type="Function">A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element.</param> - - var one = jQuery.event.proxy( fn || data, function(event) { - jQuery(this).unbind(event, one); - return (fn || data).apply( this, arguments ); - }); - return this.each(function(){ - jQuery.event.add( this, type, one, fn && data); - }); - }, - - unbind: function( type, fn ) { - /// <summary> - /// Unbinds a handler from one or more events for each matched element. - /// </summary> - /// <param name="type" type="String">One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error .</param> - /// <param name="fn" type="Function">A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element.</param> - - return this.each(function(){ - jQuery.event.remove( this, type, fn ); - }); - }, - - trigger: function( type, data ) { - /// <summary> - /// Triggers a type of event on every matched element. - /// </summary> - /// <param name="type" type="String">One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error .</param> - /// <param name="data" optional="true" type="Array">Additional data passed to the event handler as additional arguments.</param> - /// <param name="fn" type="Function">This parameter is undocumented.</param> - - return this.each(function(){ - jQuery.event.trigger( type, data, this ); - }); - }, - - triggerHandler: function( type, data ) { - /// <summary> - /// Triggers all bound event handlers on an element for a specific event type without executing the browser's default actions. - /// </summary> - /// <param name="type" type="String">One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error .</param> - /// <param name="data" optional="true" type="Array">Additional data passed to the event handler as additional arguments.</param> - /// <param name="fn" type="Function">This parameter is undocumented.</param> - - if( this[0] ){ - var event = jQuery.Event(type); - event.preventDefault(); - event.stopPropagation(); - jQuery.event.trigger( event, data, this[0] ); - return event.result; - } - }, - - toggle: function( fn ) { - /// <summary> - /// Toggles among two or more function calls every other click. - /// </summary> - /// <param name="fn" type="Function">The functions among which to toggle execution</param> - - // Save reference to arguments for access in closure - var args = arguments, i = 1; - - // link all the functions, so any of them can unbind this click handler - while( i < args.length ) - jQuery.event.proxy( fn, args[i++] ); - - return this.click( jQuery.event.proxy( fn, function(event) { - // Figure out which function to execute - this.lastToggle = ( this.lastToggle || 0 ) % i; - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ this.lastToggle++ ].apply( this, arguments ) || false; - })); - }, - - hover: function(fnOver, fnOut) { - /// <summary> - /// Simulates hovering (moving the mouse on or off of an object). - /// </summary> - /// <param name="fnOver" type="Function">The function to fire when the mouse is moved over a matched element.</param> - /// <param name="fnOut" type="Function">The function to fire when the mouse is moved off of a matched element.</param> - - return this.mouseenter(fnOver).mouseleave(fnOut); - }, - - ready: function(fn) { - /// <summary> - /// Binds a function to be executed whenever the DOM is ready to be traversed and manipulated. - /// </summary> - /// <param name="fn" type="Function">The function to be executed when the DOM is ready.</param> - - // Attach the listeners - bindReady(); - - // If the DOM is already ready - if ( jQuery.isReady ) - // Execute the function immediately - fn.call( document, jQuery ); - - // Otherwise, remember the function for later - else - // Add the function to the wait list - jQuery.readyList.push( fn ); - - return this; - }, - - live: function( type, fn ){ - /// <summary> - /// Binds a handler to an event (like click) for all current - and future - matched element. Can also bind custom events. - /// </summary> - /// <param name="type" type="String">An event type</param> - /// <param name="fn" type="Function">A function to bind to the event on each of the set of matched elements</param> - - var proxy = jQuery.event.proxy( fn ); - proxy.guid += this.selector + type; - - jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy ); - - return this; - }, - - die: function( type, fn ){ - /// <summary> - /// This does the opposite of live, it removes a bound live event. - /// You can also unbind custom events registered with live. - /// If the type is provided, all bound live events of that type are removed. - /// If the function that was passed to live is provided as the second argument, only that specific event handler is removed. - /// </summary> - /// <param name="type" type="String">A live event type to unbind.</param> - /// <param name="fn" type="Function">A function to unbind from the event on each of the set of matched elements.</param> - - jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null ); - return this; - } -}); - -function liveHandler( event ){ - var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"), - stop = true, - elems = []; - - jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){ - if ( check.test(fn.type) ) { - var elem = jQuery(event.target).closest(fn.data)[0]; - if ( elem ) - elems.push({ elem: elem, fn: fn }); - } - }); - - elems.sort(function(a,b) { - return jQuery.data(a.elem, "closest") - jQuery.data(b.elem, "closest"); - }); - - jQuery.each(elems, function(){ - if ( this.fn.call(this.elem, event, this.fn.data) === false ) - return (stop = false); - }); - - return stop; -} - -function liveConvert(type, selector){ - return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join("."); -} - -jQuery.extend({ - isReady: false, - readyList: [], - // Handle when the DOM is ready - ready: function() { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - // Make sure that the DOM is not already loaded - if ( !jQuery.isReady ) { - // Remember that the DOM is ready - jQuery.isReady = true; - - // If there are functions bound, to execute - if ( jQuery.readyList ) { - // Execute all of them - jQuery.each( jQuery.readyList, function(){ - this.call( document, jQuery ); - }); - - // Reset the list of functions - jQuery.readyList = null; - } - - // Trigger any bound ready events - jQuery(document).triggerHandler("ready"); - } - } -}); - -var readyBound = false; - -function bindReady(){ - if ( readyBound ) return; - readyBound = true; - - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", function(){ - document.removeEventListener( "DOMContentLoaded", arguments.callee, false ); - jQuery.ready(); - }, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent("onreadystatechange", function(){ - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", arguments.callee ); - jQuery.ready(); - } - }); - - // If IE and not an iframe - // continually check to see if the document is ready - if ( document.documentElement.doScroll && window == window.top ) (function(){ - if ( jQuery.isReady ) return; - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch( error ) { - setTimeout( arguments.callee, 0 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); - })(); - } - - // A fallback to window.onload, that will always work - jQuery.event.add( window, "load", jQuery.ready ); -} - -// [vsdoc] The following section has been denormalized from original sources for IntelliSense. - -jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," + - "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," + - "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){ - - // Handle event binding - jQuery.fn[name] = function(fn){ - return fn ? this.bind(name, fn) : this.trigger(name); - }; -}); - -jQuery.fn["blur"] = function(fn) { - /// <summary> - /// 1: blur() - Triggers the blur event of each matched element. - /// 2: blur(fn) - Binds a function to the blur event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("blur", fn) : this.trigger(name); -}; - -jQuery.fn["focus"] = function(fn) { - /// <summary> - /// 1: focus() - Triggers the focus event of each matched element. - /// 2: focus(fn) - Binds a function to the focus event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("focus", fn) : this.trigger(name); -}; - -jQuery.fn["load"] = function(fn) { - /// <summary> - /// 1: load() - Triggers the load event of each matched element. - /// 2: load(fn) - Binds a function to the load event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("load", fn) : this.trigger(name); -}; - -jQuery.fn["resize"] = function(fn) { - /// <summary> - /// 1: resize() - Triggers the resize event of each matched element. - /// 2: resize(fn) - Binds a function to the resize event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("resize", fn) : this.trigger(name); -}; - -jQuery.fn["scroll"] = function(fn) { - /// <summary> - /// 1: scroll() - Triggers the scroll event of each matched element. - /// 2: scroll(fn) - Binds a function to the scroll event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("scroll", fn) : this.trigger(name); -}; - -jQuery.fn["unload"] = function(fn) { - /// <summary> - /// 1: unload() - Triggers the unload event of each matched element. - /// 2: unload(fn) - Binds a function to the unload event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("unload", fn) : this.trigger(name); -}; - -jQuery.fn["click"] = function(fn) { - /// <summary> - /// 1: click() - Triggers the click event of each matched element. - /// 2: click(fn) - Binds a function to the click event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("click", fn) : this.trigger(name); -}; - -jQuery.fn["dblclick"] = function(fn) { - /// <summary> - /// 1: dblclick() - Triggers the dblclick event of each matched element. - /// 2: dblclick(fn) - Binds a function to the dblclick event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("dblclick", fn) : this.trigger(name); -}; - -jQuery.fn["mousedown"] = function(fn) { - /// <summary> - /// Binds a function to the mousedown event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("mousedown", fn) : this.trigger(name); -}; - -jQuery.fn["mouseup"] = function(fn) { - /// <summary> - /// Bind a function to the mouseup event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("mouseup", fn) : this.trigger(name); -}; - -jQuery.fn["mousemove"] = function(fn) { - /// <summary> - /// Bind a function to the mousemove event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("mousemove", fn) : this.trigger(name); -}; - -jQuery.fn["mouseover"] = function(fn) { - /// <summary> - /// Bind a function to the mouseover event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("mouseover", fn) : this.trigger(name); -}; - -jQuery.fn["mouseout"] = function(fn) { - /// <summary> - /// Bind a function to the mouseout event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("mouseout", fn) : this.trigger(name); -}; - -jQuery.fn["mouseenter"] = function(fn) { - /// <summary> - /// Bind a function to the mouseenter event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("mouseenter", fn) : this.trigger(name); -}; - -jQuery.fn["mouseleave"] = function(fn) { - /// <summary> - /// Bind a function to the mouseleave event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("mouseleave", fn) : this.trigger(name); -}; - -jQuery.fn["change"] = function(fn) { - /// <summary> - /// 1: change() - Triggers the change event of each matched element. - /// 2: change(fn) - Binds a function to the change event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("change", fn) : this.trigger(name); -}; - -jQuery.fn["select"] = function(fn) { - /// <summary> - /// 1: select() - Triggers the select event of each matched element. - /// 2: select(fn) - Binds a function to the select event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("select", fn) : this.trigger(name); -}; - -jQuery.fn["submit"] = function(fn) { - /// <summary> - /// 1: submit() - Triggers the submit event of each matched element. - /// 2: submit(fn) - Binds a function to the submit event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("submit", fn) : this.trigger(name); -}; - -jQuery.fn["keydown"] = function(fn) { - /// <summary> - /// 1: keydown() - Triggers the keydown event of each matched element. - /// 2: keydown(fn) - Binds a function to the keydown event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("keydown", fn) : this.trigger(name); -}; - -jQuery.fn["keypress"] = function(fn) { - /// <summary> - /// 1: keypress() - Triggers the keypress event of each matched element. - /// 2: keypress(fn) - Binds a function to the keypress event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("keypress", fn) : this.trigger(name); -}; - -jQuery.fn["keyup"] = function(fn) { - /// <summary> - /// 1: keyup() - Triggers the keyup event of each matched element. - /// 2: keyup(fn) - Binds a function to the keyup event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("keyup", fn) : this.trigger(name); -}; - -jQuery.fn["error"] = function(fn) { - /// <summary> - /// 1: error() - Triggers the error event of each matched element. - /// 2: error(fn) - Binds a function to the error event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("error", fn) : this.trigger(name); -}; - -// Prevent memory leaks in IE -// And prevent errors on refresh with events like mouseover in other browsers -// Window isn't included so as not to unbind existing unload events -jQuery( window ).bind( 'unload', function(){ - for ( var id in jQuery.cache ) - // Skip the window - if ( id != 1 && jQuery.cache[ id ].handle ) - jQuery.event.remove( jQuery.cache[ id ].handle.elem ); -}); - -// [vsdoc] The following function has been commented out for IntelliSense. -//(function(){ - -// jQuery.support = {}; - -// var root = document.documentElement, -// script = document.createElement("script"), -// div = document.createElement("div"), -// id = "script" + (new Date).getTime(); - -// div.style.display = "none"; -// -// div.innerHTML = ' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>'; - -// var all = div.getElementsByTagName("*"), -// a = div.getElementsByTagName("a")[0]; - -// // Can't get basic test support -// if ( !all || !all.length || !a ) { -// return; -// } - -// jQuery.support = { -// // IE strips leading whitespace when .innerHTML is used -// leadingWhitespace: div.firstChild.nodeType == 3, -// -// // Make sure that tbody elements aren't automatically inserted -// // IE will insert them into empty tables -// tbody: !div.getElementsByTagName("tbody").length, -// -// // Make sure that you can get all elements in an <object> element -// // IE 7 always returns no results -// objectAll: !!div.getElementsByTagName("object")[0] -// .getElementsByTagName("*").length, -// -// // Make sure that link elements get serialized correctly by innerHTML -// // This requires a wrapper element in IE -// htmlSerialize: !!div.getElementsByTagName("link").length, -// -// // Get the style information from getAttribute -// // (IE uses .cssText insted) -// style: /red/.test( a.getAttribute("style") ), -// -// // Make sure that URLs aren't manipulated -// // (IE normalizes it by default) -// hrefNormalized: a.getAttribute("href") === "/a", -// -// // Make sure that element opacity exists -// // (IE uses filter instead) -// opacity: a.style.opacity === "0.5", -// -// // Verify style float existence -// // (IE uses styleFloat instead of cssFloat) -// cssFloat: !!a.style.cssFloat, - -// // Will be defined later -// scriptEval: false, -// noCloneEvent: true, -// boxModel: null -// }; -// -// script.type = "text/javascript"; -// try { -// script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); -// } catch(e){} - -// root.insertBefore( script, root.firstChild ); -// -// // Make sure that the execution of code works by injecting a script -// // tag with appendChild/createTextNode -// // (IE doesn't support this, fails, and uses .text instead) -// if ( window[ id ] ) { -// jQuery.support.scriptEval = true; -// delete window[ id ]; -// } - -// root.removeChild( script ); - -// if ( div.attachEvent && div.fireEvent ) { -// div.attachEvent("onclick", function(){ -// // Cloning a node shouldn't copy over any -// // bound event handlers (IE does this) -// jQuery.support.noCloneEvent = false; -// div.detachEvent("onclick", arguments.callee); -// }); -// div.cloneNode(true).fireEvent("onclick"); -// } - -// // Figure out if the W3C box model works as expected -// // document.body must exist before we can do this -// jQuery(function(){ -// var div = document.createElement("div"); -// div.style.width = div.style.paddingLeft = "1px"; - -// document.body.appendChild( div ); -// jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; -// document.body.removeChild( div ).style.display = 'none'; -// }); -//})(); - -// [vsdoc] The following function has been modified for IntelliSense. -// var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat"; -var styleFloat = "cssFloat"; - - -jQuery.props = { - "for": "htmlFor", - "class": "className", - "float": styleFloat, - cssFloat: styleFloat, - styleFloat: styleFloat, - readonly: "readOnly", - maxlength: "maxLength", - cellspacing: "cellSpacing", - rowspan: "rowSpan", - tabindex: "tabIndex" -}; -jQuery.fn.extend({ - // Keep a copy of the old load - _load: jQuery.fn.load, - - load: function( url, params, callback ) { - /// <summary> - /// Loads HTML from a remote file and injects it into the DOM. By default performs a GET request, but if parameters are included - /// then a POST will be performed. - /// </summary> - /// <param name="url" type="String">The URL of the HTML page to load.</param> - /// <param name="data" optional="true" type="Map">Key/value pairs that will be sent to the server.</param> - /// <param name="callback" optional="true" type="Function">The function called when the AJAX request is complete. It should map function(responseText, textStatus, XMLHttpRequest) such that this maps the injected DOM element.</param> - /// <returns type="jQuery" /> - - if ( typeof url !== "string" ) - return this._load( url ); - - var off = url.indexOf(" "); - if ( off >= 0 ) { - var selector = url.slice(off, url.length); - url = url.slice(0, off); - } - - // Default to a GET request - var type = "GET"; - - // If the second parameter was provided - if ( params ) - // If it's a function - if ( jQuery.isFunction( params ) ) { - // We assume that it's the callback - callback = params; - params = null; - - // Otherwise, build a param string - } else if( typeof params === "object" ) { - params = jQuery.param( params ); - type = "POST"; - } - - var self = this; - - // Request the remote document - jQuery.ajax({ - url: url, - type: type, - dataType: "html", - data: params, - complete: function(res, status){ - // If successful, inject the HTML into all the matched elements - if ( status == "success" || status == "notmodified" ) - // See if a selector was specified - self.html( selector ? - // Create a dummy div to hold the results - jQuery("<div/>") - // inject the contents of the document in, removing the scripts - // to avoid any 'Permission Denied' errors in IE - .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, "")) - - // Locate the specified elements - .find(selector) : - - // If not, just inject the full result - res.responseText ); - - if( callback ) - self.each( callback, [res.responseText, status, res] ); - } - }); - return this; - }, - - serialize: function() { - /// <summary> - /// Serializes a set of input elements into a string of data. - /// </summary> - /// <returns type="String">The serialized result</returns> - - return jQuery.param(this.serializeArray()); - }, - serializeArray: function() { - /// <summary> - /// Serializes all forms and form elements but returns a JSON data structure. - /// </summary> - /// <returns type="String">A JSON data structure representing the serialized items.</returns> - - return this.map(function(){ - return this.elements ? jQuery.makeArray(this.elements) : this; - }) - .filter(function(){ - return this.name && !this.disabled && - (this.checked || /select|textarea/i.test(this.nodeName) || - /text|hidden|password|search/i.test(this.type)); - }) - .map(function(i, elem){ - var val = jQuery(this).val(); - return val == null ? null : - jQuery.isArray(val) ? - jQuery.map( val, function(val, i){ - return {name: elem.name, value: val}; - }) : - {name: elem.name, value: val}; - }).get(); - } -}); - -// [vsdoc] The following section has been denormalized from original sources for IntelliSense. -// Attach a bunch of functions for handling common AJAX events -// jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){ -// jQuery.fn[o] = function(f){ -// return this.bind(o, f); -// }; -// }); - -jQuery.fn["ajaxStart"] = function(callback) { - /// <summary> - /// Attach a function to be executed whenever an AJAX request begins and there is none already active. This is an Ajax Event. - /// </summary> - /// <param name="callback" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return this.bind("ajaxStart", f); -}; - -jQuery.fn["ajaxStop"] = function(callback) { - /// <summary> - /// Attach a function to be executed whenever all AJAX requests have ended. This is an Ajax Event. - /// </summary> - /// <param name="callback" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return this.bind("ajaxStop", f); -}; - -jQuery.fn["ajaxComplete"] = function(callback) { - /// <summary> - /// Attach a function to be executed whenever an AJAX request completes. This is an Ajax Event. - /// </summary> - /// <param name="callback" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return this.bind("ajaxComplete", f); -}; - -jQuery.fn["ajaxError"] = function(callback) { - /// <summary> - /// Attach a function to be executed whenever an AJAX request fails. This is an Ajax Event. - /// </summary> - /// <param name="callback" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return this.bind("ajaxError", f); -}; - -jQuery.fn["ajaxSuccess"] = function(callback) { - /// <summary> - /// Attach a function to be executed whenever an AJAX request completes successfully. This is an Ajax Event. - /// </summary> - /// <param name="callback" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return this.bind("ajaxSuccess", f); -}; - -jQuery.fn["ajaxSend"] = function(callback) { - /// <summary> - /// Attach a function to be executed before an AJAX request is sent. This is an Ajax Event. - /// </summary> - /// <param name="callback" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return this.bind("ajaxSend", f); -}; - - -var jsc = now(); - -jQuery.extend({ - - get: function( url, data, callback, type ) { - /// <summary> - /// Loads a remote page using an HTTP GET request. - /// </summary> - /// <param name="url" type="String">The URL of the HTML page to load.</param> - /// <param name="data" optional="true" type="Map">Key/value pairs that will be sent to the server.</param> - /// <param name="callback" optional="true" type="Function">The function called when the AJAX request is complete. It should map function(responseText, textStatus) such that this maps the options for this AJAX request.</param> - /// <param name="type" optional="true" type="String">Type of data to be returned to callback function. Valid valiues are xml, html, script, json, text, _default.</param> - /// <returns type="XMLHttpRequest" /> - - // shift arguments if data argument was ommited - if ( jQuery.isFunction( data ) ) { - callback = data; - data = null; - } - - return jQuery.ajax({ - type: "GET", - url: url, - data: data, - success: callback, - dataType: type - }); - }, - - getScript: function( url, callback ) { - /// <summary> - /// Loads and executes a local JavaScript file using an HTTP GET request. - /// </summary> - /// <param name="url" type="String">The URL of the script to load.</param> - /// <param name="callback" optional="true" type="Function">The function called when the AJAX request is complete. It should map function(data, textStatus) such that this maps the options for the AJAX request.</param> - /// <returns type="XMLHttpRequest" /> - - return jQuery.get(url, null, callback, "script"); - }, - - getJSON: function( url, data, callback ) { - /// <summary> - /// Loads JSON data using an HTTP GET request. - /// </summary> - /// <param name="url" type="String">The URL of the JSON data to load.</param> - /// <param name="data" optional="true" type="Map">Key/value pairs that will be sent to the server.</param> - /// <param name="callback" optional="true" type="Function">The function called when the AJAX request is complete if the data is loaded successfully. It should map function(data, textStatus) such that this maps the options for this AJAX request.</param> - /// <returns type="XMLHttpRequest" /> - - return jQuery.get(url, data, callback, "json"); - }, - - post: function( url, data, callback, type ) { - /// <summary> - /// Loads a remote page using an HTTP POST request. - /// </summary> - /// <param name="url" type="String">The URL of the HTML page to load.</param> - /// <param name="data" optional="true" type="Map">Key/value pairs that will be sent to the server.</param> - /// <param name="callback" optional="true" type="Function">The function called when the AJAX request is complete. It should map function(responseText, textStatus) such that this maps the options for this AJAX request.</param> - /// <param name="type" optional="true" type="String">Type of data to be returned to callback function. Valid valiues are xml, html, script, json, text, _default.</param> - /// <returns type="XMLHttpRequest" /> - - if ( jQuery.isFunction( data ) ) { - callback = data; - data = {}; - } - - return jQuery.ajax({ - type: "POST", - url: url, - data: data, - success: callback, - dataType: type - }); - }, - - ajaxSetup: function( settings ) { - /// <summary> - /// Sets up global settings for AJAX requests. - /// </summary> - /// <param name="settings" type="Options">A set of key/value pairs that configure the default Ajax request.</param> - - jQuery.extend( jQuery.ajaxSettings, settings ); - }, - - ajaxSettings: { - url: location.href, - global: true, - type: "GET", - contentType: "application/x-www-form-urlencoded", - processData: true, - async: true, - /* - timeout: 0, - data: null, - username: null, - password: null, - */ - // Create the request object; Microsoft failed to properly - // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available - // This function can be overriden by calling jQuery.ajaxSetup - xhr:function(){ - return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); - }, - accepts: { - xml: "application/xml, text/xml", - html: "text/html", - script: "text/javascript, application/javascript", - json: "application/json, text/javascript", - text: "text/plain", - _default: "*/*" - } - }, - - // Last-Modified header cache for next request - lastModified: {}, - - ajax: function( s ) { - /// <summary> - /// Load a remote page using an HTTP request. - /// </summary> - /// <private /> - - // Extend the settings, but re-extend 's' so that it can be - // checked again later (in the test suite, specifically) - s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s)); - - var jsonp, jsre = /=\?(&|$)/g, status, data, - type = s.type.toUpperCase(); - - // convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) - s.data = jQuery.param(s.data); - - // Handle JSONP Parameter Callbacks - if ( s.dataType == "jsonp" ) { - if ( type == "GET" ) { - if ( !s.url.match(jsre) ) - s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?"; - } else if ( !s.data || !s.data.match(jsre) ) - s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?"; - s.dataType = "json"; - } - - // Build temporary JSONP function - if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) { - jsonp = "jsonp" + jsc++; - - // Replace the =? sequence both in the query string and the data - if ( s.data ) - s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1"); - s.url = s.url.replace(jsre, "=" + jsonp + "$1"); - - // We need to make sure - // that a JSONP style response is executed properly - s.dataType = "script"; - - // Handle JSONP-style loading - window[ jsonp ] = function(tmp){ - data = tmp; - success(); - complete(); - // Garbage collect - window[ jsonp ] = undefined; - try{ delete window[ jsonp ]; } catch(e){} - if ( head ) - head.removeChild( script ); - }; - } - - if ( s.dataType == "script" && s.cache == null ) - s.cache = false; - - if ( s.cache === false && type == "GET" ) { - var ts = now(); - // try replacing _= if it is there - var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2"); - // if nothing was replaced, add timestamp to the end - s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : ""); - } - - // If data is available, append data to url for get requests - if ( s.data && type == "GET" ) { - s.url += (s.url.match(/\?/) ? "&" : "?") + s.data; - - // IE likes to send both get and post data, prevent this - s.data = null; - } - - // Watch for a new set of requests - if ( s.global && ! jQuery.active++ ) - jQuery.event.trigger( "ajaxStart" ); - - // Matches an absolute URL, and saves the domain - var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url ); - - // If we're requesting a remote document - // and trying to load JSON or Script with a GET - if ( s.dataType == "script" && type == "GET" && parts - && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){ - - var head = document.getElementsByTagName("head")[0]; - var script = document.createElement("script"); - script.src = s.url; - if (s.scriptCharset) - script.charset = s.scriptCharset; - - // Handle Script loading - if ( !jsonp ) { - var done = false; - - // Attach handlers for all browsers - script.onload = script.onreadystatechange = function(){ - if ( !done && (!this.readyState || - this.readyState == "loaded" || this.readyState == "complete") ) { - done = true; - success(); - complete(); - - // Handle memory leak in IE - script.onload = script.onreadystatechange = null; - head.removeChild( script ); - } - }; - } - - head.appendChild(script); - - // We handle everything using the script element injection - return undefined; - } - - var requestDone = false; - - // Create the request object - var xhr = s.xhr(); - - // Open the socket - // Passing null username, generates a login popup on Opera (#2865) - if( s.username ) - xhr.open(type, s.url, s.async, s.username, s.password); - else - xhr.open(type, s.url, s.async); - - // Need an extra try/catch for cross domain requests in Firefox 3 - try { - // Set the correct header, if data is being sent - if ( s.data ) - xhr.setRequestHeader("Content-Type", s.contentType); - - // Set the If-Modified-Since header, if ifModified mode. - if ( s.ifModified ) - xhr.setRequestHeader("If-Modified-Since", - jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" ); - - // Set header so the called script knows that it's an XMLHttpRequest - xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - - // Set the Accepts header for the server, depending on the dataType - xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ? - s.accepts[ s.dataType ] + ", */*" : - s.accepts._default ); - } catch(e){} - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && s.beforeSend(xhr, s) === false ) { - // Handle the global AJAX counter - if ( s.global && ! --jQuery.active ) - jQuery.event.trigger( "ajaxStop" ); - // close opended socket - xhr.abort(); - return false; - } - - if ( s.global ) - jQuery.event.trigger("ajaxSend", [xhr, s]); - - // Wait for a response to come back - var onreadystatechange = function(isTimeout){ - // The request was aborted, clear the interval and decrement jQuery.active - if (xhr.readyState == 0) { - if (ival) { - // clear poll interval - clearInterval(ival); - ival = null; - // Handle the global AJAX counter - if ( s.global && ! --jQuery.active ) - jQuery.event.trigger( "ajaxStop" ); - } - // The transfer is complete and the data is available, or the request timed out - } else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) { - requestDone = true; - - // clear poll interval - if (ival) { - clearInterval(ival); - ival = null; - } - - status = isTimeout == "timeout" ? "timeout" : - !jQuery.httpSuccess( xhr ) ? "error" : - s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" : - "success"; - - if ( status == "success" ) { - // Watch for, and catch, XML document parse errors - try { - // process the data (runs the xml through httpData regardless of callback) - data = jQuery.httpData( xhr, s.dataType, s ); - } catch(e) { - status = "parsererror"; - } - } - - // Make sure that the request was successful or notmodified - if ( status == "success" ) { - // Cache Last-Modified header, if ifModified mode. - var modRes; - try { - modRes = xhr.getResponseHeader("Last-Modified"); - } catch(e) {} // swallow exception thrown by FF if header is not available - - if ( s.ifModified && modRes ) - jQuery.lastModified[s.url] = modRes; - - // JSONP handles its own success callback - if ( !jsonp ) - success(); - } else - jQuery.handleError(s, xhr, status); - - // Fire the complete handlers - complete(); - - if ( isTimeout ) - xhr.abort(); - - // Stop memory leaks - if ( s.async ) - xhr = null; - } - }; - - if ( s.async ) { - // don't attach the handler to the request, just poll it instead - var ival = setInterval(onreadystatechange, 13); - - // Timeout checker - if ( s.timeout > 0 ) - setTimeout(function(){ - // Check to see if the request is still happening - if ( xhr && !requestDone ) - onreadystatechange( "timeout" ); - }, s.timeout); - } - - // Send the data - try { - xhr.send(s.data); - } catch(e) { - jQuery.handleError(s, xhr, null, e); - } - - // firefox 1.5 doesn't fire statechange for sync requests - if ( !s.async ) - onreadystatechange(); - - function success(){ - // If a local callback was specified, fire it and pass it the data - if ( s.success ) - s.success( data, status ); - - // Fire the global callback - if ( s.global ) - jQuery.event.trigger( "ajaxSuccess", [xhr, s] ); - } - - function complete(){ - // Process result - if ( s.complete ) - s.complete(xhr, status); - - // The request was completed - if ( s.global ) - jQuery.event.trigger( "ajaxComplete", [xhr, s] ); - - // Handle the global AJAX counter - if ( s.global && ! --jQuery.active ) - jQuery.event.trigger( "ajaxStop" ); - } - - // return XMLHttpRequest to allow aborting the request etc. - return xhr; - }, - - handleError: function( s, xhr, status, e ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - // If a local callback was specified, fire it - if ( s.error ) s.error( xhr, status, e ); - - // Fire the global callback - if ( s.global ) - jQuery.event.trigger( "ajaxError", [xhr, s, e] ); - }, - - // Counter for holding the number of active queries - active: 0, - - // Determines if an XMLHttpRequest was successful or not - httpSuccess: function( xhr ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - try { - // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450 - return !xhr.status && location.protocol == "file:" || - ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223; - } catch(e){} - return false; - }, - - // Determines if an XMLHttpRequest returns NotModified - httpNotModified: function( xhr, url ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - try { - var xhrRes = xhr.getResponseHeader("Last-Modified"); - - // Firefox always returns 200. check Last-Modified date - return xhr.status == 304 || xhrRes == jQuery.lastModified[url]; - } catch(e){} - return false; - }, - - httpData: function( xhr, type, s ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - var ct = xhr.getResponseHeader("content-type"), - xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0, - data = xml ? xhr.responseXML : xhr.responseText; - - if ( xml && data.documentElement.tagName == "parsererror" ) - throw "parsererror"; - - // Allow a pre-filtering function to sanitize the response - // s != null is checked to keep backwards compatibility - if( s && s.dataFilter ) - data = s.dataFilter( data, type ); - - // The filter can actually parse the response - if( typeof data === "string" ){ - - // If the type is "script", eval it in global context - if ( type == "script" ) - jQuery.globalEval( data ); - - // Get the JavaScript object, if JSON is used. - if ( type == "json" ) - data = window["eval"]("(" + data + ")"); - } - - return data; - }, - - // Serialize an array of form elements or a set of - // key/values into a query string - param: function( a ) { - /// <summary> - /// This method is internal. Use serialize() instead. - /// </summary> - /// <param name="a" type="Map">A map of key/value pairs to serialize into a string.</param>' - /// <returns type="String" /> - /// <private /> - - var s = [ ]; - - function add( key, value ){ - s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value); - }; - - // If an array was passed in, assume that it is an array - // of form elements - if ( jQuery.isArray(a) || a.jquery ) - // Serialize the form elements - jQuery.each( a, function(){ - add( this.name, this.value ); - }); - - // Otherwise, assume that it's an object of key/value pairs - else - // Serialize the key/values - for ( var j in a ) - // If the value is an array then the key names need to be repeated - if ( jQuery.isArray(a[j]) ) - jQuery.each( a[j], function(){ - add( j, this ); - }); - else - add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] ); - - // Return the resulting serialization - return s.join("&").replace(/%20/g, "+"); - } - -}); -var elemdisplay = {}, - timerId, - fxAttrs = [ - // height animations - [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], - // width animations - [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], - // opacity animations - [ "opacity" ] - ]; - -function genFx( type, num ){ - var obj = {}; - jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){ - obj[ this ] = type; - }); - return obj; -} - -jQuery.fn.extend({ - show: function(speed,callback){ - /// <summary> - /// Show all matched elements using a graceful animation and firing an optional callback after completion. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - - if ( speed ) { - return this.animate( genFx("show", 3), speed, callback); - } else { - for ( var i = 0, l = this.length; i < l; i++ ){ - var old = jQuery.data(this[i], "olddisplay"); - - this[i].style.display = old || ""; - - if ( jQuery.css(this[i], "display") === "none" ) { - var tagName = this[i].tagName, display; - - if ( elemdisplay[ tagName ] ) { - display = elemdisplay[ tagName ]; - } else { - var elem = jQuery("<" + tagName + " />").appendTo("body"); - - display = elem.css("display"); - if ( display === "none" ) - display = "block"; - - elem.remove(); - - elemdisplay[ tagName ] = display; - } - - jQuery.data(this[i], "olddisplay", display); - } - } - - // Set the display of the elements in a second loop - // to avoid the constant reflow - for ( var i = 0, l = this.length; i < l; i++ ){ - this[i].style.display = jQuery.data(this[i], "olddisplay") || ""; - } - - return this; - } - }, - - hide: function(speed,callback){ - /// <summary> - /// Hides all matched elements using a graceful animation and firing an optional callback after completion. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - - if ( speed ) { - return this.animate( genFx("hide", 3), speed, callback); - } else { - for ( var i = 0, l = this.length; i < l; i++ ){ - var old = jQuery.data(this[i], "olddisplay"); - if ( !old && old !== "none" ) - jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display")); - } - - // Set the display of the elements in a second loop - // to avoid the constant reflow - for ( var i = 0, l = this.length; i < l; i++ ){ - this[i].style.display = "none"; - } - - return this; - } - }, - - // Save the old toggle function - _toggle: jQuery.fn.toggle, - - toggle: function( fn, fn2 ){ - /// <summary> - /// Toggles displaying each of the set of matched elements. - /// </summary> - /// <returns type="jQuery" /> - - var bool = typeof fn === "boolean"; - - return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? - this._toggle.apply( this, arguments ) : - fn == null || bool ? - this.each(function(){ - var state = bool ? fn : jQuery(this).is(":hidden"); - jQuery(this)[ state ? "show" : "hide" ](); - }) : - this.animate(genFx("toggle", 3), fn, fn2); - }, - - fadeTo: function(speed,to,callback){ - /// <summary> - /// Fades the opacity of all matched elements to a specified opacity. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - return this.animate({opacity: to}, speed, callback); - }, - - animate: function( prop, speed, easing, callback ) { - /// <summary> - /// A function for making custom animations. - /// </summary> - /// <param name="prop" type="Options">A set of style attributes that you wish to animate and to what end.</param> - /// <param name="speed" optional="true" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="easing" optional="true" type="String">The name of the easing effect that you want to use. There are two built-in values, 'linear' and 'swing'.</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - - var optall = jQuery.speed(speed, easing, callback); - - return this[ optall.queue === false ? "each" : "queue" ](function(){ - - var opt = jQuery.extend({}, optall), p, - hidden = this.nodeType == 1 && jQuery(this).is(":hidden"), - self = this; - - for ( p in prop ) { - if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden ) - return opt.complete.call(this); - - if ( ( p == "height" || p == "width" ) && this.style ) { - // Store display property - opt.display = jQuery.css(this, "display"); - - // Make sure that nothing sneaks out - opt.overflow = this.style.overflow; - } - } - - if ( opt.overflow != null ) - this.style.overflow = "hidden"; - - opt.curAnim = jQuery.extend({}, prop); - - jQuery.each( prop, function(name, val){ - var e = new jQuery.fx( self, opt, name ); - - if ( /toggle|show|hide/.test(val) ) - e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop ); - else { - var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/), - start = e.cur(true) || 0; - - if ( parts ) { - var end = parseFloat(parts[2]), - unit = parts[3] || "px"; - - // We need to compute starting value - if ( unit != "px" ) { - self.style[ name ] = (end || 1) + unit; - start = ((end || 1) / e.cur(true)) * start; - self.style[ name ] = start + unit; - } - - // If a +=/-= token was provided, we're doing a relative animation - if ( parts[1] ) - end = ((parts[1] == "-=" ? -1 : 1) * end) + start; - - e.custom( start, end, unit ); - } else - e.custom( start, val, "" ); - } - }); - - // For JS strict compliance - return true; - }); - }, - - stop: function(clearQueue, gotoEnd){ - /// <summary> - /// Stops all currently animations on the specified elements. - /// </summary> - /// <param name="clearQueue" optional="true" type="Boolean">True to clear animations that are queued to run.</param> - /// <param name="gotoEnd" optional="true" type="Boolean">True to move the element value to the end of its animation target.</param> - /// <returns type="jQuery" /> - - var timers = jQuery.timers; - - if (clearQueue) - this.queue([]); - - this.each(function(){ - // go in reverse order so anything added to the queue during the loop is ignored - for ( var i = timers.length - 1; i >= 0; i-- ) - if ( timers[i].elem == this ) { - if (gotoEnd) - // force the next step to be the last - timers[i](true); - timers.splice(i, 1); - } - }); - - // start the next in the queue if the last step wasn't forced - if (!gotoEnd) - this.dequeue(); - - return this; - } - -}); - -// Generate shortcuts for custom animations -// jQuery.each({ -// slideDown: genFx("show", 1), -// slideUp: genFx("hide", 1), -// slideToggle: genFx("toggle", 1), -// fadeIn: { opacity: "show" }, -// fadeOut: { opacity: "hide" } -// }, function( name, props ){ -// jQuery.fn[ name ] = function( speed, callback ){ -// return this.animate( props, speed, callback ); -// }; -// }); - -// [vsdoc] The following section has been denormalized from original sources for IntelliSense. - -jQuery.fn.slideDown = function( speed, callback ){ - /// <summary> - /// Reveal all matched elements by adjusting their height. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - return this.animate( genFx("show", 1), speed, callback ); -}; - -jQuery.fn.slideUp = function( speed, callback ){ - /// <summary> - /// Hiding all matched elements by adjusting their height. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - return this.animate( genFx("hide", 1), speed, callback ); -}; - -jQuery.fn.slideToggle = function( speed, callback ){ - /// <summary> - /// Toggles the visibility of all matched elements by adjusting their height. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - return this.animate( genFx("toggle", 1), speed, callback ); -}; - -jQuery.fn.fadeIn = function( speed, callback ){ - /// <summary> - /// Fades in all matched elements by adjusting their opacity. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - return this.animate( { opacity: "show" }, speed, callback ); -}; - -jQuery.fn.fadeOut = function( speed, callback ){ - /// <summary> - /// Fades the opacity of all matched elements to a specified opacity. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - return this.animate( { opacity: "hide" }, speed, callback ); -}; - -jQuery.extend({ - - speed: function(speed, easing, fn) { - /// <summary> - /// This member is internal. - /// </summary> - /// <private /> - var opt = typeof speed === "object" ? speed : { - complete: fn || !fn && easing || - jQuery.isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !jQuery.isFunction(easing) && easing - }; - - opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : - jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default; - - // Queueing - opt.old = opt.complete; - opt.complete = function(){ - if ( opt.queue !== false ) - jQuery(this).dequeue(); - if ( jQuery.isFunction( opt.old ) ) - opt.old.call( this ); - }; - - return opt; - }, - - easing: { - linear: function( p, n, firstNum, diff ) { - /// <summary> - /// This member is internal. - /// </summary> - /// <private /> - return firstNum + diff * p; - }, - swing: function( p, n, firstNum, diff ) { - /// <summary> - /// This member is internal. - /// </summary> - /// <private /> - return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; - } - }, - - timers: [], - - fx: function( elem, options, prop ){ - /// <summary> - /// This member is internal. - /// </summary> - /// <private /> - this.options = options; - this.elem = elem; - this.prop = prop; - - if ( !options.orig ) - options.orig = {}; - } - -}); - -jQuery.fx.prototype = { - - // Simple function for setting a style value - update: function(){ - /// <summary> - /// This member is internal. - /// </summary> - /// <private /> - if ( this.options.step ) - this.options.step.call( this.elem, this.now, this ); - - (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); - - // Set display property to block for height/width animations - if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style ) - this.elem.style.display = "block"; - }, - - // Get the current size - cur: function(force){ - /// <summary> - /// This member is internal. - /// </summary> - /// <private /> - if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) - return this.elem[ this.prop ]; - - var r = parseFloat(jQuery.css(this.elem, this.prop, force)); - return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0; - }, - - // Start an animation from one number to another - custom: function(from, to, unit){ - this.startTime = now(); - this.start = from; - this.end = to; - this.unit = unit || this.unit || "px"; - this.now = this.start; - this.pos = this.state = 0; - - var self = this; - function t(gotoEnd){ - return self.step(gotoEnd); - } - - t.elem = this.elem; - - if ( t() && jQuery.timers.push(t) && !timerId ) { - timerId = setInterval(function(){ - var timers = jQuery.timers; - - for ( var i = 0; i < timers.length; i++ ) - if ( !timers[i]() ) - timers.splice(i--, 1); - - if ( !timers.length ) { - clearInterval( timerId ); - timerId = undefined; - } - }, 13); - } - }, - - // Simple 'show' function - show: function(){ - /// <summary> - /// Displays each of the set of matched elements if they are hidden. - /// </summary> - // Remember where we started, so that we can go back to it later - this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); - this.options.show = true; - - // Begin the animation - // Make sure that we start at a small width/height to avoid any - // flash of content - this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur()); - - // Start by showing the element - jQuery(this.elem).show(); - }, - - // Simple 'hide' function - hide: function(){ - /// <summary> - /// Hides each of the set of matched elements if they are shown. - /// </summary> - - // Remember where we started, so that we can go back to it later - this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); - this.options.hide = true; - - // Begin the animation - this.custom(this.cur(), 0); - }, - - // Each step of an animation - step: function(gotoEnd){ - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - var t = now(); - - if ( gotoEnd || t >= this.options.duration + this.startTime ) { - this.now = this.end; - this.pos = this.state = 1; - this.update(); - - this.options.curAnim[ this.prop ] = true; - - var done = true; - for ( var i in this.options.curAnim ) - if ( this.options.curAnim[i] !== true ) - done = false; - - if ( done ) { - if ( this.options.display != null ) { - // Reset the overflow - this.elem.style.overflow = this.options.overflow; - - // Reset the display - this.elem.style.display = this.options.display; - if ( jQuery.css(this.elem, "display") == "none" ) - this.elem.style.display = "block"; - } - - // Hide the element if the "hide" operation was done - if ( this.options.hide ) - jQuery(this.elem).hide(); - - // Reset the properties, if the item has been hidden or shown - if ( this.options.hide || this.options.show ) - for ( var p in this.options.curAnim ) - jQuery.attr(this.elem.style, p, this.options.orig[p]); - - // Execute the complete function - this.options.complete.call( this.elem ); - } - - return false; - } else { - var n = t - this.startTime; - this.state = n / this.options.duration; - - // Perform the easing function, defaults to swing - this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration); - this.now = this.start + ((this.end - this.start) * this.pos); - - // Perform the next step of the animation - this.update(); - } - - return true; - } - -}; - -jQuery.extend( jQuery.fx, { - speeds:{ - slow: 600, - fast: 200, - // Default speed - _default: 400 - }, - step: { - - opacity: function(fx){ - jQuery.attr(fx.elem.style, "opacity", fx.now); - }, - - _default: function(fx){ - if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) - fx.elem.style[ fx.prop ] = fx.now + fx.unit; - else - fx.elem[ fx.prop ] = fx.now; - } - } -}); -if ( document.documentElement["getBoundingClientRect"] ) - jQuery.fn.offset = function() { - /// <summary> - /// Gets the current offset of the first matched element relative to the viewport. - /// </summary> - /// <returns type="Object">An object with two Integer properties, 'top' and 'left'.</returns> - if ( !this[0] ) return { top: 0, left: 0 }; - if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] ); - var box = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement, - clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, - top = box.top + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop, - left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft; - return { top: top, left: left }; - }; -else - jQuery.fn.offset = function() { - /// <summary> - /// Gets the current offset of the first matched element relative to the viewport. - /// </summary> - /// <returns type="Object">An object with two Integer properties, 'top' and 'left'.</returns> - if ( !this[0] ) return { top: 0, left: 0 }; - if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] ); - jQuery.offset.initialized || jQuery.offset.initialize(); - - var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem, - doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement, - body = doc.body, defaultView = doc.defaultView, - prevComputedStyle = defaultView.getComputedStyle(elem, null), - top = elem.offsetTop, left = elem.offsetLeft; - - while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { - computedStyle = defaultView.getComputedStyle(elem, null); - top -= elem.scrollTop, left -= elem.scrollLeft; - if ( elem === offsetParent ) { - top += elem.offsetTop, left += elem.offsetLeft; - if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) ) - top += parseInt( computedStyle.borderTopWidth, 10) || 0, - left += parseInt( computedStyle.borderLeftWidth, 10) || 0; - prevOffsetParent = offsetParent, offsetParent = elem.offsetParent; - } - if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) - top += parseInt( computedStyle.borderTopWidth, 10) || 0, - left += parseInt( computedStyle.borderLeftWidth, 10) || 0; - prevComputedStyle = computedStyle; - } - - if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) - top += body.offsetTop, - left += body.offsetLeft; - - if ( prevComputedStyle.position === "fixed" ) - top += Math.max(docElem.scrollTop, body.scrollTop), - left += Math.max(docElem.scrollLeft, body.scrollLeft); - - return { top: top, left: left }; - }; - -jQuery.offset = { - initialize: function() { - if ( this.initialized ) return; - var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop, - html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"cellpadding="0"cellspacing="0"><tr><td></td></tr></table>'; - - rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' }; - for ( prop in rules ) container.style[prop] = rules[prop]; - - container.innerHTML = html; - body.insertBefore(container, body.firstChild); - innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild; - - this.doesNotAddBorder = (checkDiv.offsetTop !== 5); - this.doesAddBorderForTableAndCells = (td.offsetTop === 5); - - innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative'; - this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); - - body.style.marginTop = '1px'; - this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0); - body.style.marginTop = bodyMarginTop; - - body.removeChild(container); - this.initialized = true; - }, - - bodyOffset: function(body) { - jQuery.offset.initialized || jQuery.offset.initialize(); - var top = body.offsetTop, left = body.offsetLeft; - if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) - top += parseInt( jQuery.curCSS(body, 'marginTop', true), 10 ) || 0, - left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0; - return { top: top, left: left }; - } -}; - - -jQuery.fn.extend({ - position: function() { - /// <summary> - /// Gets the top and left positions of an element relative to its offset parent. - /// </summary> - /// <returns type="Object">An object with two integer properties, 'top' and 'left'.</returns> - var left = 0, top = 0, results; - - if ( this[0] ) { - // Get *real* offsetParent - var offsetParent = this.offsetParent(), - - // Get correct offsets - offset = this.offset(), - parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset(); - - // Subtract element margins - // note: when an element has margin: auto the offsetLeft and marginLeft - // are the same in Safari causing offset.left to incorrectly be 0 - offset.top -= num( this, 'marginTop' ); - offset.left -= num( this, 'marginLeft' ); - - // Add offsetParent borders - parentOffset.top += num( offsetParent, 'borderTopWidth' ); - parentOffset.left += num( offsetParent, 'borderLeftWidth' ); - - // Subtract the two offsets - results = { - top: offset.top - parentOffset.top, - left: offset.left - parentOffset.left - }; - } - - return results; - }, - - offsetParent: function() { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - var offsetParent = this[0].offsetParent || document.body; - while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') ) - offsetParent = offsetParent.offsetParent; - return jQuery(offsetParent); - } -}); - - -// Create scrollLeft and scrollTop methods -jQuery.each( ['Left'], function(i, name) { - var method = 'scroll' + name; - - jQuery.fn[ method ] = function(val) { - /// <summary> - /// Gets and optionally sets the scroll left offset of the first matched element. - /// </summary> - /// <param name="val" type="Number" integer="true" optional="true">A positive number representing the desired scroll left offset.</param> - /// <returns type="Number" integer="true">The scroll left offset of the first matched element.</returns> - if (!this[0]) return null; - - return val !== undefined ? - - // Set the scroll offset - this.each(function() { - this == window || this == document ? - window.scrollTo( - !i ? val : jQuery(window).scrollLeft(), - i ? val : jQuery(window).scrollTop() - ) : - this[ method ] = val; - }) : - - // Return the scroll offset - this[0] == window || this[0] == document ? - self[ i ? 'pageYOffset' : 'pageXOffset' ] || - jQuery.boxModel && document.documentElement[ method ] || - document.body[ method ] : - this[0][ method ]; - }; -}); - -// Create scrollLeft and scrollTop methods -jQuery.each( ['Top'], function(i, name) { - var method = 'scroll' + name; - - jQuery.fn[ method ] = function(val) { - /// <summary> - /// Gets and optionally sets the scroll top offset of the first matched element. - /// </summary> - /// <param name="val" type="Number" integer="true" optional="true">A positive number representing the desired scroll top offset.</param> - /// <returns type="Number" integer="true">The scroll top offset of the first matched element.</returns> - if (!this[0]) return null; - - return val !== undefined ? - - // Set the scroll offset - this.each(function() { - this == window || this == document ? - window.scrollTo( - !i ? val : jQuery(window).scrollLeft(), - i ? val : jQuery(window).scrollTop() - ) : - this[ method ] = val; - }) : - - // Return the scroll offset - this[0] == window || this[0] == document ? - self[ i ? 'pageYOffset' : 'pageXOffset' ] || - jQuery.boxModel && document.documentElement[ method ] || - document.body[ method ] : - this[0][ method ]; - }; -}); - -// Create innerHeight, innerWidth, outerHeight and outerWidth methods -jQuery.each([ "Height" ], function(i, name){ - - var tl = i ? "Left" : "Top", // top or left - br = i ? "Right" : "Bottom", // bottom or right - lower = name.toLowerCase(); - - // innerHeight and innerWidth - jQuery.fn["inner" + name] = function(){ - /// <summary> - /// Gets the inner height of the first matched element, excluding border but including padding. - /// </summary> - /// <returns type="Number" integer="true">The outer height of the first matched element.</returns> - return this[0] ? - jQuery.css( this[0], lower, false, "padding" ) : - null; - }; - - // outerHeight and outerWidth - jQuery.fn["outer" + name] = function(margin) { - /// <summary> - /// Gets the outer height of the first matched element, including border and padding by default. - /// </summary> - /// <param name="margins" type="Map">A set of key/value pairs that specify the options for the method.</param> - /// <returns type="Number" integer="true">The outer height of the first matched element.</returns> - return this[0] ? - jQuery.css( this[0], lower, false, margin ? "margin" : "border" ) : - null; - }; - - var type = name.toLowerCase(); - - jQuery.fn[ type ] = function( size ) { - /// <summary> - /// Set the CSS height of every matched element. If no explicit unit - /// was specified (like 'em' or '%') then "px" is added to the width. If no parameter is specified, it gets - /// the current computed pixel height of the first matched element. - /// Part of CSS - /// </summary> - /// <returns type="jQuery" type="jQuery" /> - /// <param name="cssProperty" type="String"> - /// Set the CSS property to the specified value. Omit to get the value of the first matched element. - /// </param> - - // Get window width or height - return this[0] == window ? - // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode - document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || - document.body[ "client" + name ] : - - // Get document width or height - this[0] == document ? - // Either scroll[Width/Height] or offset[Width/Height], whichever is greater - Math.max( - document.documentElement["client" + name], - document.body["scroll" + name], document.documentElement["scroll" + name], - document.body["offset" + name], document.documentElement["offset" + name] - ) : - - // Get or set width or height on the element - size === undefined ? - // Get width or height on the element - (this.length ? jQuery.css( this[0], type ) : null) : - - // Set the width or height on the element (default to pixels if value is unitless) - this.css( type, typeof size === "string" ? size : size + "px" ); - }; - -}); - -// Create innerHeight, innerWidth, outerHeight and outerWidth methods -jQuery.each([ "Width" ], function(i, name){ - - var tl = i ? "Left" : "Top", // top or left - br = i ? "Right" : "Bottom", // bottom or right - lower = name.toLowerCase(); - - // innerHeight and innerWidth - jQuery.fn["inner" + name] = function(){ - /// <summary> - /// Gets the inner width of the first matched element, excluding border but including padding. - /// </summary> - /// <returns type="Number" integer="true">The outer width of the first matched element.</returns> - return this[0] ? - jQuery.css( this[0], lower, false, "padding" ) : - null; - }; - - // outerHeight and outerWidth - jQuery.fn["outer" + name] = function(margin) { - /// <summary> - /// Gets the outer width of the first matched element, including border and padding by default. - /// </summary> - /// <param name="margins" type="Map">A set of key/value pairs that specify the options for the method.</param> - /// <returns type="Number" integer="true">The outer width of the first matched element.</returns> - return this[0] ? - jQuery.css( this[0], lower, false, margin ? "margin" : "border" ) : - null; - }; - - var type = name.toLowerCase(); - - jQuery.fn[ type ] = function( size ) { - /// <summary> - /// Set the CSS width of every matched element. If no explicit unit - /// was specified (like 'em' or '%') then "px" is added to the width. If no parameter is specified, it gets - /// the current computed pixel width of the first matched element. - /// Part of CSS - /// </summary> - /// <returns type="jQuery" type="jQuery" /> - /// <param name="cssProperty" type="String"> - /// Set the CSS property to the specified value. Omit to get the value of the first matched element. - /// </param> - - // Get window width or height - return this[0] == window ? - // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode - document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || - document.body[ "client" + name ] : - - // Get document width or height - this[0] == document ? - // Either scroll[Width/Height] or offset[Width/Height], whichever is greater - Math.max( - document.documentElement["client" + name], - document.body["scroll" + name], document.documentElement["scroll" + name], - document.body["offset" + name], document.documentElement["offset" + name] - ) : - - // Get or set width or height on the element - size === undefined ? - // Get width or height on the element - (this.length ? jQuery.css( this[0], type ) : null) : - - // Set the width or height on the element (default to pixels if value is unitless) - this.css( type, typeof size === "string" ? size : size + "px" ); - }; - -}); -})(); diff --git a/projecttemplates/MvcRelyingParty/Scripts/jquery-1.3.2.js b/projecttemplates/MvcRelyingParty/Scripts/jquery-1.3.2.js deleted file mode 100644 index 4109fd0..0000000 --- a/projecttemplates/MvcRelyingParty/Scripts/jquery-1.3.2.js +++ /dev/null @@ -1,4410 +0,0 @@ -/*! - * jQuery JavaScript Library v1.3.2 - * - * Copyright (c) 2009 John Resig, http://jquery.com/ - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){ - -var - // Will speed up references to window, and allows munging its name. - window = this, - // Will speed up references to undefined, and allows munging its name. - undefined, - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - // Map over the $ in case of overwrite - _$ = window.$, - - jQuery = window.jQuery = window.$ = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context ); - }, - - // A simple way to check for HTML strings or ID strings - // (both of which we optimize for) - quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, - // Is it a simple selector - isSimple = /^.[^:#\[\.,]*$/; - -jQuery.fn = jQuery.prototype = { - init: function( selector, context ) { - // Make sure that a selection was provided - selector = selector || document; - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this[0] = selector; - this.length = 1; - this.context = selector; - return this; - } - // Handle HTML strings - if ( typeof selector === "string" ) { - // Are we dealing with HTML string or an ID? - var match = quickExpr.exec( selector ); - - // Verify a match, and that no context was specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) - selector = jQuery.clean( [ match[1] ], context ); - - // HANDLE: $("#id") - else { - var elem = document.getElementById( match[3] ); - - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem && elem.id != match[3] ) - return jQuery().find( selector ); - - // Otherwise, we inject the element directly into the jQuery object - var ret = jQuery( elem || [] ); - ret.context = document; - ret.selector = selector; - return ret; - } - - // HANDLE: $(expr, [context]) - // (which is just equivalent to: $(content).find(expr) - } else - return jQuery( context ).find( selector ); - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) - return jQuery( document ).ready( selector ); - - // Make sure that old selector state is passed along - if ( selector.selector && selector.context ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return this.setArray(jQuery.isArray( selector ) ? - selector : - jQuery.makeArray(selector)); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.3.2", - - // The number of elements contained in the matched element set - size: function() { - return this.length; - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num === undefined ? - - // Return a 'clean' array - Array.prototype.slice.call( this ) : - - // Return just the object - this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - // Build a new jQuery matched element set - var ret = jQuery( elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) - ret.selector = this.selector + (this.selector ? " " : "") + selector; - else if ( name ) - ret.selector = this.selector + "." + name + "(" + selector + ")"; - - // Return the newly-formed element set - return ret; - }, - - // Force the current matched set of elements to become - // the specified array of elements (destroying the stack in the process) - // You should use pushStack() in order to do this, but maintain the stack - setArray: function( elems ) { - // Resetting the length to 0, then using the native Array push - // is a super-fast way to populate an object with array-like properties - this.length = 0; - Array.prototype.push.apply( this, elems ); - - return this; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem && elem.jquery ? elem[0] : elem - , this ); - }, - - attr: function( name, value, type ) { - var options = name; - - // Look for the case where we're accessing a style value - if ( typeof name === "string" ) - if ( value === undefined ) - return this[0] && jQuery[ type || "attr" ]( this[0], name ); - - else { - options = {}; - options[ name ] = value; - } - - // Check to see if we're setting style values - return this.each(function(i){ - // Set all the styles - for ( name in options ) - jQuery.attr( - type ? - this.style : - this, - name, jQuery.prop( this, options[ name ], type, i, name ) - ); - }); - }, - - css: function( key, value ) { - // ignore negative width and height values - if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) - value = undefined; - return this.attr( key, value, "curCSS" ); - }, - - text: function( text ) { - if ( typeof text !== "object" && text != null ) - return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); - - var ret = ""; - - jQuery.each( text || this, function(){ - jQuery.each( this.childNodes, function(){ - if ( this.nodeType != 8 ) - ret += this.nodeType != 1 ? - this.nodeValue : - jQuery.fn.text( [ this ] ); - }); - }); - - return ret; - }, - - wrapAll: function( html ) { - if ( this[0] ) { - // The elements to wrap the target around - var wrap = jQuery( html, this[0].ownerDocument ).clone(); - - if ( this[0].parentNode ) - wrap.insertBefore( this[0] ); - - wrap.map(function(){ - var elem = this; - - while ( elem.firstChild ) - elem = elem.firstChild; - - return elem; - }).append(this); - } - - return this; - }, - - wrapInner: function( html ) { - return this.each(function(){ - jQuery( this ).contents().wrapAll( html ); - }); - }, - - wrap: function( html ) { - return this.each(function(){ - jQuery( this ).wrapAll( html ); - }); - }, - - append: function() { - return this.domManip(arguments, true, function(elem){ - if (this.nodeType == 1) - this.appendChild( elem ); - }); - }, - - prepend: function() { - return this.domManip(arguments, true, function(elem){ - if (this.nodeType == 1) - this.insertBefore( elem, this.firstChild ); - }); - }, - - before: function() { - return this.domManip(arguments, false, function(elem){ - this.parentNode.insertBefore( elem, this ); - }); - }, - - after: function() { - return this.domManip(arguments, false, function(elem){ - this.parentNode.insertBefore( elem, this.nextSibling ); - }); - }, - - end: function() { - return this.prevObject || jQuery( [] ); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: [].push, - sort: [].sort, - splice: [].splice, - - find: function( selector ) { - if ( this.length === 1 ) { - var ret = this.pushStack( [], "find", selector ); - ret.length = 0; - jQuery.find( selector, this[0], ret ); - return ret; - } else { - return this.pushStack( jQuery.unique(jQuery.map(this, function(elem){ - return jQuery.find( selector, elem ); - })), "find", selector ); - } - }, - - clone: function( events ) { - // Do the clone - var ret = this.map(function(){ - if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) { - // IE copies events bound via attachEvent when - // using cloneNode. Calling detachEvent on the - // clone will also remove the events from the orignal - // In order to get around this, we use innerHTML. - // Unfortunately, this means some modifications to - // attributes in IE that are actually only stored - // as properties will not be copied (such as the - // the name attribute on an input). - var html = this.outerHTML; - if ( !html ) { - var div = this.ownerDocument.createElement("div"); - div.appendChild( this.cloneNode(true) ); - html = div.innerHTML; - } - - return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0]; - } else - return this.cloneNode(true); - }); - - // Copy the events from the original to the clone - if ( events === true ) { - var orig = this.find("*").andSelf(), i = 0; - - ret.find("*").andSelf().each(function(){ - if ( this.nodeName !== orig[i].nodeName ) - return; - - var events = jQuery.data( orig[i], "events" ); - - for ( var type in events ) { - for ( var handler in events[ type ] ) { - jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data ); - } - } - - i++; - }); - } - - // Return the cloned set - return ret; - }, - - filter: function( selector ) { - return this.pushStack( - jQuery.isFunction( selector ) && - jQuery.grep(this, function(elem, i){ - return selector.call( elem, i ); - }) || - - jQuery.multiFilter( selector, jQuery.grep(this, function(elem){ - return elem.nodeType === 1; - }) ), "filter", selector ); - }, - - closest: function( selector ) { - var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null, - closer = 0; - - return this.map(function(){ - var cur = this; - while ( cur && cur.ownerDocument ) { - if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) { - jQuery.data(cur, "closest", closer); - return cur; - } - cur = cur.parentNode; - closer++; - } - }); - }, - - not: function( selector ) { - if ( typeof selector === "string" ) - // test special case where just one selector is passed in - if ( isSimple.test( selector ) ) - return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector ); - else - selector = jQuery.multiFilter( selector, this ); - - var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; - return this.filter(function() { - return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; - }); - }, - - add: function( selector ) { - return this.pushStack( jQuery.unique( jQuery.merge( - this.get(), - typeof selector === "string" ? - jQuery( selector ) : - jQuery.makeArray( selector ) - ))); - }, - - is: function( selector ) { - return !!selector && jQuery.multiFilter( selector, this ).length > 0; - }, - - hasClass: function( selector ) { - return !!selector && this.is( "." + selector ); - }, - - val: function( value ) { - if ( value === undefined ) { - var elem = this[0]; - - if ( elem ) { - if( jQuery.nodeName( elem, 'option' ) ) - return (elem.attributes.value || {}).specified ? elem.value : elem.text; - - // We need to handle select boxes special - if ( jQuery.nodeName( elem, "select" ) ) { - var index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type == "select-one"; - - // Nothing was selected - if ( index < 0 ) - return null; - - // Loop through all the selected options - for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { - var option = options[ i ]; - - if ( option.selected ) { - // Get the specifc value for the option - value = jQuery(option).val(); - - // We don't need an array for one selects - if ( one ) - return value; - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - } - - // Everything else, we just grab the value - return (elem.value || "").replace(/\r/g, ""); - - } - - return undefined; - } - - if ( typeof value === "number" ) - value += ''; - - return this.each(function(){ - if ( this.nodeType != 1 ) - return; - - if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) ) - this.checked = (jQuery.inArray(this.value, value) >= 0 || - jQuery.inArray(this.name, value) >= 0); - - else if ( jQuery.nodeName( this, "select" ) ) { - var values = jQuery.makeArray(value); - - jQuery( "option", this ).each(function(){ - this.selected = (jQuery.inArray( this.value, values ) >= 0 || - jQuery.inArray( this.text, values ) >= 0); - }); - - if ( !values.length ) - this.selectedIndex = -1; - - } else - this.value = value; - }); - }, - - html: function( value ) { - return value === undefined ? - (this[0] ? - this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") : - null) : - this.empty().append( value ); - }, - - replaceWith: function( value ) { - return this.after( value ).remove(); - }, - - eq: function( i ) { - return this.slice( i, +i + 1 ); - }, - - slice: function() { - return this.pushStack( Array.prototype.slice.apply( this, arguments ), - "slice", Array.prototype.slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function(elem, i){ - return callback.call( elem, i, elem ); - })); - }, - - andSelf: function() { - return this.add( this.prevObject ); - }, - - domManip: function( args, table, callback ) { - if ( this[0] ) { - var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(), - scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ), - first = fragment.firstChild; - - if ( first ) - for ( var i = 0, l = this.length; i < l; i++ ) - callback.call( root(this[i], first), this.length > 1 || i > 0 ? - fragment.cloneNode(true) : fragment ); - - if ( scripts ) - jQuery.each( scripts, evalScript ); - } - - return this; - - function root( elem, cur ) { - return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ? - (elem.getElementsByTagName("tbody")[0] || - elem.appendChild(elem.ownerDocument.createElement("tbody"))) : - elem; - } - } -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -function evalScript( i, elem ) { - if ( elem.src ) - jQuery.ajax({ - url: elem.src, - async: false, - dataType: "script" - }); - - else - jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); - - if ( elem.parentNode ) - elem.parentNode.removeChild( elem ); -} - -function now(){ - return +new Date; -} - -jQuery.extend = jQuery.fn.extend = function() { - // copy reference to target object - var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) - target = {}; - - // extend jQuery itself if only one argument is passed - if ( length == i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) - // Extend the base object - for ( var name in options ) { - var src = target[ name ], copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) - continue; - - // Recurse if we're merging object values - if ( deep && copy && typeof copy === "object" && !copy.nodeType ) - target[ name ] = jQuery.extend( deep, - // Never move original objects, clone them - src || ( copy.length != null ? [ ] : { } ) - , copy ); - - // Don't bring in undefined values - else if ( copy !== undefined ) - target[ name ] = copy; - - } - - // Return the modified object - return target; -}; - -// exclude the following css properties to add px -var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, - // cache defaultView - defaultView = document.defaultView || {}, - toString = Object.prototype.toString; - -jQuery.extend({ - noConflict: function( deep ) { - window.$ = _$; - - if ( deep ) - window.jQuery = _jQuery; - - return jQuery; - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return toString.call(obj) === "[object Function]"; - }, - - isArray: function( obj ) { - return toString.call(obj) === "[object Array]"; - }, - - // check if an element is in a (or is an) XML document - isXMLDoc: function( elem ) { - return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || - !!elem.ownerDocument && jQuery.isXMLDoc( elem.ownerDocument ); - }, - - // Evalulates a script in a global context - globalEval: function( data ) { - if ( data && /\S/.test(data) ) { - // Inspired by code by Andrea Giammarchi - // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html - var head = document.getElementsByTagName("head")[0] || document.documentElement, - script = document.createElement("script"); - - script.type = "text/javascript"; - if ( jQuery.support.scriptEval ) - script.appendChild( document.createTextNode( data ) ); - else - script.text = data; - - // Use insertBefore instead of appendChild to circumvent an IE6 bug. - // This arises when a base node is used (#2709). - head.insertBefore( script, head.firstChild ); - head.removeChild( script ); - } - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); - }, - - // args is for internal usage only - each: function( object, callback, args ) { - var name, i = 0, length = object.length; - - if ( args ) { - if ( length === undefined ) { - for ( name in object ) - if ( callback.apply( object[ name ], args ) === false ) - break; - } else - for ( ; i < length; ) - if ( callback.apply( object[ i++ ], args ) === false ) - break; - - // A special, fast, case for the most common use of each - } else { - if ( length === undefined ) { - for ( name in object ) - if ( callback.call( object[ name ], name, object[ name ] ) === false ) - break; - } else - for ( var value = object[0]; - i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} - } - - return object; - }, - - prop: function( elem, value, type, i, name ) { - // Handle executable functions - if ( jQuery.isFunction( value ) ) - value = value.call( elem, i ); - - // Handle passing in a number to a CSS property - return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ? - value + "px" : - value; - }, - - className: { - // internal only, use addClass("class") - add: function( elem, classNames ) { - jQuery.each((classNames || "").split(/\s+/), function(i, className){ - if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) ) - elem.className += (elem.className ? " " : "") + className; - }); - }, - - // internal only, use removeClass("class") - remove: function( elem, classNames ) { - if (elem.nodeType == 1) - elem.className = classNames !== undefined ? - jQuery.grep(elem.className.split(/\s+/), function(className){ - return !jQuery.className.has( classNames, className ); - }).join(" ") : - ""; - }, - - // internal only, use hasClass("class") - has: function( elem, className ) { - return elem && jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1; - } - }, - - // A method for quickly swapping in/out CSS properties to get correct calculations - swap: function( elem, options, callback ) { - var old = {}; - // Remember the old values, and insert the new ones - for ( var name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - callback.call( elem ); - - // Revert the old values - for ( var name in options ) - elem.style[ name ] = old[ name ]; - }, - - css: function( elem, name, force, extra ) { - if ( name == "width" || name == "height" ) { - var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; - - function getWH() { - val = name == "width" ? elem.offsetWidth : elem.offsetHeight; - - if ( extra === "border" ) - return; - - jQuery.each( which, function() { - if ( !extra ) - val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0; - if ( extra === "margin" ) - val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0; - else - val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0; - }); - } - - if ( elem.offsetWidth !== 0 ) - getWH(); - else - jQuery.swap( elem, props, getWH ); - - return Math.max(0, Math.round(val)); - } - - return jQuery.curCSS( elem, name, force ); - }, - - curCSS: function( elem, name, force ) { - var ret, style = elem.style; - - // We need to handle opacity special in IE - if ( name == "opacity" && !jQuery.support.opacity ) { - ret = jQuery.attr( style, "opacity" ); - - return ret == "" ? - "1" : - ret; - } - - // Make sure we're using the right name for getting the float value - if ( name.match( /float/i ) ) - name = styleFloat; - - if ( !force && style && style[ name ] ) - ret = style[ name ]; - - else if ( defaultView.getComputedStyle ) { - - // Only "float" is needed here - if ( name.match( /float/i ) ) - name = "float"; - - name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); - - var computedStyle = defaultView.getComputedStyle( elem, null ); - - if ( computedStyle ) - ret = computedStyle.getPropertyValue( name ); - - // We should always get a number back from opacity - if ( name == "opacity" && ret == "" ) - ret = "1"; - - } else if ( elem.currentStyle ) { - var camelCase = name.replace(/\-(\w)/g, function(all, letter){ - return letter.toUpperCase(); - }); - - ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; - - // From the awesome hack by Dean Edwards - // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 - - // If we're not dealing with a regular pixel number - // but a number that has a weird ending, we need to convert it to pixels - if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { - // Remember the original values - var left = style.left, rsLeft = elem.runtimeStyle.left; - - // Put in the new values to get a computed value out - elem.runtimeStyle.left = elem.currentStyle.left; - style.left = ret || 0; - ret = style.pixelLeft + "px"; - - // Revert the changed values - style.left = left; - elem.runtimeStyle.left = rsLeft; - } - } - - return ret; - }, - - clean: function( elems, context, fragment ) { - context = context || document; - - // !context.createElement fails in IE with an error but returns typeof 'object' - if ( typeof context.createElement === "undefined" ) - context = context.ownerDocument || context[0] && context[0].ownerDocument || document; - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) { - var match = /^<(\w+)\s*\/?>$/.exec(elems[0]); - if ( match ) - return [ context.createElement( match[1] ) ]; - } - - var ret = [], scripts = [], div = context.createElement("div"); - - jQuery.each(elems, function(i, elem){ - if ( typeof elem === "number" ) - elem += ''; - - if ( !elem ) - return; - - // Convert html string into DOM nodes - if ( typeof elem === "string" ) { - // Fix "XHTML"-style tags in all browsers - elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ - return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? - all : - front + "></" + tag + ">"; - }); - - // Trim whitespace, otherwise indexOf won't work as expected - var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase(); - - var wrap = - // option or optgroup - !tags.indexOf("<opt") && - [ 1, "<select multiple='multiple'>", "</select>" ] || - - !tags.indexOf("<leg") && - [ 1, "<fieldset>", "</fieldset>" ] || - - tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && - [ 1, "<table>", "</table>" ] || - - !tags.indexOf("<tr") && - [ 2, "<table><tbody>", "</tbody></table>" ] || - - // <thead> matched above - (!tags.indexOf("<td") || !tags.indexOf("<th")) && - [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] || - - !tags.indexOf("<col") && - [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] || - - // IE can't serialize <link> and <script> tags normally - !jQuery.support.htmlSerialize && - [ 1, "div<div>", "</div>" ] || - - [ 0, "", "" ]; - - // Go to html and back, then peel off extra wrappers - div.innerHTML = wrap[1] + elem + wrap[2]; - - // Move to the right depth - while ( wrap[0]-- ) - div = div.lastChild; - - // Remove IE's autoinserted <tbody> from table fragments - if ( !jQuery.support.tbody ) { - - // String was a <table>, *may* have spurious <tbody> - var hasBody = /<tbody/i.test(elem), - tbody = !tags.indexOf("<table") && !hasBody ? - div.firstChild && div.firstChild.childNodes : - - // String was a bare <thead> or <tfoot> - wrap[1] == "<table>" && !hasBody ? - div.childNodes : - []; - - for ( var j = tbody.length - 1; j >= 0 ; --j ) - if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) - tbody[ j ].parentNode.removeChild( tbody[ j ] ); - - } - - // IE completely kills leading whitespace when innerHTML is used - if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) ) - div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild ); - - elem = jQuery.makeArray( div.childNodes ); - } - - if ( elem.nodeType ) - ret.push( elem ); - else - ret = jQuery.merge( ret, elem ); - - }); - - if ( fragment ) { - for ( var i = 0; ret[i]; i++ ) { - if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { - scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); - } else { - if ( ret[i].nodeType === 1 ) - ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); - fragment.appendChild( ret[i] ); - } - } - - return scripts; - } - - return ret; - }, - - attr: function( elem, name, value ) { - // don't set attributes on text and comment nodes - if (!elem || elem.nodeType == 3 || elem.nodeType == 8) - return undefined; - - var notxml = !jQuery.isXMLDoc( elem ), - // Whether we are setting (or getting) - set = value !== undefined; - - // Try to normalize/fix the name - name = notxml && jQuery.props[ name ] || name; - - // Only do all the following if this is a node (faster for style) - // IE elem.getAttribute passes even for style - if ( elem.tagName ) { - - // These attributes require special treatment - var special = /href|src|style/.test( name ); - - // Safari mis-reports the default selected property of a hidden option - // Accessing the parent's selectedIndex property fixes it - if ( name == "selected" && elem.parentNode ) - elem.parentNode.selectedIndex; - - // If applicable, access the attribute via the DOM 0 way - if ( name in elem && notxml && !special ) { - if ( set ){ - // We can't allow the type property to be changed (since it causes problems in IE) - if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode ) - throw "type property can't be changed"; - - elem[ name ] = value; - } - - // browsers index elements by id/name on forms, give priority to attributes. - if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) - return elem.getAttributeNode( name ).nodeValue; - - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - if ( name == "tabIndex" ) { - var attributeNode = elem.getAttributeNode( "tabIndex" ); - return attributeNode && attributeNode.specified - ? attributeNode.value - : elem.nodeName.match(/(button|input|object|select|textarea)/i) - ? 0 - : elem.nodeName.match(/^(a|area)$/i) && elem.href - ? 0 - : undefined; - } - - return elem[ name ]; - } - - if ( !jQuery.support.style && notxml && name == "style" ) - return jQuery.attr( elem.style, "cssText", value ); - - if ( set ) - // convert the value to a string (all browsers do this but IE) see #1070 - elem.setAttribute( name, "" + value ); - - var attr = !jQuery.support.hrefNormalized && notxml && special - // Some attributes require a special call on IE - ? elem.getAttribute( name, 2 ) - : elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return attr === null ? undefined : attr; - } - - // elem is actually elem.style ... set the style - - // IE uses filters for opacity - if ( !jQuery.support.opacity && name == "opacity" ) { - if ( set ) { - // IE has trouble with opacity if it does not have layout - // Force it by setting the zoom level - elem.zoom = 1; - - // Set the alpha filter to set the opacity - elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) + - (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"); - } - - return elem.filter && elem.filter.indexOf("opacity=") >= 0 ? - (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '': - ""; - } - - name = name.replace(/-([a-z])/ig, function(all, letter){ - return letter.toUpperCase(); - }); - - if ( set ) - elem[ name ] = value; - - return elem[ name ]; - }, - - trim: function( text ) { - return (text || "").replace( /^\s+|\s+$/g, "" ); - }, - - makeArray: function( array ) { - var ret = []; - - if( array != null ){ - var i = array.length; - // The window, strings (and functions) also have 'length' - if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval ) - ret[0] = array; - else - while( i ) - ret[--i] = array[i]; - } - - return ret; - }, - - inArray: function( elem, array ) { - for ( var i = 0, length = array.length; i < length; i++ ) - // Use === because on IE, window == document - if ( array[ i ] === elem ) - return i; - - return -1; - }, - - merge: function( first, second ) { - // We have to loop this way because IE & Opera overwrite the length - // expando of getElementsByTagName - var i = 0, elem, pos = first.length; - // Also, we need to make sure that the correct elements are being returned - // (IE returns comment nodes in a '*' query) - if ( !jQuery.support.getAll ) { - while ( (elem = second[ i++ ]) != null ) - if ( elem.nodeType != 8 ) - first[ pos++ ] = elem; - - } else - while ( (elem = second[ i++ ]) != null ) - first[ pos++ ] = elem; - - return first; - }, - - unique: function( array ) { - var ret = [], done = {}; - - try { - - for ( var i = 0, length = array.length; i < length; i++ ) { - var id = jQuery.data( array[ i ] ); - - if ( !done[ id ] ) { - done[ id ] = true; - ret.push( array[ i ] ); - } - } - - } catch( e ) { - ret = array; - } - - return ret; - }, - - grep: function( elems, callback, inv ) { - var ret = []; - - // Go through the array, only saving the items - // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) - if ( !inv != !callback( elems[ i ], i ) ) - ret.push( elems[ i ] ); - - return ret; - }, - - map: function( elems, callback ) { - var ret = []; - - // Go through the array, translating each of the items to their - // new value (or values). - for ( var i = 0, length = elems.length; i < length; i++ ) { - var value = callback( elems[ i ], i ); - - if ( value != null ) - ret[ ret.length ] = value; - } - - return ret.concat.apply( [], ret ); - } -}); - -// Use of jQuery.browser is deprecated. -// It's included for backwards compatibility and plugins, -// although they should work to migrate away. - -var userAgent = navigator.userAgent.toLowerCase(); - -// Figure out what browser is being used -jQuery.browser = { - version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1], - safari: /webkit/.test( userAgent ), - opera: /opera/.test( userAgent ), - msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), - mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) -}; - -jQuery.each({ - parent: function(elem){return elem.parentNode;}, - parents: function(elem){return jQuery.dir(elem,"parentNode");}, - next: function(elem){return jQuery.nth(elem,2,"nextSibling");}, - prev: function(elem){return jQuery.nth(elem,2,"previousSibling");}, - nextAll: function(elem){return jQuery.dir(elem,"nextSibling");}, - prevAll: function(elem){return jQuery.dir(elem,"previousSibling");}, - siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);}, - children: function(elem){return jQuery.sibling(elem.firstChild);}, - contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function(name, original){ - jQuery.fn[ name ] = function( selector ) { - var ret = [], insert = jQuery( selector ); - - for ( var i = 0, l = insert.length; i < l; i++ ) { - var elems = (i > 0 ? this.clone(true) : this).get(); - jQuery.fn[ original ].apply( jQuery(insert[i]), elems ); - ret = ret.concat( elems ); - } - - return this.pushStack( ret, name, selector ); - }; -}); - -jQuery.each({ - removeAttr: function( name ) { - jQuery.attr( this, name, "" ); - if (this.nodeType == 1) - this.removeAttribute( name ); - }, - - addClass: function( classNames ) { - jQuery.className.add( this, classNames ); - }, - - removeClass: function( classNames ) { - jQuery.className.remove( this, classNames ); - }, - - toggleClass: function( classNames, state ) { - if( typeof state !== "boolean" ) - state = !jQuery.className.has( this, classNames ); - jQuery.className[ state ? "add" : "remove" ]( this, classNames ); - }, - - remove: function( selector ) { - if ( !selector || jQuery.filter( selector, [ this ] ).length ) { - // Prevent memory leaks - jQuery( "*", this ).add([this]).each(function(){ - jQuery.event.remove(this); - jQuery.removeData(this); - }); - if (this.parentNode) - this.parentNode.removeChild( this ); - } - }, - - empty: function() { - // Remove element nodes and prevent memory leaks - jQuery(this).children().remove(); - - // Remove any remaining nodes - while ( this.firstChild ) - this.removeChild( this.firstChild ); - } -}, function(name, fn){ - jQuery.fn[ name ] = function(){ - return this.each( fn, arguments ); - }; -}); - -// Helper function used by the dimensions and offset modules -function num(elem, prop) { - return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0; -} -var expando = "jQuery" + now(), uuid = 0, windowData = {}; - -jQuery.extend({ - cache: {}, - - data: function( elem, name, data ) { - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ]; - - // Compute a unique ID for the element - if ( !id ) - id = elem[ expando ] = ++uuid; - - // Only generate the data cache if we're - // trying to access or manipulate it - if ( name && !jQuery.cache[ id ] ) - jQuery.cache[ id ] = {}; - - // Prevent overriding the named cache with undefined values - if ( data !== undefined ) - jQuery.cache[ id ][ name ] = data; - - // Return the named cache data, or the ID for the element - return name ? - jQuery.cache[ id ][ name ] : - id; - }, - - removeData: function( elem, name ) { - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ]; - - // If we want to remove a specific section of the element's data - if ( name ) { - if ( jQuery.cache[ id ] ) { - // Remove the section of cache data - delete jQuery.cache[ id ][ name ]; - - // If we've removed all the data, remove the element's cache - name = ""; - - for ( name in jQuery.cache[ id ] ) - break; - - if ( !name ) - jQuery.removeData( elem ); - } - - // Otherwise, we want to remove all of the element's data - } else { - // Clean up the element expando - try { - delete elem[ expando ]; - } catch(e){ - // IE has trouble directly removing the expando - // but it's ok with using removeAttribute - if ( elem.removeAttribute ) - elem.removeAttribute( expando ); - } - - // Completely remove the data cache - delete jQuery.cache[ id ]; - } - }, - queue: function( elem, type, data ) { - if ( elem ){ - - type = (type || "fx") + "queue"; - - var q = jQuery.data( elem, type ); - - if ( !q || jQuery.isArray(data) ) - q = jQuery.data( elem, type, jQuery.makeArray(data) ); - else if( data ) - q.push( data ); - - } - return q; - }, - - dequeue: function( elem, type ){ - var queue = jQuery.queue( elem, type ), - fn = queue.shift(); - - if( !type || type === "fx" ) - fn = queue[0]; - - if( fn !== undefined ) - fn.call(elem); - } -}); - -jQuery.fn.extend({ - data: function( key, value ){ - var parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if ( value === undefined ) { - var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - if ( data === undefined && this.length ) - data = jQuery.data( this[0], key ); - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - } else - return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ - jQuery.data( this, key, value ); - }); - }, - - removeData: function( key ){ - return this.each(function(){ - jQuery.removeData( this, key ); - }); - }, - queue: function(type, data){ - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - } - - if ( data === undefined ) - return jQuery.queue( this[0], type ); - - return this.each(function(){ - var queue = jQuery.queue( this, type, data ); - - if( type == "fx" && queue.length == 1 ) - queue[0].call(this); - }); - }, - dequeue: function(type){ - return this.each(function(){ - jQuery.dequeue( this, type ); - }); - } -});/*! - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * More information: http://sizzlejs.com/ - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g, - done = 0, - toString = Object.prototype.toString; - -var Sizzle = function(selector, context, results, seed) { - results = results || []; - context = context || document; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) - return []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var parts = [], m, set, checkSet, check, mode, extra, prune = true; - - // Reset the position of the chunker regexp (start from head) - chunker.lastIndex = 0; - - while ( (m = chunker.exec(selector)) !== null ) { - parts.push( m[1] ); - - if ( m[2] ) { - extra = RegExp.rightContext; - break; - } - } - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context ); - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) - selector += parts.shift(); - - set = posProcess( selector, set ); - } - } - } else { - var ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context) ); - set = Sizzle.filter( ret.expr, ret.set ); - - if ( parts.length > 0 ) { - checkSet = makeArray(set); - } else { - prune = false; - } - - while ( parts.length ) { - var cur = parts.pop(), pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, isXML(context) ); - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - throw "Syntax error, unrecognized expression: " + (cur || selector); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - } else if ( context.nodeType === 1 ) { - for ( var i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - } else { - for ( var i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, context, results, seed ); - - if ( sortOrder ) { - hasDuplicate = false; - results.sort(sortOrder); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[i-1] ) { - results.splice(i--, 1); - } - } - } - } - } - - return results; -}; - -Sizzle.matches = function(expr, set){ - return Sizzle(expr, null, null, set); -}; - -Sizzle.find = function(expr, context, isXML){ - var set, match; - - if ( !expr ) { - return []; - } - - for ( var i = 0, l = Expr.order.length; i < l; i++ ) { - var type = Expr.order[i], match; - - if ( (match = Expr.match[ type ].exec( expr )) ) { - var left = RegExp.leftContext; - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace(/\\/g, ""); - set = Expr.find[ type ]( match, context, isXML ); - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = context.getElementsByTagName("*"); - } - - return {set: set, expr: expr}; -}; - -Sizzle.filter = function(expr, set, inplace, not){ - var old = expr, result = [], curLoop = set, match, anyFound, - isXMLFilter = set && set[0] && isXML(set[0]); - - while ( expr && set.length ) { - for ( var type in Expr.filter ) { - if ( (match = Expr.match[ type ].exec( expr )) != null ) { - var filter = Expr.filter[ type ], found, item; - anyFound = false; - - if ( curLoop == result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( var i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - var pass = not ^ !!found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - } else { - curLoop[i] = false; - } - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr == old ) { - if ( anyFound == null ) { - throw "Syntax error, unrecognized expression: " + expr; - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - match: { - ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/ - }, - attrMap: { - "class": "className", - "for": "htmlFor" - }, - attrHandle: { - href: function(elem){ - return elem.getAttribute("href"); - } - }, - relative: { - "+": function(checkSet, part, isXML){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !/\W/.test(part), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag && !isXML ) { - part = part.toUpperCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - ">": function(checkSet, part, isXML){ - var isPartStr = typeof part === "string"; - - if ( isPartStr && !/\W/.test(part) ) { - part = isXML ? part : part.toUpperCase(); - - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName === part ? parent : false; - } - } - } else { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - "": function(checkSet, part, isXML){ - var doneName = done++, checkFn = dirCheck; - - if ( !part.match(/\W/) ) { - var nodeCheck = part = isXML ? part : part.toUpperCase(); - checkFn = dirNodeCheck; - } - - checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); - }, - "~": function(checkSet, part, isXML){ - var doneName = done++, checkFn = dirCheck; - - if ( typeof part === "string" && !part.match(/\W/) ) { - var nodeCheck = part = isXML ? part : part.toUpperCase(); - checkFn = dirNodeCheck; - } - - checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); - } - }, - find: { - ID: function(match, context, isXML){ - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - return m ? [m] : []; - } - }, - NAME: function(match, context, isXML){ - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], results = context.getElementsByName(match[1]); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - TAG: function(match, context){ - return context.getElementsByTagName(match[1]); - } - }, - preFilter: { - CLASS: function(match, curLoop, inplace, result, not, isXML){ - match = " " + match[1].replace(/\\/g, "") + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) { - if ( !inplace ) - result.push( elem ); - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - ID: function(match){ - return match[1].replace(/\\/g, ""); - }, - TAG: function(match, curLoop){ - for ( var i = 0; curLoop[i] === false; i++ ){} - return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase(); - }, - CHILD: function(match){ - if ( match[1] == "nth" ) { - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( - match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - ATTR: function(match, curLoop, inplace, result, not, isXML){ - var name = match[1].replace(/\\/g, ""); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - PSEUDO: function(match, curLoop, inplace, result, not){ - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - if ( !inplace ) { - result.push.apply( result, ret ); - } - return false; - } - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - POS: function(match){ - match.unshift( true ); - return match; - } - }, - filters: { - enabled: function(elem){ - return elem.disabled === false && elem.type !== "hidden"; - }, - disabled: function(elem){ - return elem.disabled === true; - }, - checked: function(elem){ - return elem.checked === true; - }, - selected: function(elem){ - // Accessing this property makes selected-by-default - // options in Safari work properly - elem.parentNode.selectedIndex; - return elem.selected === true; - }, - parent: function(elem){ - return !!elem.firstChild; - }, - empty: function(elem){ - return !elem.firstChild; - }, - has: function(elem, i, match){ - return !!Sizzle( match[3], elem ).length; - }, - header: function(elem){ - return /h\d/i.test( elem.nodeName ); - }, - text: function(elem){ - return "text" === elem.type; - }, - radio: function(elem){ - return "radio" === elem.type; - }, - checkbox: function(elem){ - return "checkbox" === elem.type; - }, - file: function(elem){ - return "file" === elem.type; - }, - password: function(elem){ - return "password" === elem.type; - }, - submit: function(elem){ - return "submit" === elem.type; - }, - image: function(elem){ - return "image" === elem.type; - }, - reset: function(elem){ - return "reset" === elem.type; - }, - button: function(elem){ - return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON"; - }, - input: function(elem){ - return /input|select|textarea|button/i.test(elem.nodeName); - } - }, - setFilters: { - first: function(elem, i){ - return i === 0; - }, - last: function(elem, i, match, array){ - return i === array.length - 1; - }, - even: function(elem, i){ - return i % 2 === 0; - }, - odd: function(elem, i){ - return i % 2 === 1; - }, - lt: function(elem, i, match){ - return i < match[3] - 0; - }, - gt: function(elem, i, match){ - return i > match[3] - 0; - }, - nth: function(elem, i, match){ - return match[3] - 0 == i; - }, - eq: function(elem, i, match){ - return match[3] - 0 == i; - } - }, - filter: { - PSEUDO: function(elem, match, i, array){ - var name = match[1], filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0; - } else if ( name === "not" ) { - var not = match[3]; - - for ( var i = 0, l = not.length; i < l; i++ ) { - if ( not[i] === elem ) { - return false; - } - } - - return true; - } - }, - CHILD: function(elem, match){ - var type = match[1], node = elem; - switch (type) { - case 'only': - case 'first': - while (node = node.previousSibling) { - if ( node.nodeType === 1 ) return false; - } - if ( type == 'first') return true; - node = elem; - case 'last': - while (node = node.nextSibling) { - if ( node.nodeType === 1 ) return false; - } - return true; - case 'nth': - var first = match[2], last = match[3]; - - if ( first == 1 && last == 0 ) { - return true; - } - - var doneName = match[0], - parent = elem.parentNode; - - if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { - var count = 0; - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - parent.sizcache = doneName; - } - - var diff = elem.nodeIndex - last; - if ( first == 0 ) { - return diff == 0; - } else { - return ( diff % first == 0 && diff / first >= 0 ); - } - } - }, - ID: function(elem, match){ - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - TAG: function(elem, match){ - return (match === "*" && elem.nodeType === 1) || elem.nodeName === match; - }, - CLASS: function(elem, match){ - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - ATTR: function(elem, match){ - var name = match[1], - result = Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value != check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - POS: function(elem, match, i, array){ - var name = match[2], filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS; - -for ( var type in Expr.match ) { - Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); -} - -var makeArray = function(array, results) { - array = Array.prototype.slice.call( array ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -try { - Array.prototype.slice.call( document.documentElement.childNodes ); - -// Provide a fallback method if it does not work -} catch(e){ - makeArray = function(array, results) { - var ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - } else { - if ( typeof array.length === "number" ) { - for ( var i = 0, l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - } else { - for ( var i = 0; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} else if ( "sourceIndex" in document.documentElement ) { - sortOrder = function( a, b ) { - var ret = a.sourceIndex - b.sourceIndex; - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} else if ( document.createRange ) { - sortOrder = function( a, b ) { - var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); - aRange.selectNode(a); - aRange.collapse(true); - bRange.selectNode(b); - bRange.collapse(true); - var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} - -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("form"), - id = "script" + (new Date).getTime(); - form.innerHTML = "<input name='" + id + "'/>"; - - // Inject it into the root element, check its status, and remove it quickly - var root = document.documentElement; - root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( !!document.getElementById( id ) ) { - Expr.find.ID = function(match, context, isXML){ - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; - } - }; - - Expr.filter.ID = function(elem, match){ - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } - - root.removeChild( form ); -})(); - -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); - - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function(match, context){ - var results = context.getElementsByTagName(match[1]); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - } - - // Check to see if an attribute returns normalized href attributes - div.innerHTML = "<a href='#'></a>"; - if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - div.firstChild.getAttribute("href") !== "#" ) { - Expr.attrHandle.href = function(elem){ - return elem.getAttribute("href", 2); - }; - } -})(); - -if ( document.querySelectorAll ) (function(){ - var oldSizzle = Sizzle, div = document.createElement("div"); - div.innerHTML = "<p class='TEST'></p>"; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function(query, context, extra, seed){ - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && context.nodeType === 9 && !isXML(context) ) { - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(e){} - } - - return oldSizzle(query, context, extra, seed); - }; - - Sizzle.find = oldSizzle.find; - Sizzle.filter = oldSizzle.filter; - Sizzle.selectors = oldSizzle.selectors; - Sizzle.matches = oldSizzle.matches; -})(); - -if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){ - var div = document.createElement("div"); - div.innerHTML = "<div class='test e'></div><div class='test'></div>"; - - // Opera can't find a second classname (in 9.6) - if ( div.getElementsByClassName("e").length === 0 ) - return; - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) - return; - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function(match, context, isXML) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - var sibDir = dir == "previousSibling" && !isXML; - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - if ( sibDir && elem.nodeType === 1 ){ - elem.sizcache = doneName; - elem.sizset = i; - } - elem = elem[dir]; - var match = false; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem.sizcache = doneName; - elem.sizset = i; - } - - if ( elem.nodeName === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - var sibDir = dir == "previousSibling" && !isXML; - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - if ( sibDir && elem.nodeType === 1 ) { - elem.sizcache = doneName; - elem.sizset = i; - } - elem = elem[dir]; - var match = false; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem.sizcache = doneName; - elem.sizset = i; - } - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -var contains = document.compareDocumentPosition ? function(a, b){ - return a.compareDocumentPosition(b) & 16; -} : function(a, b){ - return a !== b && (a.contains ? a.contains(b) : true); -}; - -var isXML = function(elem){ - return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || - !!elem.ownerDocument && isXML( elem.ownerDocument ); -}; - -var posProcess = function(selector, context){ - var tmpSet = [], later = "", match, - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE -jQuery.find = Sizzle; -jQuery.filter = Sizzle.filter; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; - -Sizzle.selectors.filters.hidden = function(elem){ - return elem.offsetWidth === 0 || elem.offsetHeight === 0; -}; - -Sizzle.selectors.filters.visible = function(elem){ - return elem.offsetWidth > 0 || elem.offsetHeight > 0; -}; - -Sizzle.selectors.filters.animated = function(elem){ - return jQuery.grep(jQuery.timers, function(fn){ - return elem === fn.elem; - }).length; -}; - -jQuery.multiFilter = function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return Sizzle.matches(expr, elems); -}; - -jQuery.dir = function( elem, dir ){ - var matched = [], cur = elem[dir]; - while ( cur && cur != document ) { - if ( cur.nodeType == 1 ) - matched.push( cur ); - cur = cur[dir]; - } - return matched; -}; - -jQuery.nth = function(cur, result, dir, elem){ - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) - if ( cur.nodeType == 1 && ++num == result ) - break; - - return cur; -}; - -jQuery.sibling = function(n, elem){ - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType == 1 && n != elem ) - r.push( n ); - } - - return r; -}; - -return; - -window.Sizzle = Sizzle; - -})(); -/* - * A number of helper functions used for managing events. - * Many of the ideas behind this code originated from - * Dean Edwards' addEvent library. - */ -jQuery.event = { - - // Bind an event to an element - // Original by Dean Edwards - add: function(elem, types, handler, data) { - if ( elem.nodeType == 3 || elem.nodeType == 8 ) - return; - - // For whatever reason, IE has trouble passing the window object - // around, causing it to be cloned in the process - if ( elem.setInterval && elem != window ) - elem = window; - - // Make sure that the function being executed has a unique ID - if ( !handler.guid ) - handler.guid = this.guid++; - - // if data is passed, bind to handler - if ( data !== undefined ) { - // Create temporary function pointer to original handler - var fn = handler; - - // Create unique handler function, wrapped around original handler - handler = this.proxy( fn ); - - // Store data in unique handler - handler.data = data; - } - - // Init the element's event structure - var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}), - handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){ - // Handle the second event of a trigger and when - // an event is called after a page has unloaded - return typeof jQuery !== "undefined" && !jQuery.event.triggered ? - jQuery.event.handle.apply(arguments.callee.elem, arguments) : - undefined; - }); - // Add elem as a property of the handle function - // This is to prevent a memory leak with non-native - // event in IE. - handle.elem = elem; - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - jQuery.each(types.split(/\s+/), function(index, type) { - // Namespaced event handlers - var namespaces = type.split("."); - type = namespaces.shift(); - handler.type = namespaces.slice().sort().join("."); - - // Get the current list of functions bound to this event - var handlers = events[type]; - - if ( jQuery.event.specialAll[type] ) - jQuery.event.specialAll[type].setup.call(elem, data, namespaces); - - // Init the event handler queue - if (!handlers) { - handlers = events[type] = {}; - - // Check for a special event handler - // Only use addEventListener/attachEvent if the special - // events handler returns false - if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) { - // Bind the global event handler to the element - if (elem.addEventListener) - elem.addEventListener(type, handle, false); - else if (elem.attachEvent) - elem.attachEvent("on" + type, handle); - } - } - - // Add the function to the element's handler list - handlers[handler.guid] = handler; - - // Keep track of which events have been used, for global triggering - jQuery.event.global[type] = true; - }); - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - guid: 1, - global: {}, - - // Detach an event or set of events from an element - remove: function(elem, types, handler) { - // don't do events on text and comment nodes - if ( elem.nodeType == 3 || elem.nodeType == 8 ) - return; - - var events = jQuery.data(elem, "events"), ret, index; - - if ( events ) { - // Unbind all events for the element - if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") ) - for ( var type in events ) - this.remove( elem, type + (types || "") ); - else { - // types is actually an event object here - if ( types.type ) { - handler = types.handler; - types = types.type; - } - - // Handle multiple events seperated by a space - // jQuery(...).unbind("mouseover mouseout", fn); - jQuery.each(types.split(/\s+/), function(index, type){ - // Namespaced event handlers - var namespaces = type.split("."); - type = namespaces.shift(); - var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); - - if ( events[type] ) { - // remove the given handler for the given type - if ( handler ) - delete events[type][handler.guid]; - - // remove all handlers for the given type - else - for ( var handle in events[type] ) - // Handle the removal of namespaced events - if ( namespace.test(events[type][handle].type) ) - delete events[type][handle]; - - if ( jQuery.event.specialAll[type] ) - jQuery.event.specialAll[type].teardown.call(elem, namespaces); - - // remove generic event handler if no more handlers exist - for ( ret in events[type] ) break; - if ( !ret ) { - if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) { - if (elem.removeEventListener) - elem.removeEventListener(type, jQuery.data(elem, "handle"), false); - else if (elem.detachEvent) - elem.detachEvent("on" + type, jQuery.data(elem, "handle")); - } - ret = null; - delete events[type]; - } - } - }); - } - - // Remove the expando if it's no longer used - for ( ret in events ) break; - if ( !ret ) { - var handle = jQuery.data( elem, "handle" ); - if ( handle ) handle.elem = null; - jQuery.removeData( elem, "events" ); - jQuery.removeData( elem, "handle" ); - } - } - }, - - // bubbling is internal - trigger: function( event, data, elem, bubbling ) { - // Event object or event type - var type = event.type || event; - - if( !bubbling ){ - event = typeof event === "object" ? - // jQuery.Event object - event[expando] ? event : - // Object literal - jQuery.extend( jQuery.Event(type), event ) : - // Just the event type (string) - jQuery.Event(type); - - if ( type.indexOf("!") >= 0 ) { - event.type = type = type.slice(0, -1); - event.exclusive = true; - } - - // Handle a global trigger - if ( !elem ) { - // Don't bubble custom events when global (to avoid too much overhead) - event.stopPropagation(); - // Only trigger if we've ever bound an event for it - if ( this.global[type] ) - jQuery.each( jQuery.cache, function(){ - if ( this.events && this.events[type] ) - jQuery.event.trigger( event, data, this.handle.elem ); - }); - } - - // Handle triggering a single element - - // don't do events on text and comment nodes - if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 ) - return undefined; - - // Clean up in case it is reused - event.result = undefined; - event.target = elem; - - // Clone the incoming data, if any - data = jQuery.makeArray(data); - data.unshift( event ); - } - - event.currentTarget = elem; - - // Trigger the event, it is assumed that "handle" is a function - var handle = jQuery.data(elem, "handle"); - if ( handle ) - handle.apply( elem, data ); - - // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links) - if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false ) - event.result = false; - - // Trigger the native events (except for clicks on links) - if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) { - this.triggered = true; - try { - elem[ type ](); - // prevent IE from throwing an error for some hidden elements - } catch (e) {} - } - - this.triggered = false; - - if ( !event.isPropagationStopped() ) { - var parent = elem.parentNode || elem.ownerDocument; - if ( parent ) - jQuery.event.trigger(event, data, parent, true); - } - }, - - handle: function(event) { - // returned undefined or false - var all, handlers; - - event = arguments[0] = jQuery.event.fix( event || window.event ); - event.currentTarget = this; - - // Namespaced event handlers - var namespaces = event.type.split("."); - event.type = namespaces.shift(); - - // Cache this now, all = true means, any handler - all = !namespaces.length && !event.exclusive; - - var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); - - handlers = ( jQuery.data(this, "events") || {} )[event.type]; - - for ( var j in handlers ) { - var handler = handlers[j]; - - // Filter the functions by class - if ( all || namespace.test(handler.type) ) { - // Pass in a reference to the handler function itself - // So that we can later remove it - event.handler = handler; - event.data = handler.data; - - var ret = handler.apply(this, arguments); - - if( ret !== undefined ){ - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - - if( event.isImmediatePropagationStopped() ) - break; - - } - } - }, - - props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), - - fix: function(event) { - if ( event[expando] ) - return event; - - // store a copy of the original event object - // and "clone" to set read-only properties - var originalEvent = event; - event = jQuery.Event( originalEvent ); - - for ( var i = this.props.length, prop; i; ){ - prop = this.props[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary - if ( !event.target ) - event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either - - // check if target is a textnode (safari) - if ( event.target.nodeType == 3 ) - event.target = event.target.parentNode; - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && event.fromElement ) - event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && event.clientX != null ) { - var doc = document.documentElement, body = document.body; - event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0); - event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0); - } - - // Add which for key events - if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) - event.which = event.charCode || event.keyCode; - - // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) - if ( !event.metaKey && event.ctrlKey ) - event.metaKey = event.ctrlKey; - - // Add which for click: 1 == left; 2 == middle; 3 == right - // Note: button is not normalized, so don't use it - if ( !event.which && event.button ) - event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); - - return event; - }, - - proxy: function( fn, proxy ){ - proxy = proxy || function(){ return fn.apply(this, arguments); }; - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++; - // So proxy can be declared as an argument - return proxy; - }, - - special: { - ready: { - // Make sure the ready event is setup - setup: bindReady, - teardown: function() {} - } - }, - - specialAll: { - live: { - setup: function( selector, namespaces ){ - jQuery.event.add( this, namespaces[0], liveHandler ); - }, - teardown: function( namespaces ){ - if ( namespaces.length ) { - var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)"); - - jQuery.each( (jQuery.data(this, "events").live || {}), function(){ - if ( name.test(this.type) ) - remove++; - }); - - if ( remove < 1 ) - jQuery.event.remove( this, namespaces[0], liveHandler ); - } - } - } - } -}; - -jQuery.Event = function( src ){ - // Allow instantiation without the 'new' keyword - if( !this.preventDefault ) - return new jQuery.Event(src); - - // Event object - if( src && src.type ){ - this.originalEvent = src; - this.type = src.type; - // Event type - }else - this.type = src; - - // timeStamp is buggy for some events on Firefox(#3843) - // So we won't rely on the native value - this.timeStamp = now(); - - // Mark it as fixed - this[expando] = true; -}; - -function returnFalse(){ - return false; -} -function returnTrue(){ - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if( !e ) - return; - // if preventDefault exists run it on the original event - if (e.preventDefault) - e.preventDefault(); - // otherwise set the returnValue property of the original event to false (IE) - e.returnValue = false; - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if( !e ) - return; - // if stopPropagation exists run it on the original event - if (e.stopPropagation) - e.stopPropagation(); - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation:function(){ - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; -// Checks if an event happened on an element within another element -// Used in jQuery.event.special.mouseenter and mouseleave handlers -var withinElement = function(event) { - // Check if mouse(over|out) are still within the same parent element - var parent = event.relatedTarget; - // Traverse up the tree - while ( parent && parent != this ) - try { parent = parent.parentNode; } - catch(e) { parent = this; } - - if( parent != this ){ - // set the correct event type - event.type = event.data; - // handle event if we actually just moused on to a non sub-element - jQuery.event.handle.apply( this, arguments ); - } -}; - -jQuery.each({ - mouseover: 'mouseenter', - mouseout: 'mouseleave' -}, function( orig, fix ){ - jQuery.event.special[ fix ] = { - setup: function(){ - jQuery.event.add( this, orig, withinElement, fix ); - }, - teardown: function(){ - jQuery.event.remove( this, orig, withinElement ); - } - }; -}); - -jQuery.fn.extend({ - bind: function( type, data, fn ) { - return type == "unload" ? this.one(type, data, fn) : this.each(function(){ - jQuery.event.add( this, type, fn || data, fn && data ); - }); - }, - - one: function( type, data, fn ) { - var one = jQuery.event.proxy( fn || data, function(event) { - jQuery(this).unbind(event, one); - return (fn || data).apply( this, arguments ); - }); - return this.each(function(){ - jQuery.event.add( this, type, one, fn && data); - }); - }, - - unbind: function( type, fn ) { - return this.each(function(){ - jQuery.event.remove( this, type, fn ); - }); - }, - - trigger: function( type, data ) { - return this.each(function(){ - jQuery.event.trigger( type, data, this ); - }); - }, - - triggerHandler: function( type, data ) { - if( this[0] ){ - var event = jQuery.Event(type); - event.preventDefault(); - event.stopPropagation(); - jQuery.event.trigger( event, data, this[0] ); - return event.result; - } - }, - - toggle: function( fn ) { - // Save reference to arguments for access in closure - var args = arguments, i = 1; - - // link all the functions, so any of them can unbind this click handler - while( i < args.length ) - jQuery.event.proxy( fn, args[i++] ); - - return this.click( jQuery.event.proxy( fn, function(event) { - // Figure out which function to execute - this.lastToggle = ( this.lastToggle || 0 ) % i; - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ this.lastToggle++ ].apply( this, arguments ) || false; - })); - }, - - hover: function(fnOver, fnOut) { - return this.mouseenter(fnOver).mouseleave(fnOut); - }, - - ready: function(fn) { - // Attach the listeners - bindReady(); - - // If the DOM is already ready - if ( jQuery.isReady ) - // Execute the function immediately - fn.call( document, jQuery ); - - // Otherwise, remember the function for later - else - // Add the function to the wait list - jQuery.readyList.push( fn ); - - return this; - }, - - live: function( type, fn ){ - var proxy = jQuery.event.proxy( fn ); - proxy.guid += this.selector + type; - - jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy ); - - return this; - }, - - die: function( type, fn ){ - jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null ); - return this; - } -}); - -function liveHandler( event ){ - var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"), - stop = true, - elems = []; - - jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){ - if ( check.test(fn.type) ) { - var elem = jQuery(event.target).closest(fn.data)[0]; - if ( elem ) - elems.push({ elem: elem, fn: fn }); - } - }); - - elems.sort(function(a,b) { - return jQuery.data(a.elem, "closest") - jQuery.data(b.elem, "closest"); - }); - - jQuery.each(elems, function(){ - if ( this.fn.call(this.elem, event, this.fn.data) === false ) - return (stop = false); - }); - - return stop; -} - -function liveConvert(type, selector){ - return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join("."); -} - -jQuery.extend({ - isReady: false, - readyList: [], - // Handle when the DOM is ready - ready: function() { - // Make sure that the DOM is not already loaded - if ( !jQuery.isReady ) { - // Remember that the DOM is ready - jQuery.isReady = true; - - // If there are functions bound, to execute - if ( jQuery.readyList ) { - // Execute all of them - jQuery.each( jQuery.readyList, function(){ - this.call( document, jQuery ); - }); - - // Reset the list of functions - jQuery.readyList = null; - } - - // Trigger any bound ready events - jQuery(document).triggerHandler("ready"); - } - } -}); - -var readyBound = false; - -function bindReady(){ - if ( readyBound ) return; - readyBound = true; - - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", function(){ - document.removeEventListener( "DOMContentLoaded", arguments.callee, false ); - jQuery.ready(); - }, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent("onreadystatechange", function(){ - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", arguments.callee ); - jQuery.ready(); - } - }); - - // If IE and not an iframe - // continually check to see if the document is ready - if ( document.documentElement.doScroll && window == window.top ) (function(){ - if ( jQuery.isReady ) return; - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch( error ) { - setTimeout( arguments.callee, 0 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); - })(); - } - - // A fallback to window.onload, that will always work - jQuery.event.add( window, "load", jQuery.ready ); -} - -jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," + - "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," + - "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){ - - // Handle event binding - jQuery.fn[name] = function(fn){ - return fn ? this.bind(name, fn) : this.trigger(name); - }; -}); - -// Prevent memory leaks in IE -// And prevent errors on refresh with events like mouseover in other browsers -// Window isn't included so as not to unbind existing unload events -jQuery( window ).bind( 'unload', function(){ - for ( var id in jQuery.cache ) - // Skip the window - if ( id != 1 && jQuery.cache[ id ].handle ) - jQuery.event.remove( jQuery.cache[ id ].handle.elem ); -}); -(function(){ - - jQuery.support = {}; - - var root = document.documentElement, - script = document.createElement("script"), - div = document.createElement("div"), - id = "script" + (new Date).getTime(); - - div.style.display = "none"; - div.innerHTML = ' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>'; - - var all = div.getElementsByTagName("*"), - a = div.getElementsByTagName("a")[0]; - - // Can't get basic test support - if ( !all || !all.length || !a ) { - return; - } - - jQuery.support = { - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: div.firstChild.nodeType == 3, - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName("tbody").length, - - // Make sure that you can get all elements in an <object> element - // IE 7 always returns no results - objectAll: !!div.getElementsByTagName("object")[0] - .getElementsByTagName("*").length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName("link").length, - - // Get the style information from getAttribute - // (IE uses .cssText insted) - style: /red/.test( a.getAttribute("style") ), - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: a.getAttribute("href") === "/a", - - // Make sure that element opacity exists - // (IE uses filter instead) - opacity: a.style.opacity === "0.5", - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: !!a.style.cssFloat, - - // Will be defined later - scriptEval: false, - noCloneEvent: true, - boxModel: null - }; - - script.type = "text/javascript"; - try { - script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); - } catch(e){} - - root.insertBefore( script, root.firstChild ); - - // Make sure that the execution of code works by injecting a script - // tag with appendChild/createTextNode - // (IE doesn't support this, fails, and uses .text instead) - if ( window[ id ] ) { - jQuery.support.scriptEval = true; - delete window[ id ]; - } - - root.removeChild( script ); - - if ( div.attachEvent && div.fireEvent ) { - div.attachEvent("onclick", function(){ - // Cloning a node shouldn't copy over any - // bound event handlers (IE does this) - jQuery.support.noCloneEvent = false; - div.detachEvent("onclick", arguments.callee); - }); - div.cloneNode(true).fireEvent("onclick"); - } - - // Figure out if the W3C box model works as expected - // document.body must exist before we can do this - jQuery(function(){ - var div = document.createElement("div"); - div.style.width = div.style.paddingLeft = "1px"; - - document.body.appendChild( div ); - jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; - document.body.removeChild( div ).style.display = 'none'; - }); -})(); - -var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat"; - -jQuery.props = { - "for": "htmlFor", - "class": "className", - "float": styleFloat, - cssFloat: styleFloat, - styleFloat: styleFloat, - readonly: "readOnly", - maxlength: "maxLength", - cellspacing: "cellSpacing", - rowspan: "rowSpan", - tabindex: "tabIndex" -}; -jQuery.fn.extend({ - // Keep a copy of the old load - _load: jQuery.fn.load, - - load: function( url, params, callback ) { - if ( typeof url !== "string" ) - return this._load( url ); - - var off = url.indexOf(" "); - if ( off >= 0 ) { - var selector = url.slice(off, url.length); - url = url.slice(0, off); - } - - // Default to a GET request - var type = "GET"; - - // If the second parameter was provided - if ( params ) - // If it's a function - if ( jQuery.isFunction( params ) ) { - // We assume that it's the callback - callback = params; - params = null; - - // Otherwise, build a param string - } else if( typeof params === "object" ) { - params = jQuery.param( params ); - type = "POST"; - } - - var self = this; - - // Request the remote document - jQuery.ajax({ - url: url, - type: type, - dataType: "html", - data: params, - complete: function(res, status){ - // If successful, inject the HTML into all the matched elements - if ( status == "success" || status == "notmodified" ) - // See if a selector was specified - self.html( selector ? - // Create a dummy div to hold the results - jQuery("<div/>") - // inject the contents of the document in, removing the scripts - // to avoid any 'Permission Denied' errors in IE - .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, "")) - - // Locate the specified elements - .find(selector) : - - // If not, just inject the full result - res.responseText ); - - if( callback ) - self.each( callback, [res.responseText, status, res] ); - } - }); - return this; - }, - - serialize: function() { - return jQuery.param(this.serializeArray()); - }, - serializeArray: function() { - return this.map(function(){ - return this.elements ? jQuery.makeArray(this.elements) : this; - }) - .filter(function(){ - return this.name && !this.disabled && - (this.checked || /select|textarea/i.test(this.nodeName) || - /text|hidden|password|search/i.test(this.type)); - }) - .map(function(i, elem){ - var val = jQuery(this).val(); - return val == null ? null : - jQuery.isArray(val) ? - jQuery.map( val, function(val, i){ - return {name: elem.name, value: val}; - }) : - {name: elem.name, value: val}; - }).get(); - } -}); - -// Attach a bunch of functions for handling common AJAX events -jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){ - jQuery.fn[o] = function(f){ - return this.bind(o, f); - }; -}); - -var jsc = now(); - -jQuery.extend({ - - get: function( url, data, callback, type ) { - // shift arguments if data argument was ommited - if ( jQuery.isFunction( data ) ) { - callback = data; - data = null; - } - - return jQuery.ajax({ - type: "GET", - url: url, - data: data, - success: callback, - dataType: type - }); - }, - - getScript: function( url, callback ) { - return jQuery.get(url, null, callback, "script"); - }, - - getJSON: function( url, data, callback ) { - return jQuery.get(url, data, callback, "json"); - }, - - post: function( url, data, callback, type ) { - if ( jQuery.isFunction( data ) ) { - callback = data; - data = {}; - } - - return jQuery.ajax({ - type: "POST", - url: url, - data: data, - success: callback, - dataType: type - }); - }, - - ajaxSetup: function( settings ) { - jQuery.extend( jQuery.ajaxSettings, settings ); - }, - - ajaxSettings: { - url: location.href, - global: true, - type: "GET", - contentType: "application/x-www-form-urlencoded", - processData: true, - async: true, - /* - timeout: 0, - data: null, - username: null, - password: null, - */ - // Create the request object; Microsoft failed to properly - // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available - // This function can be overriden by calling jQuery.ajaxSetup - xhr:function(){ - return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); - }, - accepts: { - xml: "application/xml, text/xml", - html: "text/html", - script: "text/javascript, application/javascript", - json: "application/json, text/javascript", - text: "text/plain", - _default: "*/*" - } - }, - - // Last-Modified header cache for next request - lastModified: {}, - - ajax: function( s ) { - // Extend the settings, but re-extend 's' so that it can be - // checked again later (in the test suite, specifically) - s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s)); - - var jsonp, jsre = /=\?(&|$)/g, status, data, - type = s.type.toUpperCase(); - - // convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) - s.data = jQuery.param(s.data); - - // Handle JSONP Parameter Callbacks - if ( s.dataType == "jsonp" ) { - if ( type == "GET" ) { - if ( !s.url.match(jsre) ) - s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?"; - } else if ( !s.data || !s.data.match(jsre) ) - s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?"; - s.dataType = "json"; - } - - // Build temporary JSONP function - if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) { - jsonp = "jsonp" + jsc++; - - // Replace the =? sequence both in the query string and the data - if ( s.data ) - s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1"); - s.url = s.url.replace(jsre, "=" + jsonp + "$1"); - - // We need to make sure - // that a JSONP style response is executed properly - s.dataType = "script"; - - // Handle JSONP-style loading - window[ jsonp ] = function(tmp){ - data = tmp; - success(); - complete(); - // Garbage collect - window[ jsonp ] = undefined; - try{ delete window[ jsonp ]; } catch(e){} - if ( head ) - head.removeChild( script ); - }; - } - - if ( s.dataType == "script" && s.cache == null ) - s.cache = false; - - if ( s.cache === false && type == "GET" ) { - var ts = now(); - // try replacing _= if it is there - var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2"); - // if nothing was replaced, add timestamp to the end - s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : ""); - } - - // If data is available, append data to url for get requests - if ( s.data && type == "GET" ) { - s.url += (s.url.match(/\?/) ? "&" : "?") + s.data; - - // IE likes to send both get and post data, prevent this - s.data = null; - } - - // Watch for a new set of requests - if ( s.global && ! jQuery.active++ ) - jQuery.event.trigger( "ajaxStart" ); - - // Matches an absolute URL, and saves the domain - var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url ); - - // If we're requesting a remote document - // and trying to load JSON or Script with a GET - if ( s.dataType == "script" && type == "GET" && parts - && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){ - - var head = document.getElementsByTagName("head")[0]; - var script = document.createElement("script"); - script.src = s.url; - if (s.scriptCharset) - script.charset = s.scriptCharset; - - // Handle Script loading - if ( !jsonp ) { - var done = false; - - // Attach handlers for all browsers - script.onload = script.onreadystatechange = function(){ - if ( !done && (!this.readyState || - this.readyState == "loaded" || this.readyState == "complete") ) { - done = true; - success(); - complete(); - - // Handle memory leak in IE - script.onload = script.onreadystatechange = null; - head.removeChild( script ); - } - }; - } - - head.appendChild(script); - - // We handle everything using the script element injection - return undefined; - } - - var requestDone = false; - - // Create the request object - var xhr = s.xhr(); - - // Open the socket - // Passing null username, generates a login popup on Opera (#2865) - if( s.username ) - xhr.open(type, s.url, s.async, s.username, s.password); - else - xhr.open(type, s.url, s.async); - - // Need an extra try/catch for cross domain requests in Firefox 3 - try { - // Set the correct header, if data is being sent - if ( s.data ) - xhr.setRequestHeader("Content-Type", s.contentType); - - // Set the If-Modified-Since header, if ifModified mode. - if ( s.ifModified ) - xhr.setRequestHeader("If-Modified-Since", - jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" ); - - // Set header so the called script knows that it's an XMLHttpRequest - xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - - // Set the Accepts header for the server, depending on the dataType - xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ? - s.accepts[ s.dataType ] + ", */*" : - s.accepts._default ); - } catch(e){} - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && s.beforeSend(xhr, s) === false ) { - // Handle the global AJAX counter - if ( s.global && ! --jQuery.active ) - jQuery.event.trigger( "ajaxStop" ); - // close opended socket - xhr.abort(); - return false; - } - - if ( s.global ) - jQuery.event.trigger("ajaxSend", [xhr, s]); - - // Wait for a response to come back - var onreadystatechange = function(isTimeout){ - // The request was aborted, clear the interval and decrement jQuery.active - if (xhr.readyState == 0) { - if (ival) { - // clear poll interval - clearInterval(ival); - ival = null; - // Handle the global AJAX counter - if ( s.global && ! --jQuery.active ) - jQuery.event.trigger( "ajaxStop" ); - } - // The transfer is complete and the data is available, or the request timed out - } else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) { - requestDone = true; - - // clear poll interval - if (ival) { - clearInterval(ival); - ival = null; - } - - status = isTimeout == "timeout" ? "timeout" : - !jQuery.httpSuccess( xhr ) ? "error" : - s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" : - "success"; - - if ( status == "success" ) { - // Watch for, and catch, XML document parse errors - try { - // process the data (runs the xml through httpData regardless of callback) - data = jQuery.httpData( xhr, s.dataType, s ); - } catch(e) { - status = "parsererror"; - } - } - - // Make sure that the request was successful or notmodified - if ( status == "success" ) { - // Cache Last-Modified header, if ifModified mode. - var modRes; - try { - modRes = xhr.getResponseHeader("Last-Modified"); - } catch(e) {} // swallow exception thrown by FF if header is not available - - if ( s.ifModified && modRes ) - jQuery.lastModified[s.url] = modRes; - - // JSONP handles its own success callback - if ( !jsonp ) - success(); - } else - jQuery.handleError(s, xhr, status); - - // Fire the complete handlers - complete(); - - if ( isTimeout ) - xhr.abort(); - - // Stop memory leaks - if ( s.async ) - xhr = null; - } - }; - - if ( s.async ) { - // don't attach the handler to the request, just poll it instead - var ival = setInterval(onreadystatechange, 13); - - // Timeout checker - if ( s.timeout > 0 ) - setTimeout(function(){ - // Check to see if the request is still happening - if ( xhr && !requestDone ) - onreadystatechange( "timeout" ); - }, s.timeout); - } - - // Send the data - try { - xhr.send(s.data); - } catch(e) { - jQuery.handleError(s, xhr, null, e); - } - - // firefox 1.5 doesn't fire statechange for sync requests - if ( !s.async ) - onreadystatechange(); - - function success(){ - // If a local callback was specified, fire it and pass it the data - if ( s.success ) - s.success( data, status ); - - // Fire the global callback - if ( s.global ) - jQuery.event.trigger( "ajaxSuccess", [xhr, s] ); - } - - function complete(){ - // Process result - if ( s.complete ) - s.complete(xhr, status); - - // The request was completed - if ( s.global ) - jQuery.event.trigger( "ajaxComplete", [xhr, s] ); - - // Handle the global AJAX counter - if ( s.global && ! --jQuery.active ) - jQuery.event.trigger( "ajaxStop" ); - } - - // return XMLHttpRequest to allow aborting the request etc. - return xhr; - }, - - handleError: function( s, xhr, status, e ) { - // If a local callback was specified, fire it - if ( s.error ) s.error( xhr, status, e ); - - // Fire the global callback - if ( s.global ) - jQuery.event.trigger( "ajaxError", [xhr, s, e] ); - }, - - // Counter for holding the number of active queries - active: 0, - - // Determines if an XMLHttpRequest was successful or not - httpSuccess: function( xhr ) { - try { - // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450 - return !xhr.status && location.protocol == "file:" || - ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223; - } catch(e){} - return false; - }, - - // Determines if an XMLHttpRequest returns NotModified - httpNotModified: function( xhr, url ) { - try { - var xhrRes = xhr.getResponseHeader("Last-Modified"); - - // Firefox always returns 200. check Last-Modified date - return xhr.status == 304 || xhrRes == jQuery.lastModified[url]; - } catch(e){} - return false; - }, - - httpData: function( xhr, type, s ) { - var ct = xhr.getResponseHeader("content-type"), - xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0, - data = xml ? xhr.responseXML : xhr.responseText; - - if ( xml && data.documentElement.tagName == "parsererror" ) - throw "parsererror"; - - // Allow a pre-filtering function to sanitize the response - // s != null is checked to keep backwards compatibility - if( s && s.dataFilter ) - data = s.dataFilter( data, type ); - - // The filter can actually parse the response - if( typeof data === "string" ){ - - // If the type is "script", eval it in global context - if ( type == "script" ) - jQuery.globalEval( data ); - - // Get the JavaScript object, if JSON is used. - if ( type == "json" ) - data = window["eval"]("(" + data + ")"); - } - - return data; - }, - - // Serialize an array of form elements or a set of - // key/values into a query string - param: function( a ) { - var s = [ ]; - - function add( key, value ){ - s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value); - }; - - // If an array was passed in, assume that it is an array - // of form elements - if ( jQuery.isArray(a) || a.jquery ) - // Serialize the form elements - jQuery.each( a, function(){ - add( this.name, this.value ); - }); - - // Otherwise, assume that it's an object of key/value pairs - else - // Serialize the key/values - for ( var j in a ) - // If the value is an array then the key names need to be repeated - if ( jQuery.isArray(a[j]) ) - jQuery.each( a[j], function(){ - add( j, this ); - }); - else - add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] ); - - // Return the resulting serialization - return s.join("&").replace(/%20/g, "+"); - } - -}); -var elemdisplay = {}, - timerId, - fxAttrs = [ - // height animations - [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], - // width animations - [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], - // opacity animations - [ "opacity" ] - ]; - -function genFx( type, num ){ - var obj = {}; - jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){ - obj[ this ] = type; - }); - return obj; -} - -jQuery.fn.extend({ - show: function(speed,callback){ - if ( speed ) { - return this.animate( genFx("show", 3), speed, callback); - } else { - for ( var i = 0, l = this.length; i < l; i++ ){ - var old = jQuery.data(this[i], "olddisplay"); - - this[i].style.display = old || ""; - - if ( jQuery.css(this[i], "display") === "none" ) { - var tagName = this[i].tagName, display; - - if ( elemdisplay[ tagName ] ) { - display = elemdisplay[ tagName ]; - } else { - var elem = jQuery("<" + tagName + " />").appendTo("body"); - - display = elem.css("display"); - if ( display === "none" ) - display = "block"; - - elem.remove(); - - elemdisplay[ tagName ] = display; - } - - jQuery.data(this[i], "olddisplay", display); - } - } - - // Set the display of the elements in a second loop - // to avoid the constant reflow - for ( var i = 0, l = this.length; i < l; i++ ){ - this[i].style.display = jQuery.data(this[i], "olddisplay") || ""; - } - - return this; - } - }, - - hide: function(speed,callback){ - if ( speed ) { - return this.animate( genFx("hide", 3), speed, callback); - } else { - for ( var i = 0, l = this.length; i < l; i++ ){ - var old = jQuery.data(this[i], "olddisplay"); - if ( !old && old !== "none" ) - jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display")); - } - - // Set the display of the elements in a second loop - // to avoid the constant reflow - for ( var i = 0, l = this.length; i < l; i++ ){ - this[i].style.display = "none"; - } - - return this; - } - }, - - // Save the old toggle function - _toggle: jQuery.fn.toggle, - - toggle: function( fn, fn2 ){ - var bool = typeof fn === "boolean"; - - return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? - this._toggle.apply( this, arguments ) : - fn == null || bool ? - this.each(function(){ - var state = bool ? fn : jQuery(this).is(":hidden"); - jQuery(this)[ state ? "show" : "hide" ](); - }) : - this.animate(genFx("toggle", 3), fn, fn2); - }, - - fadeTo: function(speed,to,callback){ - return this.animate({opacity: to}, speed, callback); - }, - - animate: function( prop, speed, easing, callback ) { - var optall = jQuery.speed(speed, easing, callback); - - return this[ optall.queue === false ? "each" : "queue" ](function(){ - - var opt = jQuery.extend({}, optall), p, - hidden = this.nodeType == 1 && jQuery(this).is(":hidden"), - self = this; - - for ( p in prop ) { - if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden ) - return opt.complete.call(this); - - if ( ( p == "height" || p == "width" ) && this.style ) { - // Store display property - opt.display = jQuery.css(this, "display"); - - // Make sure that nothing sneaks out - opt.overflow = this.style.overflow; - } - } - - if ( opt.overflow != null ) - this.style.overflow = "hidden"; - - opt.curAnim = jQuery.extend({}, prop); - - jQuery.each( prop, function(name, val){ - var e = new jQuery.fx( self, opt, name ); - - if ( /toggle|show|hide/.test(val) ) - e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop ); - else { - var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/), - start = e.cur(true) || 0; - - if ( parts ) { - var end = parseFloat(parts[2]), - unit = parts[3] || "px"; - - // We need to compute starting value - if ( unit != "px" ) { - self.style[ name ] = (end || 1) + unit; - start = ((end || 1) / e.cur(true)) * start; - self.style[ name ] = start + unit; - } - - // If a +=/-= token was provided, we're doing a relative animation - if ( parts[1] ) - end = ((parts[1] == "-=" ? -1 : 1) * end) + start; - - e.custom( start, end, unit ); - } else - e.custom( start, val, "" ); - } - }); - - // For JS strict compliance - return true; - }); - }, - - stop: function(clearQueue, gotoEnd){ - var timers = jQuery.timers; - - if (clearQueue) - this.queue([]); - - this.each(function(){ - // go in reverse order so anything added to the queue during the loop is ignored - for ( var i = timers.length - 1; i >= 0; i-- ) - if ( timers[i].elem == this ) { - if (gotoEnd) - // force the next step to be the last - timers[i](true); - timers.splice(i, 1); - } - }); - - // start the next in the queue if the last step wasn't forced - if (!gotoEnd) - this.dequeue(); - - return this; - } - -}); - -// Generate shortcuts for custom animations -jQuery.each({ - slideDown: genFx("show", 1), - slideUp: genFx("hide", 1), - slideToggle: genFx("toggle", 1), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" } -}, function( name, props ){ - jQuery.fn[ name ] = function( speed, callback ){ - return this.animate( props, speed, callback ); - }; -}); - -jQuery.extend({ - - speed: function(speed, easing, fn) { - var opt = typeof speed === "object" ? speed : { - complete: fn || !fn && easing || - jQuery.isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !jQuery.isFunction(easing) && easing - }; - - opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : - jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default; - - // Queueing - opt.old = opt.complete; - opt.complete = function(){ - if ( opt.queue !== false ) - jQuery(this).dequeue(); - if ( jQuery.isFunction( opt.old ) ) - opt.old.call( this ); - }; - - return opt; - }, - - easing: { - linear: function( p, n, firstNum, diff ) { - return firstNum + diff * p; - }, - swing: function( p, n, firstNum, diff ) { - return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; - } - }, - - timers: [], - - fx: function( elem, options, prop ){ - this.options = options; - this.elem = elem; - this.prop = prop; - - if ( !options.orig ) - options.orig = {}; - } - -}); - -jQuery.fx.prototype = { - - // Simple function for setting a style value - update: function(){ - if ( this.options.step ) - this.options.step.call( this.elem, this.now, this ); - - (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); - - // Set display property to block for height/width animations - if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style ) - this.elem.style.display = "block"; - }, - - // Get the current size - cur: function(force){ - if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) - return this.elem[ this.prop ]; - - var r = parseFloat(jQuery.css(this.elem, this.prop, force)); - return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0; - }, - - // Start an animation from one number to another - custom: function(from, to, unit){ - this.startTime = now(); - this.start = from; - this.end = to; - this.unit = unit || this.unit || "px"; - this.now = this.start; - this.pos = this.state = 0; - - var self = this; - function t(gotoEnd){ - return self.step(gotoEnd); - } - - t.elem = this.elem; - - if ( t() && jQuery.timers.push(t) && !timerId ) { - timerId = setInterval(function(){ - var timers = jQuery.timers; - - for ( var i = 0; i < timers.length; i++ ) - if ( !timers[i]() ) - timers.splice(i--, 1); - - if ( !timers.length ) { - clearInterval( timerId ); - timerId = undefined; - } - }, 13); - } - }, - - // Simple 'show' function - show: function(){ - // Remember where we started, so that we can go back to it later - this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); - this.options.show = true; - - // Begin the animation - // Make sure that we start at a small width/height to avoid any - // flash of content - this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur()); - - // Start by showing the element - jQuery(this.elem).show(); - }, - - // Simple 'hide' function - hide: function(){ - // Remember where we started, so that we can go back to it later - this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); - this.options.hide = true; - - // Begin the animation - this.custom(this.cur(), 0); - }, - - // Each step of an animation - step: function(gotoEnd){ - var t = now(); - - if ( gotoEnd || t >= this.options.duration + this.startTime ) { - this.now = this.end; - this.pos = this.state = 1; - this.update(); - - this.options.curAnim[ this.prop ] = true; - - var done = true; - for ( var i in this.options.curAnim ) - if ( this.options.curAnim[i] !== true ) - done = false; - - if ( done ) { - if ( this.options.display != null ) { - // Reset the overflow - this.elem.style.overflow = this.options.overflow; - - // Reset the display - this.elem.style.display = this.options.display; - if ( jQuery.css(this.elem, "display") == "none" ) - this.elem.style.display = "block"; - } - - // Hide the element if the "hide" operation was done - if ( this.options.hide ) - jQuery(this.elem).hide(); - - // Reset the properties, if the item has been hidden or shown - if ( this.options.hide || this.options.show ) - for ( var p in this.options.curAnim ) - jQuery.attr(this.elem.style, p, this.options.orig[p]); - - // Execute the complete function - this.options.complete.call( this.elem ); - } - - return false; - } else { - var n = t - this.startTime; - this.state = n / this.options.duration; - - // Perform the easing function, defaults to swing - this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration); - this.now = this.start + ((this.end - this.start) * this.pos); - - // Perform the next step of the animation - this.update(); - } - - return true; - } - -}; - -jQuery.extend( jQuery.fx, { - speeds:{ - slow: 600, - fast: 200, - // Default speed - _default: 400 - }, - step: { - - opacity: function(fx){ - jQuery.attr(fx.elem.style, "opacity", fx.now); - }, - - _default: function(fx){ - if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) - fx.elem.style[ fx.prop ] = fx.now + fx.unit; - else - fx.elem[ fx.prop ] = fx.now; - } - } -}); -if ( document.documentElement["getBoundingClientRect"] ) - jQuery.fn.offset = function() { - if ( !this[0] ) return { top: 0, left: 0 }; - if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] ); - var box = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement, - clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, - top = box.top + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop, - left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft; - return { top: top, left: left }; - }; -else - jQuery.fn.offset = function() { - if ( !this[0] ) return { top: 0, left: 0 }; - if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] ); - jQuery.offset.initialized || jQuery.offset.initialize(); - - var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem, - doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement, - body = doc.body, defaultView = doc.defaultView, - prevComputedStyle = defaultView.getComputedStyle(elem, null), - top = elem.offsetTop, left = elem.offsetLeft; - - while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { - computedStyle = defaultView.getComputedStyle(elem, null); - top -= elem.scrollTop, left -= elem.scrollLeft; - if ( elem === offsetParent ) { - top += elem.offsetTop, left += elem.offsetLeft; - if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) ) - top += parseInt( computedStyle.borderTopWidth, 10) || 0, - left += parseInt( computedStyle.borderLeftWidth, 10) || 0; - prevOffsetParent = offsetParent, offsetParent = elem.offsetParent; - } - if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) - top += parseInt( computedStyle.borderTopWidth, 10) || 0, - left += parseInt( computedStyle.borderLeftWidth, 10) || 0; - prevComputedStyle = computedStyle; - } - - if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) - top += body.offsetTop, - left += body.offsetLeft; - - if ( prevComputedStyle.position === "fixed" ) - top += Math.max(docElem.scrollTop, body.scrollTop), - left += Math.max(docElem.scrollLeft, body.scrollLeft); - - return { top: top, left: left }; - }; - -jQuery.offset = { - initialize: function() { - if ( this.initialized ) return; - var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop, - html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>'; - - rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' }; - for ( prop in rules ) container.style[prop] = rules[prop]; - - container.innerHTML = html; - body.insertBefore(container, body.firstChild); - innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild; - - this.doesNotAddBorder = (checkDiv.offsetTop !== 5); - this.doesAddBorderForTableAndCells = (td.offsetTop === 5); - - innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative'; - this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); - - body.style.marginTop = '1px'; - this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0); - body.style.marginTop = bodyMarginTop; - - body.removeChild(container); - this.initialized = true; - }, - - bodyOffset: function(body) { - jQuery.offset.initialized || jQuery.offset.initialize(); - var top = body.offsetTop, left = body.offsetLeft; - if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) - top += parseInt( jQuery.curCSS(body, 'marginTop', true), 10 ) || 0, - left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0; - return { top: top, left: left }; - } -}; - - -jQuery.fn.extend({ - position: function() { - var left = 0, top = 0, results; - - if ( this[0] ) { - // Get *real* offsetParent - var offsetParent = this.offsetParent(), - - // Get correct offsets - offset = this.offset(), - parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset(); - - // Subtract element margins - // note: when an element has margin: auto the offsetLeft and marginLeft - // are the same in Safari causing offset.left to incorrectly be 0 - offset.top -= num( this, 'marginTop' ); - offset.left -= num( this, 'marginLeft' ); - - // Add offsetParent borders - parentOffset.top += num( offsetParent, 'borderTopWidth' ); - parentOffset.left += num( offsetParent, 'borderLeftWidth' ); - - // Subtract the two offsets - results = { - top: offset.top - parentOffset.top, - left: offset.left - parentOffset.left - }; - } - - return results; - }, - - offsetParent: function() { - var offsetParent = this[0].offsetParent || document.body; - while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') ) - offsetParent = offsetParent.offsetParent; - return jQuery(offsetParent); - } -}); - - -// Create scrollLeft and scrollTop methods -jQuery.each( ['Left', 'Top'], function(i, name) { - var method = 'scroll' + name; - - jQuery.fn[ method ] = function(val) { - if (!this[0]) return null; - - return val !== undefined ? - - // Set the scroll offset - this.each(function() { - this == window || this == document ? - window.scrollTo( - !i ? val : jQuery(window).scrollLeft(), - i ? val : jQuery(window).scrollTop() - ) : - this[ method ] = val; - }) : - - // Return the scroll offset - this[0] == window || this[0] == document ? - self[ i ? 'pageYOffset' : 'pageXOffset' ] || - jQuery.boxModel && document.documentElement[ method ] || - document.body[ method ] : - this[0][ method ]; - }; -}); -// Create innerHeight, innerWidth, outerHeight and outerWidth methods -jQuery.each([ "Height", "Width" ], function(i, name){ - - var tl = i ? "Left" : "Top", // top or left - br = i ? "Right" : "Bottom", // bottom or right - lower = name.toLowerCase(); - - // innerHeight and innerWidth - jQuery.fn["inner" + name] = function(){ - return this[0] ? - jQuery.css( this[0], lower, false, "padding" ) : - null; - }; - - // outerHeight and outerWidth - jQuery.fn["outer" + name] = function(margin) { - return this[0] ? - jQuery.css( this[0], lower, false, margin ? "margin" : "border" ) : - null; - }; - - var type = name.toLowerCase(); - - jQuery.fn[ type ] = function( size ) { - // Get window width or height - return this[0] == window ? - // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode - document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || - document.body[ "client" + name ] : - - // Get document width or height - this[0] == document ? - // Either scroll[Width/Height] or offset[Width/Height], whichever is greater - Math.max( - document.documentElement["client" + name], - document.body["scroll" + name], document.documentElement["scroll" + name], - document.body["offset" + name], document.documentElement["offset" + name] - ) : - - // Get or set width or height on the element - size === undefined ? - // Get width or height on the element - (this.length ? jQuery.css( this[0], type ) : null) : - - // Set the width or height on the element (default to pixels if value is unitless) - this.css( type, typeof size === "string" ? size : size + "px" ); - }; - -}); -})(); diff --git a/projecttemplates/MvcRelyingParty/Scripts/jquery-1.3.2.min-vsdoc.js b/projecttemplates/MvcRelyingParty/Scripts/jquery-1.3.2.min-vsdoc.js deleted file mode 100644 index 27aefb8..0000000 --- a/projecttemplates/MvcRelyingParty/Scripts/jquery-1.3.2.min-vsdoc.js +++ /dev/null @@ -1,6255 +0,0 @@ -/* - * This file has been commented to support Visual Studio Intellisense. - * You should not use this file at runtime inside the browser--it is only - * intended to be used only for design-time IntelliSense. Please use the - * standard jQuery library for all production use. - * - * Comment version: 1.3.2a - */ - -/* - * jQuery JavaScript Library v1.3.2 - * - * Copyright (c) 2009 John Resig, http://jquery.com/ - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ - -(function(){ - -var - // Will speed up references to window, and allows munging its name. - window = this, - // Will speed up references to undefined, and allows munging its name. - undefined, - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - // Map over the $ in case of overwrite - _$ = window.$, - - jQuery = window.jQuery = window.$ = function(selector, context) { - /// <summary> - /// 1: $(expression, context) - This function accepts a string containing a CSS selector which is then used to match a set of elements. - /// 2: $(html) - Create DOM elements on-the-fly from the provided String of raw HTML. - /// 3: $(elements) - Wrap jQuery functionality around a single or multiple DOM Element(s). - /// 4: $(callback) - A shorthand for $(document).ready(). - /// </summary> - /// <param name="selector" type="String"> - /// 1: expression - An expression to search with. - /// 2: html - A string of HTML to create on the fly. - /// 3: elements - DOM element(s) to be encapsulated by a jQuery object. - /// 4: callback - The function to execute when the DOM is ready. - /// </param> - /// <param name="context" type="jQuery"> - /// 1: context - A DOM Element, Document or jQuery to use as context. - /// </param> - /// <field name="selector" Type="Object"> - /// The DOM node context originally passed to jQuery() (if none was passed then context will be equal to the document). - /// </field> - /// <field name="context" Type="String"> - /// A selector representing selector originally passed to jQuery(). - /// </field> - /// <returns type="jQuery" /> - - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context ); - }, - - // A simple way to check for HTML strings or ID strings - // (both of which we optimize for) - quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, - // Is it a simple selector - isSimple = /^.[^:#\[\.,]*$/; - -jQuery.fn = jQuery.prototype = { - init: function( selector, context ) { - /// <summary> - /// 1: $(expression, context) - This function accepts a string containing a CSS selector which is then used to match a set of elements. - /// 2: $(html) - Create DOM elements on-the-fly from the provided String of raw HTML. - /// 3: $(elements) - Wrap jQuery functionality around a single or multiple DOM Element(s). - /// 4: $(callback) - A shorthand for $(document).ready(). - /// </summary> - /// <param name="selector" type="String"> - /// 1: expression - An expression to search with. - /// 2: html - A string of HTML to create on the fly. - /// 3: elements - DOM element(s) to be encapsulated by a jQuery object. - /// 4: callback - The function to execute when the DOM is ready. - /// </param> - /// <param name="context" type="jQuery"> - /// 1: context - A DOM Element, Document or jQuery to use as context. - /// </param> - /// <returns type="jQuery" /> - - // Make sure that a selection was provided - selector = selector || document; - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this[0] = selector; - this.length = 1; - this.context = selector; - return this; - } - // Handle HTML strings - if (typeof selector === "string") { - // Are we dealing with HTML string or an ID? - var match = quickExpr.exec(selector); - - // Verify a match, and that no context was specified for #id - if (match && (match[1] || !context)) { - - // HANDLE: $(html) -> $(array) - if (match[1]) - selector = jQuery.clean([match[1]], context); - - // HANDLE: $("#id") - else { - var elem = document.getElementById(match[3]); - - // Handle the case where IE and Opera return items - // by name instead of ID - if (elem && elem.id != match[3]) - return jQuery().find(selector); - - // Otherwise, we inject the element directly into the jQuery object - var ret = jQuery(elem || []); - ret.context = document; - ret.selector = selector; - return ret; - } - - // HANDLE: $(expr, [context]) - // (which is just equivalent to: $(content).find(expr) - } else - return jQuery(context).find(selector); - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) - return jQuery( document ).ready( selector ); - - // Make sure that old selector state is passed along - if ( selector.selector && selector.context ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return this.setArray(jQuery.isArray( selector ) ? - selector : - jQuery.makeArray(selector)); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.3.2", - - // The number of elements contained in the matched element set - size: function() { - /// <summary> - /// The number of elements currently matched. - /// Part of Core - /// </summary> - /// <returns type="Number" /> - - return this.length; - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - /// <summary> - /// Access a single matched element. num is used to access the - /// Nth element matched. - /// Part of Core - /// </summary> - /// <returns type="Element" /> - /// <param name="num" type="Number"> - /// Access the element in the Nth position. - /// </param> - - return num == undefined ? - - // Return a 'clean' array - Array.prototype.slice.call( this ) : - - // Return just the object - this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - /// <summary> - /// Set the jQuery object to an array of elements, while maintaining - /// the stack. - /// Part of Core - /// </summary> - /// <returns type="jQuery" /> - /// <param name="elems" type="Elements"> - /// An array of elements - /// </param> - - // Build a new jQuery matched element set - var ret = jQuery( elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) - ret.selector = this.selector + (this.selector ? " " : "") + selector; - else if ( name ) - ret.selector = this.selector + "." + name + "(" + selector + ")"; - - // Return the newly-formed element set - return ret; - }, - - // Force the current matched set of elements to become - // the specified array of elements (destroying the stack in the process) - // You should use pushStack() in order to do this, but maintain the stack - setArray: function( elems ) { - /// <summary> - /// Set the jQuery object to an array of elements. This operation is - /// completely destructive - be sure to use .pushStack() if you wish to maintain - /// the jQuery stack. - /// Part of Core - /// </summary> - /// <returns type="jQuery" /> - /// <param name="elems" type="Elements"> - /// An array of elements - /// </param> - - // Resetting the length to 0, then using the native Array push - // is a super-fast way to populate an object with array-like properties - this.length = 0; - Array.prototype.push.apply( this, elems ); - - return this; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - /// <summary> - /// Execute a function within the context of every matched element. - /// This means that every time the passed-in function is executed - /// (which is once for every element matched) the 'this' keyword - /// points to the specific element. - /// Additionally, the function, when executed, is passed a single - /// argument representing the position of the element in the matched - /// set. - /// Part of Core - /// </summary> - /// <returns type="jQuery" /> - /// <param name="callback" type="Function"> - /// A function to execute - /// </param> - - return jQuery.each( this, callback, args ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - /// <summary> - /// Searches every matched element for the object and returns - /// the index of the element, if found, starting with zero. - /// Returns -1 if the object wasn't found. - /// Part of Core - /// </summary> - /// <returns type="Number" /> - /// <param name="elem" type="Element"> - /// Object to search for - /// </param> - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem && elem.jquery ? elem[0] : elem - , this ); - }, - - attr: function( name, value, type ) { - /// <summary> - /// Set a single property to a computed value, on all matched elements. - /// Instead of a value, a function is provided, that computes the value. - /// Part of DOM/Attributes - /// </summary> - /// <returns type="jQuery" /> - /// <param name="name" type="String"> - /// The name of the property to set. - /// </param> - /// <param name="value" type="Function"> - /// A function returning the value to set. - /// </param> - - var options = name; - - // Look for the case where we're accessing a style value - if ( typeof name === "string" ) - if ( value === undefined ) - return this[0] && jQuery[ type || "attr" ]( this[0], name ); - - else { - options = {}; - options[ name ] = value; - } - - // Check to see if we're setting style values - return this.each(function(i){ - // Set all the styles - for ( name in options ) - jQuery.attr( - type ? - this.style : - this, - name, jQuery.prop( this, options[ name ], type, i, name ) - ); - }); - }, - - css: function( key, value ) { - /// <summary> - /// Set a single style property to a value, on all matched elements. - /// If a number is provided, it is automatically converted into a pixel value. - /// Part of CSS - /// </summary> - /// <returns type="jQuery" /> - /// <param name="key" type="String"> - /// The name of the property to set. - /// </param> - /// <param name="value" type="String"> - /// The value to set the property to. - /// </param> - - // ignore negative width and height values - if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) - value = undefined; - return this.attr( key, value, "curCSS" ); - }, - - text: function( text ) { - /// <summary> - /// Set the text contents of all matched elements. - /// Similar to html(), but escapes HTML (replace "<" and ">" with their - /// HTML entities). - /// Part of DOM/Attributes - /// </summary> - /// <returns type="String" /> - /// <param name="text" type="String"> - /// The text value to set the contents of the element to. - /// </param> - - if ( typeof text !== "object" && text != null ) - return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); - - var ret = ""; - - jQuery.each( text || this, function(){ - jQuery.each( this.childNodes, function(){ - if ( this.nodeType != 8 ) - ret += this.nodeType != 1 ? - this.nodeValue : - jQuery.fn.text( [ this ] ); - }); - }); - - return ret; - }, - - wrapAll: function( html ) { - /// <summary> - /// Wrap all matched elements with a structure of other elements. - /// This wrapping process is most useful for injecting additional - /// stucture into a document, without ruining the original semantic - /// qualities of a document. - /// This works by going through the first element - /// provided and finding the deepest ancestor element within its - /// structure - it is that element that will en-wrap everything else. - /// This does not work with elements that contain text. Any necessary text - /// must be added after the wrapping is done. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - /// <param name="html" type="Element"> - /// A DOM element that will be wrapped around the target. - /// </param> - - if ( this[0] ) { - // The elements to wrap the target around - var wrap = jQuery( html, this[0].ownerDocument ).clone(); - - if ( this[0].parentNode ) - wrap.insertBefore( this[0] ); - - wrap.map(function(){ - var elem = this; - - while ( elem.firstChild ) - elem = elem.firstChild; - - return elem; - }).append(this); - } - - return this; - }, - - wrapInner: function( html ) { - /// <summary> - /// Wraps the inner child contents of each matched elemenht (including text nodes) with an HTML structure. - /// </summary> - /// <param name="html" type="String"> - /// A string of HTML or a DOM element that will be wrapped around the target contents. - /// </param> - /// <returns type="jQuery" /> - - return this.each(function(){ - jQuery( this ).contents().wrapAll( html ); - }); - }, - - wrap: function( html ) { - /// <summary> - /// Wrap all matched elements with a structure of other elements. - /// This wrapping process is most useful for injecting additional - /// stucture into a document, without ruining the original semantic - /// qualities of a document. - /// This works by going through the first element - /// provided and finding the deepest ancestor element within its - /// structure - it is that element that will en-wrap everything else. - /// This does not work with elements that contain text. Any necessary text - /// must be added after the wrapping is done. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - /// <param name="html" type="Element"> - /// A DOM element that will be wrapped around the target. - /// </param> - - return this.each(function(){ - jQuery( this ).wrapAll( html ); - }); - }, - - append: function() { - /// <summary> - /// Append content to the inside of every matched element. - /// This operation is similar to doing an appendChild to all the - /// specified elements, adding them into the document. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - /// <param name="content" type="Content"> - /// Content to append to the target - /// </param> - - return this.domManip(arguments, true, function(elem){ - if (this.nodeType == 1) - this.appendChild( elem ); - }); - }, - - prepend: function() { - /// <summary> - /// Prepend content to the inside of every matched element. - /// This operation is the best way to insert elements - /// inside, at the beginning, of all matched elements. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - /// <param name="" type="Content"> - /// Content to prepend to the target. - /// </param> - - return this.domManip(arguments, true, function(elem){ - if (this.nodeType == 1) - this.insertBefore( elem, this.firstChild ); - }); - }, - - before: function() { - /// <summary> - /// Insert content before each of the matched elements. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - /// <param name="" type="Content"> - /// Content to insert before each target. - /// </param> - - return this.domManip(arguments, false, function(elem){ - this.parentNode.insertBefore( elem, this ); - }); - }, - - after: function() { - /// <summary> - /// Insert content after each of the matched elements. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - /// <param name="" type="Content"> - /// Content to insert after each target. - /// </param> - - return this.domManip(arguments, false, function(elem){ - this.parentNode.insertBefore( elem, this.nextSibling ); - }); - }, - - end: function() { - /// <summary> - /// End the most recent 'destructive' operation, reverting the list of matched elements - /// back to its previous state. After an end operation, the list of matched elements will - /// revert to the last state of matched elements. - /// If there was no destructive operation before, an empty set is returned. - /// Part of DOM/Traversing - /// </summary> - /// <returns type="jQuery" /> - - return this.prevObject || jQuery( [] ); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: [].push, - sort: [].sort, - splice: [].splice, - - find: function( selector ) { - /// <summary> - /// Searches for all elements that match the specified expression. - /// This method is a good way to find additional descendant - /// elements with which to process. - /// All searching is done using a jQuery expression. The expression can be - /// written using CSS 1-3 Selector syntax, or basic XPath. - /// Part of DOM/Traversing - /// </summary> - /// <returns type="jQuery" /> - /// <param name="selector" type="String"> - /// An expression to search with. - /// </param> - /// <returns type="jQuery" /> - - if ( this.length === 1 ) { - var ret = this.pushStack( [], "find", selector ); - ret.length = 0; - jQuery.find( selector, this[0], ret ); - return ret; - } else { - return this.pushStack( jQuery.unique(jQuery.map(this, function(elem){ - return jQuery.find( selector, elem ); - })), "find", selector ); - } - }, - - clone: function( events ) { - /// <summary> - /// Clone matched DOM Elements and select the clones. - /// This is useful for moving copies of the elements to another - /// location in the DOM. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - /// <param name="deep" type="Boolean" optional="true"> - /// (Optional) Set to false if you don't want to clone all descendant nodes, in addition to the element itself. - /// </param> - - // Do the clone - var ret = this.map(function(){ - if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) { - // IE copies events bound via attachEvent when - // using cloneNode. Calling detachEvent on the - // clone will also remove the events from the orignal - // In order to get around this, we use innerHTML. - // Unfortunately, this means some modifications to - // attributes in IE that are actually only stored - // as properties will not be copied (such as the - // the name attribute on an input). - var html = this.outerHTML; - if ( !html ) { - var div = this.ownerDocument.createElement("div"); - div.appendChild( this.cloneNode(true) ); - html = div.innerHTML; - } - - return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0]; - } else - return this.cloneNode(true); - }); - - // Copy the events from the original to the clone - if ( events === true ) { - var orig = this.find("*").andSelf(), i = 0; - - ret.find("*").andSelf().each(function(){ - if ( this.nodeName !== orig[i].nodeName ) - return; - - var events = jQuery.data( orig[i], "events" ); - - for ( var type in events ) { - for ( var handler in events[ type ] ) { - jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data ); - } - } - - i++; - }); - } - - // Return the cloned set - return ret; - }, - - filter: function( selector ) { - /// <summary> - /// Removes all elements from the set of matched elements that do not - /// pass the specified filter. This method is used to narrow down - /// the results of a search. - /// }) - /// Part of DOM/Traversing - /// </summary> - /// <returns type="jQuery" /> - /// <param name="selector" type="Function"> - /// A function to use for filtering - /// </param> - /// <returns type="jQuery" /> - - return this.pushStack( - jQuery.isFunction( selector ) && - jQuery.grep(this, function(elem, i){ - return selector.call( elem, i ); - }) || - - jQuery.multiFilter( selector, jQuery.grep(this, function(elem){ - return elem.nodeType === 1; - }) ), "filter", selector ); - }, - - closest: function( selector ) { - /// <summary> - /// Get a set of elements containing the closest parent element that matches the specified selector, the starting element included. - /// </summary> - /// <returns type="jQuery" /> - /// <param name="selector" type="Function"> - /// An expression to filter the elements with. - /// </param> - /// <returns type="jQuery" /> - - var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null, - closer = 0; - - return this.map(function(){ - var cur = this; - while ( cur && cur.ownerDocument ) { - if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) { - jQuery.data(cur, "closest", closer); - return cur; - } - cur = cur.parentNode; - closer++; - } - }); - }, - - not: function( selector ) { - /// <summary> - /// Removes any elements inside the array of elements from the set - /// of matched elements. This method is used to remove one or more - /// elements from a jQuery object. - /// Part of DOM/Traversing - /// </summary> - /// <param name="selector" type="jQuery"> - /// A set of elements to remove from the jQuery set of matched elements. - /// </param> - /// <returns type="jQuery" /> - - if ( typeof selector === "string" ) - // test special case where just one selector is passed in - if ( isSimple.test( selector ) ) - return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector ); - else - selector = jQuery.multiFilter( selector, this ); - - var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; - return this.filter(function() { - return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; - }); - }, - - add: function( selector ) { - /// <summary> - /// Adds one or more Elements to the set of matched elements. - /// Part of DOM/Traversing - /// </summary> - /// <param name="elements" type="Element"> - /// One or more Elements to add - /// </param> - /// <returns type="jQuery" /> - - return this.pushStack( jQuery.unique( jQuery.merge( - this.get(), - typeof selector === "string" ? - jQuery( selector ) : - jQuery.makeArray( selector ) - ))); - }, - - is: function( selector ) { - /// <summary> - /// Checks the current selection against an expression and returns true, - /// if at least one element of the selection fits the given expression. - /// Does return false, if no element fits or the expression is not valid. - /// filter(String) is used internally, therefore all rules that apply there - /// apply here, too. - /// Part of DOM/Traversing - /// </summary> - /// <returns type="Boolean" /> - /// <param name="expr" type="String"> - /// The expression with which to filter - /// </param> - - return !!selector && jQuery.multiFilter( selector, this ).length > 0; - }, - - hasClass: function( selector ) { - /// <summary> - /// Checks the current selection against a class and returns whether at least one selection has a given class. - /// </summary> - /// <param name="selector" type="String">The class to check against</param> - /// <returns type="Boolean">True if at least one element in the selection has the class, otherwise false.</returns> - - return !!selector && this.is( "." + selector ); - }, - - val: function( value ) { - /// <summary> - /// Set the value of every matched element. - /// Part of DOM/Attributes - /// </summary> - /// <returns type="jQuery" /> - /// <param name="val" type="String"> - /// Set the property to the specified value. - /// </param> - - if ( value === undefined ) { - var elem = this[0]; - - if ( elem ) { - if( jQuery.nodeName( elem, 'option' ) ) - return (elem.attributes.value || {}).specified ? elem.value : elem.text; - - // We need to handle select boxes special - if ( jQuery.nodeName( elem, "select" ) ) { - var index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type == "select-one"; - - // Nothing was selected - if ( index < 0 ) - return null; - - // Loop through all the selected options - for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { - var option = options[ i ]; - - if ( option.selected ) { - // Get the specifc value for the option - value = jQuery(option).val(); - - // We don't need an array for one selects - if ( one ) - return value; - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - } - - // Everything else, we just grab the value - return (elem.value || "").replace(/\r/g, ""); - - } - - return undefined; - } - - if ( typeof value === "number" ) - value += ''; - - return this.each(function(){ - if ( this.nodeType != 1 ) - return; - - if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) ) - this.checked = (jQuery.inArray(this.value, value) >= 0 || - jQuery.inArray(this.name, value) >= 0); - - else if ( jQuery.nodeName( this, "select" ) ) { - var values = jQuery.makeArray(value); - - jQuery( "option", this ).each(function(){ - this.selected = (jQuery.inArray( this.value, values ) >= 0 || - jQuery.inArray( this.text, values ) >= 0); - }); - - if ( !values.length ) - this.selectedIndex = -1; - - } else - this.value = value; - }); - }, - - html: function( value ) { - /// <summary> - /// Set the html contents of every matched element. - /// This property is not available on XML documents. - /// Part of DOM/Attributes - /// </summary> - /// <returns type="jQuery" /> - /// <param name="val" type="String"> - /// Set the html contents to the specified value. - /// </param> - - return value === undefined ? - (this[0] ? - this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") : - null) : - this.empty().append( value ); - }, - - replaceWith: function( value ) { - /// <summary> - /// Replaces all matched element with the specified HTML or DOM elements. - /// </summary> - /// <param name="value" type="String"> - /// The content with which to replace the matched elements. - /// </param> - /// <returns type="jQuery">The element that was just replaced.</returns> - - return this.after( value ).remove(); - }, - - eq: function( i ) { - /// <summary> - /// Reduce the set of matched elements to a single element. - /// The position of the element in the set of matched elements - /// starts at 0 and goes to length - 1. - /// Part of Core - /// </summary> - /// <returns type="jQuery" /> - /// <param name="num" type="Number"> - /// pos The index of the element that you wish to limit to. - /// </param> - - return this.slice( i, +i + 1 ); - }, - - slice: function() { - /// <summary> - /// Selects a subset of the matched elements. Behaves exactly like the built-in Array slice method. - /// </summary> - /// <param name="start" type="Number" integer="true">Where to start the subset (0-based).</param> - /// <param name="end" optional="true" type="Number" integer="true">Where to end the subset (not including the end element itself). - /// If omitted, ends at the end of the selection</param> - /// <returns type="jQuery">The sliced elements</returns> - - return this.pushStack( Array.prototype.slice.apply( this, arguments ), - "slice", Array.prototype.slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - /// <summary> - /// This member is internal. - /// </summary> - /// <private /> - /// <returns type="jQuery" /> - - return this.pushStack( jQuery.map(this, function(elem, i){ - return callback.call( elem, i, elem ); - })); - }, - - andSelf: function() { - /// <summary> - /// Adds the previous selection to the current selection. - /// </summary> - /// <returns type="jQuery" /> - - return this.add( this.prevObject ); - }, - - domManip: function( args, table, callback ) { - /// <param name="args" type="Array"> - /// Args - /// </param> - /// <param name="table" type="Boolean"> - /// Insert TBODY in TABLEs if one is not found. - /// </param> - /// <param name="dir" type="Number"> - /// If dir<0, process args in reverse order. - /// </param> - /// <param name="fn" type="Function"> - /// The function doing the DOM manipulation. - /// </param> - /// <returns type="jQuery" /> - /// <summary> - /// Part of Core - /// </summary> - - if ( this[0] ) { - var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(), - scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ), - first = fragment.firstChild; - - if ( first ) - for ( var i = 0, l = this.length; i < l; i++ ) - callback.call( root(this[i], first), this.length > 1 || i > 0 ? - fragment.cloneNode(true) : fragment ); - - if ( scripts ) - jQuery.each( scripts, evalScript ); - } - - return this; - - function root( elem, cur ) { - return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ? - (elem.getElementsByTagName("tbody")[0] || - elem.appendChild(elem.ownerDocument.createElement("tbody"))) : - elem; - } - } -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -function evalScript( i, elem ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - if ( elem.src ) - jQuery.ajax({ - url: elem.src, - async: false, - dataType: "script" - }); - - else - jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); - - if ( elem.parentNode ) - elem.parentNode.removeChild( elem ); -} - -function now(){ - /// <summary> - /// Gets the current date. - /// </summary> - /// <returns type="Date">The current date.</returns> - return +new Date; -} - -jQuery.extend = jQuery.fn.extend = function() { - /// <summary> - /// Extend one object with one or more others, returning the original, - /// modified, object. This is a great utility for simple inheritance. - /// jQuery.extend(settings, options); - /// var settings = jQuery.extend({}, defaults, options); - /// Part of JavaScript - /// </summary> - /// <param name="target" type="Object"> - /// The object to extend - /// </param> - /// <param name="prop1" type="Object"> - /// The object that will be merged into the first. - /// </param> - /// <param name="propN" type="Object" optional="true" parameterArray="true"> - /// (optional) More objects to merge into the first - /// </param> - /// <returns type="Object" /> - - // copy reference to target object - var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) - target = {}; - - // extend jQuery itself if only one argument is passed - if ( length == i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) - // Extend the base object - for ( var name in options ) { - var src = target[ name ], copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) - continue; - - // Recurse if we're merging object values - if ( deep && copy && typeof copy === "object" && !copy.nodeType ) - target[ name ] = jQuery.extend( deep, - // Never move original objects, clone them - src || ( copy.length != null ? [ ] : { } ) - , copy ); - - // Don't bring in undefined values - else if ( copy !== undefined ) - target[ name ] = copy; - - } - - // Return the modified object - return target; -}; - -// exclude the following css properties to add px -var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, - // cache defaultView - defaultView = document.defaultView || {}, - toString = Object.prototype.toString; - -jQuery.extend({ - noConflict: function( deep ) { - /// <summary> - /// Run this function to give control of the $ variable back - /// to whichever library first implemented it. This helps to make - /// sure that jQuery doesn't conflict with the $ object - /// of other libraries. - /// By using this function, you will only be able to access jQuery - /// using the 'jQuery' variable. For example, where you used to do - /// $("div p"), you now must do jQuery("div p"). - /// Part of Core - /// </summary> - /// <returns type="undefined" /> - - window.$ = _$; - - if ( deep ) - window.jQuery = _jQuery; - - return jQuery; - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - /// <summary> - /// Determines if the parameter passed is a function. - /// </summary> - /// <param name="obj" type="Object">The object to check</param> - /// <returns type="Boolean">True if the parameter is a function; otherwise false.</returns> - - return toString.call(obj) === "[object Function]"; - }, - - isArray: function(obj) { - /// <summary> - /// Determine if the parameter passed is an array. - /// </summary> - /// <param name="obj" type="Object">Object to test whether or not it is an array.</param> - /// <returns type="Boolean">True if the parameter is a function; otherwise false.</returns> - - return toString.call(obj) === "[object Array]"; - }, - - // check if an element is in a (or is an) XML document - isXMLDoc: function( elem ) { - /// <summary> - /// Determines if the parameter passed is an XML document. - /// </summary> - /// <param name="elem" type="Object">The object to test</param> - /// <returns type="Boolean">True if the parameter is an XML document; otherwise false.</returns> - - return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || - !!elem.ownerDocument && jQuery.isXMLDoc(elem.ownerDocument); - }, - - // Evalulates a script in a global context - globalEval: function( data ) { - /// <summary> - /// Internally evaluates a script in a global context. - /// </summary> - /// <private /> - - if ( data && /\S/.test(data) ) { - // Inspired by code by Andrea Giammarchi - // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html - var head = document.getElementsByTagName("head")[0] || document.documentElement, - script = document.createElement("script"); - - script.type = "text/javascript"; - if ( jQuery.support.scriptEval ) - script.appendChild( document.createTextNode( data ) ); - else - script.text = data; - - // Use insertBefore instead of appendChild to circumvent an IE6 bug. - // This arises when a base node is used (#2709). - head.insertBefore( script, head.firstChild ); - head.removeChild( script ); - } - }, - - nodeName: function( elem, name ) { - /// <summary> - /// Checks whether the specified element has the specified DOM node name. - /// </summary> - /// <param name="elem" type="Element">The element to examine</param> - /// <param name="name" type="String">The node name to check</param> - /// <returns type="Boolean">True if the specified node name matches the node's DOM node name; otherwise false</returns> - - return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); - }, - - // args is for internal usage only - each: function( object, callback, args ) { - /// <summary> - /// A generic iterator function, which can be used to seemlessly - /// iterate over both objects and arrays. This function is not the same - /// as $().each() - which is used to iterate, exclusively, over a jQuery - /// object. This function can be used to iterate over anything. - /// The callback has two arguments:the key (objects) or index (arrays) as first - /// the first, and the value as the second. - /// Part of JavaScript - /// </summary> - /// <param name="obj" type="Object"> - /// The object, or array, to iterate over. - /// </param> - /// <param name="fn" type="Function"> - /// The function that will be executed on every object. - /// </param> - /// <returns type="Object" /> - - var name, i = 0, length = object.length; - - if ( args ) { - if ( length === undefined ) { - for ( name in object ) - if ( callback.apply( object[ name ], args ) === false ) - break; - } else - for ( ; i < length; ) - if ( callback.apply( object[ i++ ], args ) === false ) - break; - - // A special, fast, case for the most common use of each - } else { - if ( length === undefined ) { - for ( name in object ) - if ( callback.call( object[ name ], name, object[ name ] ) === false ) - break; - } else - for ( var value = object[0]; - i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} - } - - return object; - }, - - prop: function( elem, value, type, i, name ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - // This member is not documented within the jQuery API: http://docs.jquery.com/action/edit/Internals/jQuery.prop - - // Handle executable functions - if ( jQuery.isFunction( value ) ) - value = value.call( elem, i ); - - // Handle passing in a number to a CSS property - return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ? - value + "px" : - value; - }, - - className: { - // internal only, use addClass("class") - add: function( elem, classNames ) { - /// <summary> - /// Internal use only; use addClass('class') - /// </summary> - /// <private /> - - jQuery.each((classNames || "").split(/\s+/), function(i, className){ - if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) ) - elem.className += (elem.className ? " " : "") + className; - }); - }, - - // internal only, use removeClass("class") - remove: function( elem, classNames ) { - /// <summary> - /// Internal use only; use removeClass('class') - /// </summary> - /// <private /> - - if (elem.nodeType == 1) - elem.className = classNames !== undefined ? - jQuery.grep(elem.className.split(/\s+/), function(className){ - return !jQuery.className.has( classNames, className ); - }).join(" ") : - ""; - }, - - // internal only, use hasClass("class") - has: function( elem, className ) { - /// <summary> - /// Internal use only; use hasClass('class') - /// </summary> - /// <private /> - - return elem && jQuery.inArray(className, (elem.className || elem).toString().split(/\s+/)) > -1; - } - }, - - // A method for quickly swapping in/out CSS properties to get correct calculations - swap: function( elem, options, callback ) { - /// <summary> - /// Swap in/out style options. - /// </summary> - - var old = {}; - // Remember the old values, and insert the new ones - for ( var name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - callback.call( elem ); - - // Revert the old values - for ( var name in options ) - elem.style[ name ] = old[ name ]; - }, - - css: function( elem, name, force, extra ) { - /// <summary> - /// This method is internal only. - /// </summary> - /// <private /> - // This method is undocumented in jQuery API: http://docs.jquery.com/action/edit/Internals/jQuery.css - - if ( name == "width" || name == "height" ) { - var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; - - function getWH() { - val = name == "width" ? elem.offsetWidth : elem.offsetHeight; - - if ( extra === "border" ) - return; - - jQuery.each( which, function() { - if ( !extra ) - val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0; - if ( extra === "margin" ) - val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0; - else - val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0; - }); - } - - if ( elem.offsetWidth !== 0 ) - getWH(); - else - jQuery.swap( elem, props, getWH ); - - return Math.max(0, Math.round(val)); - } - - return jQuery.curCSS( elem, name, force ); - }, - - curCSS: function( elem, name, force ) { - /// <summary> - /// This method is internal only. - /// </summary> - /// <private /> - // This method is undocumented in jQuery API: http://docs.jquery.com/action/edit/Internals/jQuery.curCSS - - var ret, style = elem.style; - - // We need to handle opacity special in IE - if ( name == "opacity" && !jQuery.support.opacity ) { - ret = jQuery.attr( style, "opacity" ); - - return ret == "" ? - "1" : - ret; - } - - // Make sure we're using the right name for getting the float value - if ( name.match( /float/i ) ) - name = styleFloat; - - if ( !force && style && style[ name ] ) - ret = style[ name ]; - - else if ( defaultView.getComputedStyle ) { - - // Only "float" is needed here - if ( name.match( /float/i ) ) - name = "float"; - - name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); - - var computedStyle = defaultView.getComputedStyle( elem, null ); - - if ( computedStyle ) - ret = computedStyle.getPropertyValue( name ); - - // We should always get a number back from opacity - if ( name == "opacity" && ret == "" ) - ret = "1"; - - } else if ( elem.currentStyle ) { - var camelCase = name.replace(/\-(\w)/g, function(all, letter){ - return letter.toUpperCase(); - }); - - ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; - - // From the awesome hack by Dean Edwards - // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 - - // If we're not dealing with a regular pixel number - // but a number that has a weird ending, we need to convert it to pixels - if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { - // Remember the original values - var left = style.left, rsLeft = elem.runtimeStyle.left; - - // Put in the new values to get a computed value out - elem.runtimeStyle.left = elem.currentStyle.left; - style.left = ret || 0; - ret = style.pixelLeft + "px"; - - // Revert the changed values - style.left = left; - elem.runtimeStyle.left = rsLeft; - } - } - - return ret; - }, - - clean: function( elems, context, fragment ) { - /// <summary> - /// This method is internal only. - /// </summary> - /// <private /> - // This method is undocumented in the jQuery API: http://docs.jquery.com/action/edit/Internals/jQuery.clean - - - context = context || document; - - // !context.createElement fails in IE with an error but returns typeof 'object' - if ( typeof context.createElement === "undefined" ) - context = context.ownerDocument || context[0] && context[0].ownerDocument || document; - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) { - var match = /^<(\w+)\s*\/?>$/.exec(elems[0]); - if ( match ) - return [ context.createElement( match[1] ) ]; - } - - var ret = [], scripts = [], div = context.createElement("div"); - - jQuery.each(elems, function(i, elem){ - if ( typeof elem === "number" ) - elem += ''; - - if ( !elem ) - return; - - // Convert html string into DOM nodes - if ( typeof elem === "string" ) { - // Fix "XHTML"-style tags in all browsers - elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ - return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? - all : - front + "></" + tag + ">"; - }); - - // Trim whitespace, otherwise indexOf won't work as expected - var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase(); - - var wrap = - // option or optgroup - !tags.indexOf("<opt") && - [ 1, "<select multiple='multiple'>", "</select>" ] || - - !tags.indexOf("<leg") && - [ 1, "<fieldset>", "</fieldset>" ] || - - tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && - [ 1, "<table>", "</table>" ] || - - !tags.indexOf("<tr") && - [ 2, "<table><tbody>", "</tbody></table>" ] || - - // <thead> matched above - (!tags.indexOf("<td") || !tags.indexOf("<th")) && - [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] || - - !tags.indexOf("<col") && - [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] || - - // IE can't serialize <link> and <script> tags normally - !jQuery.support.htmlSerialize && - [ 1, "div<div>", "</div>" ] || - - [ 0, "", "" ]; - - // Go to html and back, then peel off extra wrappers - div.innerHTML = wrap[1] + elem + wrap[2]; - - // Move to the right depth - while ( wrap[0]-- ) - div = div.lastChild; - - // Remove IE's autoinserted <tbody> from table fragments - if ( !jQuery.support.tbody ) { - - // String was a <table>, *may* have spurious <tbody> - var hasBody = /<tbody/i.test(elem), - tbody = !tags.indexOf("<table") && !hasBody ? - div.firstChild && div.firstChild.childNodes : - - // String was a bare <thead> or <tfoot> - wrap[1] == "<table>" && !hasBody ? - div.childNodes : - []; - - for ( var j = tbody.length - 1; j >= 0 ; --j ) - if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) - tbody[ j ].parentNode.removeChild( tbody[ j ] ); - - } - - // IE completely kills leading whitespace when innerHTML is used - if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) ) - div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild ); - - elem = jQuery.makeArray( div.childNodes ); - } - - if ( elem.nodeType ) - ret.push( elem ); - else - ret = jQuery.merge( ret, elem ); - - }); - - if ( fragment ) { - for ( var i = 0; ret[i]; i++ ) { - if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { - scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); - } else { - if ( ret[i].nodeType === 1 ) - ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); - fragment.appendChild( ret[i] ); - } - } - - return scripts; - } - - return ret; - }, - - attr: function( elem, name, value ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - // don't set attributes on text and comment nodes - if (!elem || elem.nodeType == 3 || elem.nodeType == 8) - return undefined; - - var notxml = !jQuery.isXMLDoc( elem ), - // Whether we are setting (or getting) - set = value !== undefined; - - // Try to normalize/fix the name - name = notxml && jQuery.props[ name ] || name; - - // Only do all the following if this is a node (faster for style) - // IE elem.getAttribute passes even for style - if ( elem.tagName ) { - - // These attributes require special treatment - var special = /href|src|style/.test( name ); - - // Safari mis-reports the default selected property of a hidden option - // Accessing the parent's selectedIndex property fixes it - if ( name == "selected" && elem.parentNode ) - elem.parentNode.selectedIndex; - - // If applicable, access the attribute via the DOM 0 way - if ( name in elem && notxml && !special ) { - if ( set ){ - // We can't allow the type property to be changed (since it causes problems in IE) - if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode ) - throw "type property can't be changed"; - - elem[ name ] = value; - } - - // browsers index elements by id/name on forms, give priority to attributes. - if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) - return elem.getAttributeNode( name ).nodeValue; - - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - if ( name == "tabIndex" ) { - var attributeNode = elem.getAttributeNode( "tabIndex" ); - return attributeNode && attributeNode.specified - ? attributeNode.value - : elem.nodeName.match(/(button|input|object|select|textarea)/i) - ? 0 - : elem.nodeName.match(/^(a|area)$/i) && elem.href - ? 0 - : undefined; - } - - return elem[ name ]; - } - - if ( !jQuery.support.style && notxml && name == "style" ) - return jQuery.attr( elem.style, "cssText", value ); - - if ( set ) - // convert the value to a string (all browsers do this but IE) see #1070 - elem.setAttribute( name, "" + value ); - - var attr = !jQuery.support.hrefNormalized && notxml && special - // Some attributes require a special call on IE - ? elem.getAttribute( name, 2 ) - : elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return attr === null ? undefined : attr; - } - - // elem is actually elem.style ... set the style - - // IE uses filters for opacity - if ( !jQuery.support.opacity && name == "opacity" ) { - if ( set ) { - // IE has trouble with opacity if it does not have layout - // Force it by setting the zoom level - elem.zoom = 1; - - // Set the alpha filter to set the opacity - elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) + - (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"); - } - - return elem.filter && elem.filter.indexOf("opacity=") >= 0 ? - (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '': - ""; - } - - name = name.replace(/-([a-z])/ig, function(all, letter){ - return letter.toUpperCase(); - }); - - if ( set ) - elem[ name ] = value; - - return elem[ name ]; - }, - - trim: function( text ) { - /// <summary> - /// Remove the whitespace from the beginning and end of a string. - /// Part of JavaScript - /// </summary> - /// <returns type="String" /> - /// <param name="text" type="String"> - /// The string to trim. - /// </param> - - return (text || "").replace( /^\s+|\s+$/g, "" ); - }, - - makeArray: function( array ) { - /// <summary> - /// Turns anything into a true array. This is an internal method. - /// </summary> - /// <param name="array" type="Object">Anything to turn into an actual Array</param> - /// <returns type="Array" /> - /// <private /> - - var ret = []; - - if( array != null ){ - var i = array.length; - // The window, strings (and functions) also have 'length' - if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval ) - ret[0] = array; - else - while( i ) - ret[--i] = array[i]; - } - - return ret; - }, - - inArray: function( elem, array ) { - /// <summary> - /// Determines the index of the first parameter in the array. - /// </summary> - /// <param name="elem">The value to see if it exists in the array.</param> - /// <param name="array" type="Array">The array to look through for the value</param> - /// <returns type="Number" integer="true">The 0-based index of the item if it was found, otherwise -1.</returns> - - for ( var i = 0, length = array.length; i < length; i++ ) - // Use === because on IE, window == document - if ( array[ i ] === elem ) - return i; - - return -1; - }, - - merge: function( first, second ) { - /// <summary> - /// Merge two arrays together, removing all duplicates. - /// The new array is: All the results from the first array, followed - /// by the unique results from the second array. - /// Part of JavaScript - /// </summary> - /// <returns type="Array" /> - /// <param name="first" type="Array"> - /// The first array to merge. - /// </param> - /// <param name="second" type="Array"> - /// The second array to merge. - /// </param> - - // We have to loop this way because IE & Opera overwrite the length - // expando of getElementsByTagName - var i = 0, elem, pos = first.length; - // Also, we need to make sure that the correct elements are being returned - // (IE returns comment nodes in a '*' query) - if ( !jQuery.support.getAll ) { - while ( (elem = second[ i++ ]) != null ) - if ( elem.nodeType != 8 ) - first[ pos++ ] = elem; - - } else - while ( (elem = second[ i++ ]) != null ) - first[ pos++ ] = elem; - - return first; - }, - - unique: function( array ) { - /// <summary> - /// Removes all duplicate elements from an array of elements. - /// </summary> - /// <param name="array" type="Array<Element>">The array to translate</param> - /// <returns type="Array<Element>">The array after translation.</returns> - - var ret = [], done = {}; - - try { - - for ( var i = 0, length = array.length; i < length; i++ ) { - var id = jQuery.data( array[ i ] ); - - if ( !done[ id ] ) { - done[ id ] = true; - ret.push( array[ i ] ); - } - } - - } catch( e ) { - ret = array; - } - - return ret; - }, - - grep: function( elems, callback, inv ) { - /// <summary> - /// Filter items out of an array, by using a filter function. - /// The specified function will be passed two arguments: The - /// current array item and the index of the item in the array. The - /// function must return 'true' to keep the item in the array, - /// false to remove it. - /// }); - /// Part of JavaScript - /// </summary> - /// <returns type="Array" /> - /// <param name="elems" type="Array"> - /// array The Array to find items in. - /// </param> - /// <param name="fn" type="Function"> - /// The function to process each item against. - /// </param> - /// <param name="inv" type="Boolean"> - /// Invert the selection - select the opposite of the function. - /// </param> - - var ret = []; - - // Go through the array, only saving the items - // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) - if ( !inv != !callback( elems[ i ], i ) ) - ret.push( elems[ i ] ); - - return ret; - }, - - map: function( elems, callback ) { - /// <summary> - /// Translate all items in an array to another array of items. - /// The translation function that is provided to this method is - /// called for each item in the array and is passed one argument: - /// The item to be translated. - /// The function can then return the translated value, 'null' - /// (to remove the item), or an array of values - which will - /// be flattened into the full array. - /// Part of JavaScript - /// </summary> - /// <returns type="Array" /> - /// <param name="elems" type="Array"> - /// array The Array to translate. - /// </param> - /// <param name="fn" type="Function"> - /// The function to process each item against. - /// </param> - - var ret = []; - - // Go through the array, translating each of the items to their - // new value (or values). - for ( var i = 0, length = elems.length; i < length; i++ ) { - var value = callback( elems[ i ], i ); - - if ( value != null ) - ret[ ret.length ] = value; - } - - return ret.concat.apply( [], ret ); - } -}); - -// Use of jQuery.browser is deprecated. -// It's included for backwards compatibility and plugins, -// although they should work to migrate away. - -var userAgent = navigator.userAgent.toLowerCase(); - -// Figure out what browser is being used -jQuery.browser = { - version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1], - safari: /webkit/.test( userAgent ), - opera: /opera/.test( userAgent ), - msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), - mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) -}; - -// [vsdoc] The following section has been denormalized from original sources for IntelliSense. -// jQuery.each({ -// parent: function(elem){return elem.parentNode;}, -// parents: function(elem){return jQuery.dir(elem,"parentNode");}, -// next: function(elem){return jQuery.nth(elem,2,"nextSibling");}, -// prev: function(elem){return jQuery.nth(elem,2,"previousSibling");}, -// nextAll: function(elem){return jQuery.dir(elem,"nextSibling");}, -// prevAll: function(elem){return jQuery.dir(elem,"previousSibling");}, -// siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);}, -// children: function(elem){return jQuery.sibling(elem.firstChild);}, -// contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);} -// }, function(name, fn){ -// jQuery.fn[ name ] = function( selector ) { -// /// <summary> -// /// Get a set of elements containing the unique parents of the matched -// /// set of elements. -// /// Can be filtered with an optional expressions. -// /// Part of DOM/Traversing -// /// </summary> -// /// <param name="expr" type="String" optional="true"> -// /// (optional) An expression to filter the parents with -// /// </param> -// /// <returns type="jQuery" /> -// -// var ret = jQuery.map( this, fn ); -// -// if ( selector && typeof selector == "string" ) -// ret = jQuery.multiFilter( selector, ret ); -// -// return this.pushStack( jQuery.unique( ret ), name, selector ); -// }; -// }); - -jQuery.each({ - parent: function(elem){return elem.parentNode;} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary> - /// Get a set of elements containing the unique parents of the matched - /// set of elements. - /// Can be filtered with an optional expressions. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the parents with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - parents: function(elem){return jQuery.dir(elem,"parentNode");} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary> - /// Get a set of elements containing the unique ancestors of the matched - /// set of elements (except for the root element). - /// Can be filtered with an optional expressions. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the ancestors with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - next: function(elem){return jQuery.nth(elem,2,"nextSibling");} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary> - /// Get a set of elements containing the unique next siblings of each of the - /// matched set of elements. - /// It only returns the very next sibling, not all next siblings. - /// Can be filtered with an optional expressions. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the next Elements with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - prev: function(elem){return jQuery.nth(elem,2,"previousSibling");} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary> - /// Get a set of elements containing the unique previous siblings of each of the - /// matched set of elements. - /// Can be filtered with an optional expressions. - /// It only returns the immediately previous sibling, not all previous siblings. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the previous Elements with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - nextAll: function(elem){return jQuery.dir(elem,"nextSibling");} -}, function(name, fn){ - jQuery.fn[name] = function(selector) { - /// <summary> - /// Finds all sibling elements after the current element. - /// Can be filtered with an optional expressions. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the next Elements with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - prevAll: function(elem){return jQuery.dir(elem,"previousSibling");} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary> - /// Finds all sibling elements before the current element. - /// Can be filtered with an optional expressions. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the previous Elements with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary> - /// Get a set of elements containing all of the unique siblings of each of the - /// matched set of elements. - /// Can be filtered with an optional expressions. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the sibling Elements with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - children: function(elem){return jQuery.sibling(elem.firstChild);} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary> - /// Get a set of elements containing all of the unique children of each of the - /// matched set of elements. - /// Can be filtered with an optional expressions. - /// Part of DOM/Traversing - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) An expression to filter the child Elements with - /// </param> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - /// <summary>Finds all the child nodes inside the matched elements including text nodes, or the content document if the element is an iframe.</summary> - /// <returns type="jQuery" /> - - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -// [vsdoc] The following section has been denormalized from original sources for IntelliSense. -// jQuery.each({ -// appendTo: "append", -// prependTo: "prepend", -// insertBefore: "before", -// insertAfter: "after", -// replaceAll: "replaceWith" -// }, function(name, original){ -// jQuery.fn[ name ] = function() { -// var args = arguments; -// -// return this.each(function(){ -// for ( var i = 0, length = args.length; i < length; i++ ) -// jQuery( args[ i ] )[ original ]( this ); -// }); -// }; -// }); - -jQuery.fn.appendTo = function( selector ) { - /// <summary> - /// Append all of the matched elements to another, specified, set of elements. - /// As of jQuery 1.3.2, returns all of the inserted elements. - /// This operation is, essentially, the reverse of doing a regular - /// $(A).append(B), in that instead of appending B to A, you're appending - /// A to B. - /// </summary> - /// <param name="selector" type="Selector"> - /// target to which the content will be appended. - /// </param> - /// <returns type="jQuery" /> - var ret = [], insert = jQuery( selector ); - - for ( var i = 0, l = insert.length; i < l; i++ ) { - var elems = (i > 0 ? this.clone(true) : this).get(); - jQuery.fn[ "append" ].apply( jQuery(insert[i]), elems ); - ret = ret.concat( elems ); - } - - return this.pushStack( ret, "appendTo", selector ); -}; - -jQuery.fn.prependTo = function( selector ) { - /// <summary> - /// Prepend all of the matched elements to another, specified, set of elements. - /// As of jQuery 1.3.2, returns all of the inserted elements. - /// This operation is, essentially, the reverse of doing a regular - /// $(A).prepend(B), in that instead of prepending B to A, you're prepending - /// A to B. - /// </summary> - /// <param name="selector" type="Selector"> - /// target to which the content will be appended. - /// </param> - /// <returns type="jQuery" /> - var ret = [], insert = jQuery( selector ); - - for ( var i = 0, l = insert.length; i < l; i++ ) { - var elems = (i > 0 ? this.clone(true) : this).get(); - jQuery.fn[ "prepend" ].apply( jQuery(insert[i]), elems ); - ret = ret.concat( elems ); - } - - return this.pushStack( ret, "prependTo", selector ); -}; - -jQuery.fn.insertBefore = function( selector ) { - /// <summary> - /// Insert all of the matched elements before another, specified, set of elements. - /// As of jQuery 1.3.2, returns all of the inserted elements. - /// This operation is, essentially, the reverse of doing a regular - /// $(A).before(B), in that instead of inserting B before A, you're inserting - /// A before B. - /// </summary> - /// <param name="content" type="String"> - /// Content after which the selected element(s) is inserted. - /// </param> - /// <returns type="jQuery" /> - var ret = [], insert = jQuery( selector ); - - for ( var i = 0, l = insert.length; i < l; i++ ) { - var elems = (i > 0 ? this.clone(true) : this).get(); - jQuery.fn[ "before" ].apply( jQuery(insert[i]), elems ); - ret = ret.concat( elems ); - } - - return this.pushStack( ret, "insertBefore", selector ); -}; - -jQuery.fn.insertAfter = function( selector ) { - /// <summary> - /// Insert all of the matched elements after another, specified, set of elements. - /// As of jQuery 1.3.2, returns all of the inserted elements. - /// This operation is, essentially, the reverse of doing a regular - /// $(A).after(B), in that instead of inserting B after A, you're inserting - /// A after B. - /// </summary> - /// <param name="content" type="String"> - /// Content after which the selected element(s) is inserted. - /// </param> - /// <returns type="jQuery" /> - var ret = [], insert = jQuery( selector ); - - for ( var i = 0, l = insert.length; i < l; i++ ) { - var elems = (i > 0 ? this.clone(true) : this).get(); - jQuery.fn[ "after" ].apply( jQuery(insert[i]), elems ); - ret = ret.concat( elems ); - } - - return this.pushStack( ret, "insertAfter", selector ); -}; - -jQuery.fn.replaceAll = function( selector ) { - /// <summary> - /// Replaces the elements matched by the specified selector with the matched elements. - /// As of jQuery 1.3.2, returns all of the inserted elements. - /// </summary> - /// <param name="selector" type="Selector">The elements to find and replace the matched elements with.</param> - /// <returns type="jQuery" /> - var ret = [], insert = jQuery( selector ); - - for ( var i = 0, l = insert.length; i < l; i++ ) { - var elems = (i > 0 ? this.clone(true) : this).get(); - jQuery.fn[ "replaceWith" ].apply( jQuery(insert[i]), elems ); - ret = ret.concat( elems ); - } - - return this.pushStack( ret, "replaceAll", selector ); -}; - -// [vsdoc] The following section has been denormalized from original sources for IntelliSense. -// jQuery.each({ -// removeAttr: function( name ) { -// jQuery.attr( this, name, "" ); -// if (this.nodeType == 1) -// this.removeAttribute( name ); -// }, -// -// addClass: function( classNames ) { -// jQuery.className.add( this, classNames ); -// }, -// -// removeClass: function( classNames ) { -// jQuery.className.remove( this, classNames ); -// }, -// -// toggleClass: function( classNames, state ) { -// if( typeof state !== "boolean" ) -// state = !jQuery.className.has( this, classNames ); -// jQuery.className[ state ? "add" : "remove" ]( this, classNames ); -// }, -// -// remove: function( selector ) { -// if ( !selector || jQuery.filter( selector, [ this ] ).length ) { -// // Prevent memory leaks -// jQuery( "*", this ).add([this]).each(function(){ -// jQuery.event.remove(this); -// jQuery.removeData(this); -// }); -// if (this.parentNode) -// this.parentNode.removeChild( this ); -// } -// }, -// -// empty: function() { -// // Remove element nodes and prevent memory leaks -// jQuery( ">*", this ).remove(); -// -// // Remove any remaining nodes -// while ( this.firstChild ) -// this.removeChild( this.firstChild ); -// } -// }, function(name, fn){ -// jQuery.fn[ name ] = function(){ -// return this.each( fn, arguments ); -// }; -// }); - -jQuery.fn.removeAttr = function(){ - /// <summary> - /// Remove an attribute from each of the matched elements. - /// Part of DOM/Attributes - /// </summary> - /// <param name="key" type="String"> - /// name The name of the attribute to remove. - /// </param> - /// <returns type="jQuery" /> - return this.each( function( name ) { - jQuery.attr( this, name, "" ); - if (this.nodeType == 1) - this.removeAttribute( name ); - }, arguments ); -}; - -jQuery.fn.addClass = function(){ - /// <summary> - /// Adds the specified class(es) to each of the set of matched elements. - /// Part of DOM/Attributes - /// </summary> - /// <param name="classNames" type="String"> - /// lass One or more CSS classes to add to the elements - /// </param> - /// <returns type="jQuery" /> - return this.each( function( classNames ) { - jQuery.className.add( this, classNames ); - }, arguments ); -}; - -jQuery.fn.removeClass = function(){ - /// <summary> - /// Removes all or the specified class(es) from the set of matched elements. - /// Part of DOM/Attributes - /// </summary> - /// <param name="cssClasses" type="String" optional="true"> - /// (Optional) One or more CSS classes to remove from the elements - /// </param> - /// <returns type="jQuery" /> - return this.each( function( classNames ) { - jQuery.className.remove( this, classNames ); - }, arguments ); -}; - -jQuery.fn.toggleClass = function(){ - /// <summary> - /// Adds the specified class if it is not present, removes it if it is - /// present. - /// Part of DOM/Attributes - /// </summary> - /// <param name="cssClass" type="String"> - /// A CSS class with which to toggle the elements - /// </param> - /// <returns type="jQuery" /> - return this.each( function( classNames, state ) { - if( typeof state !== "boolean" ) - state = !jQuery.className.has( this, classNames ); - jQuery.className[ state ? "add" : "remove" ]( this, classNames ); - }, arguments ); -}; - -jQuery.fn.remove = function(){ - /// <summary> - /// Removes all matched elements from the DOM. This does NOT remove them from the - /// jQuery object, allowing you to use the matched elements further. - /// Can be filtered with an optional expressions. - /// Part of DOM/Manipulation - /// </summary> - /// <param name="expr" type="String" optional="true"> - /// (optional) A jQuery expression to filter elements by. - /// </param> - /// <returns type="jQuery" /> - return this.each( function( selector ) { - if ( !selector || jQuery.filter( selector, [ this ] ).length ) { - // Prevent memory leaks - jQuery( "*", this ).add([this]).each(function(){ - jQuery.event.remove(this); - jQuery.removeData(this); - }); - if (this.parentNode) - this.parentNode.removeChild( this ); - } - }, arguments ); -}; - -jQuery.fn.empty = function(){ - /// <summary> - /// Removes all child nodes from the set of matched elements. - /// Part of DOM/Manipulation - /// </summary> - /// <returns type="jQuery" /> - return this.each( function() { - // Remove element nodes and prevent memory leaks - jQuery(this).children().remove(); - - // Remove any remaining nodes - while ( this.firstChild ) - this.removeChild( this.firstChild ); - }, arguments ); -}; - -// Helper function used by the dimensions and offset modules -function num(elem, prop) { - return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0; -} -var expando = "jQuery" + now(), uuid = 0, windowData = {}; - -jQuery.extend({ - cache: {}, - - data: function( elem, name, data ) { - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ]; - - // Compute a unique ID for the element - if ( !id ) - id = elem[ expando ] = ++uuid; - - // Only generate the data cache if we're - // trying to access or manipulate it - if ( name && !jQuery.cache[ id ] ) - jQuery.cache[ id ] = {}; - - // Prevent overriding the named cache with undefined values - if ( data !== undefined ) - jQuery.cache[ id ][ name ] = data; - - // Return the named cache data, or the ID for the element - return name ? - jQuery.cache[ id ][ name ] : - id; - }, - - removeData: function( elem, name ) { - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ]; - - // If we want to remove a specific section of the element's data - if ( name ) { - if ( jQuery.cache[ id ] ) { - // Remove the section of cache data - delete jQuery.cache[ id ][ name ]; - - // If we've removed all the data, remove the element's cache - name = ""; - - for ( name in jQuery.cache[ id ] ) - break; - - if ( !name ) - jQuery.removeData( elem ); - } - - // Otherwise, we want to remove all of the element's data - } else { - // Clean up the element expando - try { - delete elem[ expando ]; - } catch(e){ - // IE has trouble directly removing the expando - // but it's ok with using removeAttribute - if ( elem.removeAttribute ) - elem.removeAttribute( expando ); - } - - // Completely remove the data cache - delete jQuery.cache[ id ]; - } - }, - queue: function( elem, type, data ) { - if ( elem ){ - - type = (type || "fx") + "queue"; - - var q = jQuery.data( elem, type ); - - if ( !q || jQuery.isArray(data) ) - q = jQuery.data( elem, type, jQuery.makeArray(data) ); - else if( data ) - q.push( data ); - - } - return q; - }, - - dequeue: function( elem, type ){ - var queue = jQuery.queue( elem, type ), - fn = queue.shift(); - - if( !type || type === "fx" ) - fn = queue[0]; - - if( fn !== undefined ) - fn.call(elem); - } -}); - -jQuery.fn.extend({ - data: function( key, value ){ - var parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if ( value === undefined ) { - var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - if ( data === undefined && this.length ) - data = jQuery.data( this[0], key ); - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - } else - return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ - jQuery.data( this, key, value ); - }); - }, - - removeData: function( key ){ - return this.each(function(){ - jQuery.removeData( this, key ); - }); - }, - queue: function(type, data){ - /// <summary> - /// 1: queue() - Returns a reference to the first element's queue (which is an array of functions). - /// 2: queue(callback) - Adds a new function, to be executed, onto the end of the queue of all matched elements. - /// 3: queue(queue) - Replaces the queue of all matched element with this new queue (the array of functions). - /// </summary> - /// <param name="type" type="Function">The function to add to the queue.</param> - /// <returns type="jQuery" /> - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - } - - if ( data === undefined ) - return jQuery.queue( this[0], type ); - - return this.each(function(){ - var queue = jQuery.queue( this, type, data ); - - if( type == "fx" && queue.length == 1 ) - queue[0].call(this); - }); - }, - dequeue: function(type){ - /// <summary> - /// Removes a queued function from the front of the queue and executes it. - /// </summary> - /// <param name="type" type="String" optional="true">The type of queue to access.</param> - /// <returns type="jQuery" /> - - return this.each(function(){ - jQuery.dequeue( this, type ); - }); - } -});/*! - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * More information: http://sizzlejs.com/ - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g, - done = 0, - toString = Object.prototype.toString; - -var Sizzle = function(selector, context, results, seed) { - results = results || []; - context = context || document; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) - return []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var parts = [], m, set, checkSet, check, mode, extra, prune = true; - - // Reset the position of the chunker regexp (start from head) - chunker.lastIndex = 0; - - while ( (m = chunker.exec(selector)) !== null ) { - parts.push( m[1] ); - - if ( m[2] ) { - extra = RegExp.rightContext; - break; - } - } - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context ); - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) - selector += parts.shift(); - - set = posProcess( selector, set ); - } - } - } else { - var ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context) ); - set = Sizzle.filter( ret.expr, ret.set ); - - if ( parts.length > 0 ) { - checkSet = makeArray(set); - } else { - prune = false; - } - - while ( parts.length ) { - var cur = parts.pop(), pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, isXML(context) ); - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - throw "Syntax error, unrecognized expression: " + (cur || selector); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - } else if ( context.nodeType === 1 ) { - for ( var i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - } else { - for ( var i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, context, results, seed ); - - if ( sortOrder ) { - hasDuplicate = false; - results.sort(sortOrder); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[i-1] ) { - results.splice(i--, 1); - } - } - } - } - } - - return results; -}; - -Sizzle.matches = function(expr, set){ - return Sizzle(expr, null, null, set); -}; - -Sizzle.find = function(expr, context, isXML){ - var set, match; - - if ( !expr ) { - return []; - } - - for ( var i = 0, l = Expr.order.length; i < l; i++ ) { - var type = Expr.order[i], match; - - if ( (match = Expr.match[ type ].exec( expr )) ) { - var left = RegExp.leftContext; - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace(/\\/g, ""); - set = Expr.find[ type ]( match, context, isXML ); - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = context.getElementsByTagName("*"); - } - - return {set: set, expr: expr}; -}; - -Sizzle.filter = function(expr, set, inplace, not){ - var old = expr, result = [], curLoop = set, match, anyFound, - isXMLFilter = set && set[0] && isXML(set[0]); - - while ( expr && set.length ) { - for ( var type in Expr.filter ) { - if ( (match = Expr.match[ type ].exec( expr )) != null ) { - var filter = Expr.filter[ type ], found, item; - anyFound = false; - - if ( curLoop == result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( var i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - var pass = not ^ !!found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - } else { - curLoop[i] = false; - } - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr == old ) { - if ( anyFound == null ) { - throw "Syntax error, unrecognized expression: " + expr; - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - match: { - ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/ - }, - attrMap: { - "class": "className", - "for": "htmlFor" - }, - attrHandle: { - href: function(elem){ - return elem.getAttribute("href"); - } - }, - relative: { - "+": function(checkSet, part, isXML){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !/\W/.test(part), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag && !isXML ) { - part = part.toUpperCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - ">": function(checkSet, part, isXML){ - var isPartStr = typeof part === "string"; - - if ( isPartStr && !/\W/.test(part) ) { - part = isXML ? part : part.toUpperCase(); - - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName === part ? parent : false; - } - } - } else { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - "": function(checkSet, part, isXML){ - var doneName = done++, checkFn = dirCheck; - - if ( !part.match(/\W/) ) { - var nodeCheck = part = isXML ? part : part.toUpperCase(); - checkFn = dirNodeCheck; - } - - checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); - }, - "~": function(checkSet, part, isXML){ - var doneName = done++, checkFn = dirCheck; - - if ( typeof part === "string" && !part.match(/\W/) ) { - var nodeCheck = part = isXML ? part : part.toUpperCase(); - checkFn = dirNodeCheck; - } - - checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); - } - }, - find: { - ID: function(match, context, isXML){ - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - return m ? [m] : []; - } - }, - NAME: function(match, context, isXML){ - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], results = context.getElementsByName(match[1]); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - TAG: function(match, context){ - return context.getElementsByTagName(match[1]); - } - }, - preFilter: { - CLASS: function(match, curLoop, inplace, result, not, isXML){ - match = " " + match[1].replace(/\\/g, "") + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) { - if ( !inplace ) - result.push( elem ); - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - ID: function(match){ - return match[1].replace(/\\/g, ""); - }, - TAG: function(match, curLoop){ - for ( var i = 0; curLoop[i] === false; i++ ){} - return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase(); - }, - CHILD: function(match){ - if ( match[1] == "nth" ) { - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( - match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - ATTR: function(match, curLoop, inplace, result, not, isXML){ - var name = match[1].replace(/\\/g, ""); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - PSEUDO: function(match, curLoop, inplace, result, not){ - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - if ( !inplace ) { - result.push.apply( result, ret ); - } - return false; - } - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - POS: function(match){ - match.unshift( true ); - return match; - } - }, - filters: { - enabled: function(elem){ - return elem.disabled === false && elem.type !== "hidden"; - }, - disabled: function(elem){ - return elem.disabled === true; - }, - checked: function(elem){ - return elem.checked === true; - }, - selected: function(elem){ - // Accessing this property makes selected-by-default - // options in Safari work properly - elem.parentNode.selectedIndex; - return elem.selected === true; - }, - parent: function(elem){ - return !!elem.firstChild; - }, - empty: function(elem){ - return !elem.firstChild; - }, - has: function(elem, i, match){ - return !!Sizzle( match[3], elem ).length; - }, - header: function(elem){ - return /h\d/i.test( elem.nodeName ); - }, - text: function(elem){ - return "text" === elem.type; - }, - radio: function(elem){ - return "radio" === elem.type; - }, - checkbox: function(elem){ - return "checkbox" === elem.type; - }, - file: function(elem){ - return "file" === elem.type; - }, - password: function(elem){ - return "password" === elem.type; - }, - submit: function(elem){ - return "submit" === elem.type; - }, - image: function(elem){ - return "image" === elem.type; - }, - reset: function(elem){ - return "reset" === elem.type; - }, - button: function(elem){ - return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON"; - }, - input: function(elem){ - return /input|select|textarea|button/i.test(elem.nodeName); - } - }, - setFilters: { - first: function(elem, i){ - return i === 0; - }, - last: function(elem, i, match, array){ - return i === array.length - 1; - }, - even: function(elem, i){ - return i % 2 === 0; - }, - odd: function(elem, i){ - return i % 2 === 1; - }, - lt: function(elem, i, match){ - return i < match[3] - 0; - }, - gt: function(elem, i, match){ - return i > match[3] - 0; - }, - nth: function(elem, i, match){ - return match[3] - 0 == i; - }, - eq: function(elem, i, match){ - return match[3] - 0 == i; - } - }, - filter: { - PSEUDO: function(elem, match, i, array){ - var name = match[1], filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0; - } else if ( name === "not" ) { - var not = match[3]; - - for ( var i = 0, l = not.length; i < l; i++ ) { - if ( not[i] === elem ) { - return false; - } - } - - return true; - } - }, - CHILD: function(elem, match){ - var type = match[1], node = elem; - switch (type) { - case 'only': - case 'first': - while (node = node.previousSibling) { - if ( node.nodeType === 1 ) return false; - } - if ( type == 'first') return true; - node = elem; - case 'last': - while (node = node.nextSibling) { - if ( node.nodeType === 1 ) return false; - } - return true; - case 'nth': - var first = match[2], last = match[3]; - - if ( first == 1 && last == 0 ) { - return true; - } - - var doneName = match[0], - parent = elem.parentNode; - - if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { - var count = 0; - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - parent.sizcache = doneName; - } - - var diff = elem.nodeIndex - last; - if ( first == 0 ) { - return diff == 0; - } else { - return ( diff % first == 0 && diff / first >= 0 ); - } - } - }, - ID: function(elem, match){ - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - TAG: function(elem, match){ - return (match === "*" && elem.nodeType === 1) || elem.nodeName === match; - }, - CLASS: function(elem, match){ - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - ATTR: function(elem, match){ - var name = match[1], - result = Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value != check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - POS: function(elem, match, i, array){ - var name = match[2], filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS; - -for ( var type in Expr.match ) { - Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); -} - -var makeArray = function(array, results) { - array = Array.prototype.slice.call( array ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -try { - Array.prototype.slice.call( document.documentElement.childNodes ); - -// Provide a fallback method if it does not work -} catch(e){ - makeArray = function(array, results) { - var ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - } else { - if ( typeof array.length === "number" ) { - for ( var i = 0, l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - } else { - for ( var i = 0; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} else if ( "sourceIndex" in document.documentElement ) { - sortOrder = function( a, b ) { - var ret = a.sourceIndex - b.sourceIndex; - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} else if ( document.createRange ) { - sortOrder = function( a, b ) { - var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); - aRange.selectNode(a); - aRange.collapse(true); - bRange.selectNode(b); - bRange.collapse(true); - var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} - -// [vsdoc] The following function has been commented out for IntelliSense. -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -//(function(){ -// // We're going to inject a fake input element with a specified name -// var form = document.createElement("form"), -// id = "script" + (new Date).getTime(); -// form.innerHTML = "<input name='" + id + "'/>"; - -// // Inject it into the root element, check its status, and remove it quickly -// var root = document.documentElement; -// root.insertBefore( form, root.firstChild ); - -// // The workaround has to do additional checks after a getElementById -// // Which slows things down for other browsers (hence the branching) -// if ( !!document.getElementById( id ) ) { -// Expr.find.ID = function(match, context, isXML){ -// if ( typeof context.getElementById !== "undefined" && !isXML ) { -// var m = context.getElementById(match[1]); -// return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; -// } -// }; - -// Expr.filter.ID = function(elem, match){ -// var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); -// return elem.nodeType === 1 && node && node.nodeValue === match; -// }; -// } - -// root.removeChild( form ); -//})(); - -// [vsdoc] The following function has been commented out for IntelliSense. -//(function(){ -// // Check to see if the browser returns only elements -// // when doing getElementsByTagName("*") - -// // Create a fake element -// var div = document.createElement("div"); -// div.appendChild( document.createComment("") ); - -// // Make sure no comments are found -// if ( div.getElementsByTagName("*").length > 0 ) { -// Expr.find.TAG = function(match, context){ -// var results = context.getElementsByTagName(match[1]); - -// // Filter out possible comments -// if ( match[1] === "*" ) { -// var tmp = []; - -// for ( var i = 0; results[i]; i++ ) { -// if ( results[i].nodeType === 1 ) { -// tmp.push( results[i] ); -// } -// } - -// results = tmp; -// } - -// return results; -// }; -// } - -// // Check to see if an attribute returns normalized href attributes -// div.innerHTML = "<a href='#'></a>"; -// if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && -// div.firstChild.getAttribute("href") !== "#" ) { -// Expr.attrHandle.href = function(elem){ -// return elem.getAttribute("href", 2); -// }; -// } -// })(); - -if ( document.querySelectorAll ) (function(){ - var oldSizzle = Sizzle, div = document.createElement("div"); - div.innerHTML = "<p class='TEST'></p>"; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function(query, context, extra, seed){ - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && context.nodeType === 9 && !isXML(context) ) { - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(e){} - } - - return oldSizzle(query, context, extra, seed); - }; - - Sizzle.find = oldSizzle.find; - Sizzle.filter = oldSizzle.filter; - Sizzle.selectors = oldSizzle.selectors; - Sizzle.matches = oldSizzle.matches; -})(); - -if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){ - var div = document.createElement("div"); - div.innerHTML = "<div class='test e'></div><div class='test'></div>"; - - // Opera can't find a second classname (in 9.6) - if ( div.getElementsByClassName("e").length === 0 ) - return; - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) - return; - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function(match, context, isXML) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - var sibDir = dir == "previousSibling" && !isXML; - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - if ( sibDir && elem.nodeType === 1 ){ - elem.sizcache = doneName; - elem.sizset = i; - } - elem = elem[dir]; - var match = false; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem.sizcache = doneName; - elem.sizset = i; - } - - if ( elem.nodeName === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - var sibDir = dir == "previousSibling" && !isXML; - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - if ( sibDir && elem.nodeType === 1 ) { - elem.sizcache = doneName; - elem.sizset = i; - } - elem = elem[dir]; - var match = false; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem.sizcache = doneName; - elem.sizset = i; - } - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -var contains = document.compareDocumentPosition ? function(a, b){ - return a.compareDocumentPosition(b) & 16; -} : function(a, b){ - return a !== b && (a.contains ? a.contains(b) : true); -}; - -var isXML = function(elem){ - return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || - !!elem.ownerDocument && isXML( elem.ownerDocument ); -}; - -var posProcess = function(selector, context){ - var tmpSet = [], later = "", match, - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE -jQuery.find = Sizzle; -jQuery.filter = Sizzle.filter; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; - -Sizzle.selectors.filters.hidden = function(elem){ - return elem.offsetWidth === 0 || elem.offsetHeight === 0; -}; - -Sizzle.selectors.filters.visible = function(elem){ - return elem.offsetWidth > 0 || elem.offsetHeight > 0; -}; - -Sizzle.selectors.filters.animated = function(elem){ - return jQuery.grep(jQuery.timers, function(fn){ - return elem === fn.elem; - }).length; -}; - -jQuery.multiFilter = function( expr, elems, not ) { - /// <summary> - /// This member is internal only. - /// </summary> - /// <private /> - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return Sizzle.matches(expr, elems); -}; - -jQuery.dir = function( elem, dir ){ - /// <summary> - /// This member is internal only. - /// </summary> - /// <private /> - // This member is not documented in the jQuery API: http://docs.jquery.com/Special:Search?ns0=1&search=dir - var matched = [], cur = elem[dir]; - while ( cur && cur != document ) { - if ( cur.nodeType == 1 ) - matched.push( cur ); - cur = cur[dir]; - } - return matched; -}; - -jQuery.nth = function(cur, result, dir, elem){ - /// <summary> - /// This member is internal only. - /// </summary> - /// <private /> - // This member is not documented in the jQuery API: http://docs.jquery.com/Special:Search?ns0=1&search=nth - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) - if ( cur.nodeType == 1 && ++num == result ) - break; - - return cur; -}; - -jQuery.sibling = function(n, elem){ - /// <summary> - /// This member is internal only. - /// </summary> - /// <private /> - // This member is not documented in the jQuery API: http://docs.jquery.com/Special:Search?ns0=1&search=nth - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType == 1 && n != elem ) - r.push( n ); - } - - return r; -}; - -return; - -window.Sizzle = Sizzle; - -})(); -/* - * A number of helper functions used for managing events. - * Many of the ideas behind this code originated from - * Dean Edwards' addEvent library. - */ -jQuery.event = { - - // Bind an event to an element - // Original by Dean Edwards - add: function(elem, types, handler, data) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - if ( elem.nodeType == 3 || elem.nodeType == 8 ) - return; - - // For whatever reason, IE has trouble passing the window object - // around, causing it to be cloned in the process - if ( elem.setInterval && elem != window ) - elem = window; - - // Make sure that the function being executed has a unique ID - if ( !handler.guid ) - handler.guid = this.guid++; - - // if data is passed, bind to handler - if ( data !== undefined ) { - // Create temporary function pointer to original handler - var fn = handler; - - // Create unique handler function, wrapped around original handler - handler = this.proxy( fn ); - - // Store data in unique handler - handler.data = data; - } - - // Init the element's event structure - var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}), - handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){ - // Handle the second event of a trigger and when - // an event is called after a page has unloaded - return typeof jQuery !== "undefined" && !jQuery.event.triggered ? - jQuery.event.handle.apply(arguments.callee.elem, arguments) : - undefined; - }); - // Add elem as a property of the handle function - // This is to prevent a memory leak with non-native - // event in IE. - handle.elem = elem; - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - jQuery.each(types.split(/\s+/), function(index, type) { - // Namespaced event handlers - var namespaces = type.split("."); - type = namespaces.shift(); - handler.type = namespaces.slice().sort().join("."); - - // Get the current list of functions bound to this event - var handlers = events[type]; - - if ( jQuery.event.specialAll[type] ) - jQuery.event.specialAll[type].setup.call(elem, data, namespaces); - - // Init the event handler queue - if (!handlers) { - handlers = events[type] = {}; - - // Check for a special event handler - // Only use addEventListener/attachEvent if the special - // events handler returns false - if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) { - // Bind the global event handler to the element - if (elem.addEventListener) - elem.addEventListener(type, handle, false); - else if (elem.attachEvent) - elem.attachEvent("on" + type, handle); - } - } - - // Add the function to the element's handler list - handlers[handler.guid] = handler; - - // Keep track of which events have been used, for global triggering - jQuery.event.global[type] = true; - }); - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - guid: 1, - global: {}, - - // Detach an event or set of events from an element - remove: function(elem, types, handler) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - // don't do events on text and comment nodes - if ( elem.nodeType == 3 || elem.nodeType == 8 ) - return; - - var events = jQuery.data(elem, "events"), ret, index; - - if ( events ) { - // Unbind all events for the element - if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") ) - for ( var type in events ) - this.remove( elem, type + (types || "") ); - else { - // types is actually an event object here - if ( types.type ) { - handler = types.handler; - types = types.type; - } - - // Handle multiple events seperated by a space - // jQuery(...).unbind("mouseover mouseout", fn); - jQuery.each(types.split(/\s+/), function(index, type){ - // Namespaced event handlers - var namespaces = type.split("."); - type = namespaces.shift(); - var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); - - if ( events[type] ) { - // remove the given handler for the given type - if ( handler ) - delete events[type][handler.guid]; - - // remove all handlers for the given type - else - for ( var handle in events[type] ) - // Handle the removal of namespaced events - if ( namespace.test(events[type][handle].type) ) - delete events[type][handle]; - - if ( jQuery.event.specialAll[type] ) - jQuery.event.specialAll[type].teardown.call(elem, namespaces); - - // remove generic event handler if no more handlers exist - for ( ret in events[type] ) break; - if ( !ret ) { - if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) { - if (elem.removeEventListener) - elem.removeEventListener(type, jQuery.data(elem, "handle"), false); - else if (elem.detachEvent) - elem.detachEvent("on" + type, jQuery.data(elem, "handle")); - } - ret = null; - delete events[type]; - } - } - }); - } - - // Remove the expando if it's no longer used - for ( ret in events ) break; - if ( !ret ) { - var handle = jQuery.data( elem, "handle" ); - if ( handle ) handle.elem = null; - jQuery.removeData( elem, "events" ); - jQuery.removeData( elem, "handle" ); - } - } - }, - - // bubbling is internal - trigger: function( event, data, elem, bubbling ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - // Event object or event type - var type = event.type || event; - - if( !bubbling ){ - event = typeof event === "object" ? - // jQuery.Event object - event[expando] ? event : - // Object literal - jQuery.extend( jQuery.Event(type), event ) : - // Just the event type (string) - jQuery.Event(type); - - if ( type.indexOf("!") >= 0 ) { - event.type = type = type.slice(0, -1); - event.exclusive = true; - } - - // Handle a global trigger - if ( !elem ) { - // Don't bubble custom events when global (to avoid too much overhead) - event.stopPropagation(); - // Only trigger if we've ever bound an event for it - if ( this.global[type] ) - jQuery.each( jQuery.cache, function(){ - if ( this.events && this.events[type] ) - jQuery.event.trigger( event, data, this.handle.elem ); - }); - } - - // Handle triggering a single element - - // don't do events on text and comment nodes - if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 ) - return undefined; - - // Clean up in case it is reused - event.result = undefined; - event.target = elem; - - // Clone the incoming data, if any - data = jQuery.makeArray(data); - data.unshift( event ); - } - - event.currentTarget = elem; - - // Trigger the event, it is assumed that "handle" is a function - var handle = jQuery.data(elem, "handle"); - if ( handle ) - handle.apply( elem, data ); - - // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links) - if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false ) - event.result = false; - - // Trigger the native events (except for clicks on links) - if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) { - this.triggered = true; - try { - elem[ type ](); - // prevent IE from throwing an error for some hidden elements - } catch (e) {} - } - - this.triggered = false; - - if ( !event.isPropagationStopped() ) { - var parent = elem.parentNode || elem.ownerDocument; - if ( parent ) - jQuery.event.trigger(event, data, parent, true); - } - }, - - handle: function(event) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - // returned undefined or false - var all, handlers; - - event = arguments[0] = jQuery.event.fix( event || window.event ); - event.currentTarget = this; - - // Namespaced event handlers - var namespaces = event.type.split("."); - event.type = namespaces.shift(); - - // Cache this now, all = true means, any handler - all = !namespaces.length && !event.exclusive; - - var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); - - handlers = ( jQuery.data(this, "events") || {} )[event.type]; - - for ( var j in handlers ) { - var handler = handlers[j]; - - // Filter the functions by class - if ( all || namespace.test(handler.type) ) { - // Pass in a reference to the handler function itself - // So that we can later remove it - event.handler = handler; - event.data = handler.data; - - var ret = handler.apply(this, arguments); - - if( ret !== undefined ){ - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - - if( event.isImmediatePropagationStopped() ) - break; - - } - } - }, - - props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), - - fix: function(event) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - if ( event[expando] ) - return event; - - // store a copy of the original event object - // and "clone" to set read-only properties - var originalEvent = event; - event = jQuery.Event( originalEvent ); - - for ( var i = this.props.length, prop; i; ){ - prop = this.props[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary - if ( !event.target ) - event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either - - // check if target is a textnode (safari) - if ( event.target.nodeType == 3 ) - event.target = event.target.parentNode; - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && event.fromElement ) - event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && event.clientX != null ) { - var doc = document.documentElement, body = document.body; - event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0); - event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0); - } - - // Add which for key events - if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) - event.which = event.charCode || event.keyCode; - - // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) - if ( !event.metaKey && event.ctrlKey ) - event.metaKey = event.ctrlKey; - - // Add which for click: 1 == left; 2 == middle; 3 == right - // Note: button is not normalized, so don't use it - if ( !event.which && event.button ) - event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); - - return event; - }, - - proxy: function( fn, proxy ){ - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - proxy = proxy || function(){ return fn.apply(this, arguments); }; - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++; - // So proxy can be declared as an argument - return proxy; - }, - - special: { - ready: { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - // Make sure the ready event is setup - setup: bindReady, - teardown: function() {} - } - }, - - specialAll: { - live: { - setup: function( selector, namespaces ){ - jQuery.event.add( this, namespaces[0], liveHandler ); - }, - teardown: function( namespaces ){ - if ( namespaces.length ) { - var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)"); - - jQuery.each( (jQuery.data(this, "events").live || {}), function(){ - if ( name.test(this.type) ) - remove++; - }); - - if ( remove < 1 ) - jQuery.event.remove( this, namespaces[0], liveHandler ); - } - } - } - } -}; - -jQuery.Event = function( src ){ - // Allow instantiation without the 'new' keyword - if( !this.preventDefault ) - return new jQuery.Event(src); - - // Event object - if( src && src.type ){ - this.originalEvent = src; - this.type = src.type; - // Event type - }else - this.type = src; - - // timeStamp is buggy for some events on Firefox(#3843) - // So we won't rely on the native value - this.timeStamp = now(); - - // Mark it as fixed - this[expando] = true; -}; - -function returnFalse(){ - return false; -} -function returnTrue(){ - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if( !e ) - return; - // if preventDefault exists run it on the original event - if (e.preventDefault) - e.preventDefault(); - // otherwise set the returnValue property of the original event to false (IE) - e.returnValue = false; - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if( !e ) - return; - // if stopPropagation exists run it on the original event - if (e.stopPropagation) - e.stopPropagation(); - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation:function(){ - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; -// Checks if an event happened on an element within another element -// Used in jQuery.event.special.mouseenter and mouseleave handlers -var withinElement = function(event) { - // Check if mouse(over|out) are still within the same parent element - var parent = event.relatedTarget; - // Traverse up the tree - while ( parent && parent != this ) - try { parent = parent.parentNode; } - catch(e) { parent = this; } - - if( parent != this ){ - // set the correct event type - event.type = event.data; - // handle event if we actually just moused on to a non sub-element - jQuery.event.handle.apply( this, arguments ); - } -}; - -jQuery.each({ - mouseover: 'mouseenter', - mouseout: 'mouseleave' -}, function( orig, fix ){ - jQuery.event.special[ fix ] = { - setup: function(){ - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - jQuery.event.add( this, orig, withinElement, fix ); - }, - teardown: function(){ - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - jQuery.event.remove( this, orig, withinElement ); - } - }; -}); - -jQuery.fn.extend({ - bind: function( type, data, fn ) { - /// <summary> - /// Binds a handler to one or more events for each matched element. Can also bind custom events. - /// </summary> - /// <param name="type" type="String">One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error .</param> - /// <param name="data" optional="true" type="Object">Additional data passed to the event handler as event.data</param> - /// <param name="fn" type="Function">A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element.</param> - - return type == "unload" ? this.one(type, data, fn) : this.each(function(){ - jQuery.event.add( this, type, fn || data, fn && data ); - }); - }, - - one: function( type, data, fn ) { - /// <summary> - /// Binds a handler to one or more events to be executed exactly once for each matched element. - /// </summary> - /// <param name="type" type="String">One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error .</param> - /// <param name="data" optional="true" type="Object">Additional data passed to the event handler as event.data</param> - /// <param name="fn" type="Function">A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element.</param> - - var one = jQuery.event.proxy( fn || data, function(event) { - jQuery(this).unbind(event, one); - return (fn || data).apply( this, arguments ); - }); - return this.each(function(){ - jQuery.event.add( this, type, one, fn && data); - }); - }, - - unbind: function( type, fn ) { - /// <summary> - /// Unbinds a handler from one or more events for each matched element. - /// </summary> - /// <param name="type" type="String">One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error .</param> - /// <param name="fn" type="Function">A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element.</param> - - return this.each(function(){ - jQuery.event.remove( this, type, fn ); - }); - }, - - trigger: function( type, data ) { - /// <summary> - /// Triggers a type of event on every matched element. - /// </summary> - /// <param name="type" type="String">One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error .</param> - /// <param name="data" optional="true" type="Array">Additional data passed to the event handler as additional arguments.</param> - /// <param name="fn" type="Function">This parameter is undocumented.</param> - - return this.each(function(){ - jQuery.event.trigger( type, data, this ); - }); - }, - - triggerHandler: function( type, data ) { - /// <summary> - /// Triggers all bound event handlers on an element for a specific event type without executing the browser's default actions. - /// </summary> - /// <param name="type" type="String">One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error .</param> - /// <param name="data" optional="true" type="Array">Additional data passed to the event handler as additional arguments.</param> - /// <param name="fn" type="Function">This parameter is undocumented.</param> - - if( this[0] ){ - var event = jQuery.Event(type); - event.preventDefault(); - event.stopPropagation(); - jQuery.event.trigger( event, data, this[0] ); - return event.result; - } - }, - - toggle: function( fn ) { - /// <summary> - /// Toggles among two or more function calls every other click. - /// </summary> - /// <param name="fn" type="Function">The functions among which to toggle execution</param> - - // Save reference to arguments for access in closure - var args = arguments, i = 1; - - // link all the functions, so any of them can unbind this click handler - while( i < args.length ) - jQuery.event.proxy( fn, args[i++] ); - - return this.click( jQuery.event.proxy( fn, function(event) { - // Figure out which function to execute - this.lastToggle = ( this.lastToggle || 0 ) % i; - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ this.lastToggle++ ].apply( this, arguments ) || false; - })); - }, - - hover: function(fnOver, fnOut) { - /// <summary> - /// Simulates hovering (moving the mouse on or off of an object). - /// </summary> - /// <param name="fnOver" type="Function">The function to fire when the mouse is moved over a matched element.</param> - /// <param name="fnOut" type="Function">The function to fire when the mouse is moved off of a matched element.</param> - - return this.mouseenter(fnOver).mouseleave(fnOut); - }, - - ready: function(fn) { - /// <summary> - /// Binds a function to be executed whenever the DOM is ready to be traversed and manipulated. - /// </summary> - /// <param name="fn" type="Function">The function to be executed when the DOM is ready.</param> - - // Attach the listeners - bindReady(); - - // If the DOM is already ready - if ( jQuery.isReady ) - // Execute the function immediately - fn.call( document, jQuery ); - - // Otherwise, remember the function for later - else - // Add the function to the wait list - jQuery.readyList.push( fn ); - - return this; - }, - - live: function( type, fn ){ - /// <summary> - /// Binds a handler to an event (like click) for all current - and future - matched element. Can also bind custom events. - /// </summary> - /// <param name="type" type="String">An event type</param> - /// <param name="fn" type="Function">A function to bind to the event on each of the set of matched elements</param> - - var proxy = jQuery.event.proxy( fn ); - proxy.guid += this.selector + type; - - jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy ); - - return this; - }, - - die: function( type, fn ){ - /// <summary> - /// This does the opposite of live, it removes a bound live event. - /// You can also unbind custom events registered with live. - /// If the type is provided, all bound live events of that type are removed. - /// If the function that was passed to live is provided as the second argument, only that specific event handler is removed. - /// </summary> - /// <param name="type" type="String">A live event type to unbind.</param> - /// <param name="fn" type="Function">A function to unbind from the event on each of the set of matched elements.</param> - - jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null ); - return this; - } -}); - -function liveHandler( event ){ - var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"), - stop = true, - elems = []; - - jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){ - if ( check.test(fn.type) ) { - var elem = jQuery(event.target).closest(fn.data)[0]; - if ( elem ) - elems.push({ elem: elem, fn: fn }); - } - }); - - elems.sort(function(a,b) { - return jQuery.data(a.elem, "closest") - jQuery.data(b.elem, "closest"); - }); - - jQuery.each(elems, function(){ - if ( this.fn.call(this.elem, event, this.fn.data) === false ) - return (stop = false); - }); - - return stop; -} - -function liveConvert(type, selector){ - return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join("."); -} - -jQuery.extend({ - isReady: false, - readyList: [], - // Handle when the DOM is ready - ready: function() { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - // Make sure that the DOM is not already loaded - if ( !jQuery.isReady ) { - // Remember that the DOM is ready - jQuery.isReady = true; - - // If there are functions bound, to execute - if ( jQuery.readyList ) { - // Execute all of them - jQuery.each( jQuery.readyList, function(){ - this.call( document, jQuery ); - }); - - // Reset the list of functions - jQuery.readyList = null; - } - - // Trigger any bound ready events - jQuery(document).triggerHandler("ready"); - } - } -}); - -var readyBound = false; - -function bindReady(){ - if ( readyBound ) return; - readyBound = true; - - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", function(){ - document.removeEventListener( "DOMContentLoaded", arguments.callee, false ); - jQuery.ready(); - }, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent("onreadystatechange", function(){ - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", arguments.callee ); - jQuery.ready(); - } - }); - - // If IE and not an iframe - // continually check to see if the document is ready - if ( document.documentElement.doScroll && window == window.top ) (function(){ - if ( jQuery.isReady ) return; - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch( error ) { - setTimeout( arguments.callee, 0 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); - })(); - } - - // A fallback to window.onload, that will always work - jQuery.event.add( window, "load", jQuery.ready ); -} - -// [vsdoc] The following section has been denormalized from original sources for IntelliSense. - -jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," + - "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," + - "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){ - - // Handle event binding - jQuery.fn[name] = function(fn){ - return fn ? this.bind(name, fn) : this.trigger(name); - }; -}); - -jQuery.fn["blur"] = function(fn) { - /// <summary> - /// 1: blur() - Triggers the blur event of each matched element. - /// 2: blur(fn) - Binds a function to the blur event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("blur", fn) : this.trigger(name); -}; - -jQuery.fn["focus"] = function(fn) { - /// <summary> - /// 1: focus() - Triggers the focus event of each matched element. - /// 2: focus(fn) - Binds a function to the focus event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("focus", fn) : this.trigger(name); -}; - -jQuery.fn["load"] = function(fn) { - /// <summary> - /// 1: load() - Triggers the load event of each matched element. - /// 2: load(fn) - Binds a function to the load event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("load", fn) : this.trigger(name); -}; - -jQuery.fn["resize"] = function(fn) { - /// <summary> - /// 1: resize() - Triggers the resize event of each matched element. - /// 2: resize(fn) - Binds a function to the resize event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("resize", fn) : this.trigger(name); -}; - -jQuery.fn["scroll"] = function(fn) { - /// <summary> - /// 1: scroll() - Triggers the scroll event of each matched element. - /// 2: scroll(fn) - Binds a function to the scroll event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("scroll", fn) : this.trigger(name); -}; - -jQuery.fn["unload"] = function(fn) { - /// <summary> - /// 1: unload() - Triggers the unload event of each matched element. - /// 2: unload(fn) - Binds a function to the unload event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("unload", fn) : this.trigger(name); -}; - -jQuery.fn["click"] = function(fn) { - /// <summary> - /// 1: click() - Triggers the click event of each matched element. - /// 2: click(fn) - Binds a function to the click event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("click", fn) : this.trigger(name); -}; - -jQuery.fn["dblclick"] = function(fn) { - /// <summary> - /// 1: dblclick() - Triggers the dblclick event of each matched element. - /// 2: dblclick(fn) - Binds a function to the dblclick event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("dblclick", fn) : this.trigger(name); -}; - -jQuery.fn["mousedown"] = function(fn) { - /// <summary> - /// Binds a function to the mousedown event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("mousedown", fn) : this.trigger(name); -}; - -jQuery.fn["mouseup"] = function(fn) { - /// <summary> - /// Bind a function to the mouseup event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("mouseup", fn) : this.trigger(name); -}; - -jQuery.fn["mousemove"] = function(fn) { - /// <summary> - /// Bind a function to the mousemove event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("mousemove", fn) : this.trigger(name); -}; - -jQuery.fn["mouseover"] = function(fn) { - /// <summary> - /// Bind a function to the mouseover event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("mouseover", fn) : this.trigger(name); -}; - -jQuery.fn["mouseout"] = function(fn) { - /// <summary> - /// Bind a function to the mouseout event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("mouseout", fn) : this.trigger(name); -}; - -jQuery.fn["mouseenter"] = function(fn) { - /// <summary> - /// Bind a function to the mouseenter event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("mouseenter", fn) : this.trigger(name); -}; - -jQuery.fn["mouseleave"] = function(fn) { - /// <summary> - /// Bind a function to the mouseleave event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("mouseleave", fn) : this.trigger(name); -}; - -jQuery.fn["change"] = function(fn) { - /// <summary> - /// 1: change() - Triggers the change event of each matched element. - /// 2: change(fn) - Binds a function to the change event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("change", fn) : this.trigger(name); -}; - -jQuery.fn["select"] = function(fn) { - /// <summary> - /// 1: select() - Triggers the select event of each matched element. - /// 2: select(fn) - Binds a function to the select event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("select", fn) : this.trigger(name); -}; - -jQuery.fn["submit"] = function(fn) { - /// <summary> - /// 1: submit() - Triggers the submit event of each matched element. - /// 2: submit(fn) - Binds a function to the submit event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("submit", fn) : this.trigger(name); -}; - -jQuery.fn["keydown"] = function(fn) { - /// <summary> - /// 1: keydown() - Triggers the keydown event of each matched element. - /// 2: keydown(fn) - Binds a function to the keydown event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("keydown", fn) : this.trigger(name); -}; - -jQuery.fn["keypress"] = function(fn) { - /// <summary> - /// 1: keypress() - Triggers the keypress event of each matched element. - /// 2: keypress(fn) - Binds a function to the keypress event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("keypress", fn) : this.trigger(name); -}; - -jQuery.fn["keyup"] = function(fn) { - /// <summary> - /// 1: keyup() - Triggers the keyup event of each matched element. - /// 2: keyup(fn) - Binds a function to the keyup event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("keyup", fn) : this.trigger(name); -}; - -jQuery.fn["error"] = function(fn) { - /// <summary> - /// 1: error() - Triggers the error event of each matched element. - /// 2: error(fn) - Binds a function to the error event of each matched element. - /// </summary> - /// <param name="fn" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return fn ? this.bind("error", fn) : this.trigger(name); -}; - -// Prevent memory leaks in IE -// And prevent errors on refresh with events like mouseover in other browsers -// Window isn't included so as not to unbind existing unload events -jQuery( window ).bind( 'unload', function(){ - for ( var id in jQuery.cache ) - // Skip the window - if ( id != 1 && jQuery.cache[ id ].handle ) - jQuery.event.remove( jQuery.cache[ id ].handle.elem ); -}); - -// [vsdoc] The following function has been commented out for IntelliSense. -//(function(){ - -// jQuery.support = {}; - -// var root = document.documentElement, -// script = document.createElement("script"), -// div = document.createElement("div"), -// id = "script" + (new Date).getTime(); - -// div.style.display = "none"; -// -// div.innerHTML = ' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>'; - -// var all = div.getElementsByTagName("*"), -// a = div.getElementsByTagName("a")[0]; - -// // Can't get basic test support -// if ( !all || !all.length || !a ) { -// return; -// } - -// jQuery.support = { -// // IE strips leading whitespace when .innerHTML is used -// leadingWhitespace: div.firstChild.nodeType == 3, -// -// // Make sure that tbody elements aren't automatically inserted -// // IE will insert them into empty tables -// tbody: !div.getElementsByTagName("tbody").length, -// -// // Make sure that you can get all elements in an <object> element -// // IE 7 always returns no results -// objectAll: !!div.getElementsByTagName("object")[0] -// .getElementsByTagName("*").length, -// -// // Make sure that link elements get serialized correctly by innerHTML -// // This requires a wrapper element in IE -// htmlSerialize: !!div.getElementsByTagName("link").length, -// -// // Get the style information from getAttribute -// // (IE uses .cssText insted) -// style: /red/.test( a.getAttribute("style") ), -// -// // Make sure that URLs aren't manipulated -// // (IE normalizes it by default) -// hrefNormalized: a.getAttribute("href") === "/a", -// -// // Make sure that element opacity exists -// // (IE uses filter instead) -// opacity: a.style.opacity === "0.5", -// -// // Verify style float existence -// // (IE uses styleFloat instead of cssFloat) -// cssFloat: !!a.style.cssFloat, - -// // Will be defined later -// scriptEval: false, -// noCloneEvent: true, -// boxModel: null -// }; -// -// script.type = "text/javascript"; -// try { -// script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); -// } catch(e){} - -// root.insertBefore( script, root.firstChild ); -// -// // Make sure that the execution of code works by injecting a script -// // tag with appendChild/createTextNode -// // (IE doesn't support this, fails, and uses .text instead) -// if ( window[ id ] ) { -// jQuery.support.scriptEval = true; -// delete window[ id ]; -// } - -// root.removeChild( script ); - -// if ( div.attachEvent && div.fireEvent ) { -// div.attachEvent("onclick", function(){ -// // Cloning a node shouldn't copy over any -// // bound event handlers (IE does this) -// jQuery.support.noCloneEvent = false; -// div.detachEvent("onclick", arguments.callee); -// }); -// div.cloneNode(true).fireEvent("onclick"); -// } - -// // Figure out if the W3C box model works as expected -// // document.body must exist before we can do this -// jQuery(function(){ -// var div = document.createElement("div"); -// div.style.width = div.style.paddingLeft = "1px"; - -// document.body.appendChild( div ); -// jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; -// document.body.removeChild( div ).style.display = 'none'; -// }); -//})(); - -// [vsdoc] The following function has been modified for IntelliSense. -// var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat"; -var styleFloat = "cssFloat"; - - -jQuery.props = { - "for": "htmlFor", - "class": "className", - "float": styleFloat, - cssFloat: styleFloat, - styleFloat: styleFloat, - readonly: "readOnly", - maxlength: "maxLength", - cellspacing: "cellSpacing", - rowspan: "rowSpan", - tabindex: "tabIndex" -}; -jQuery.fn.extend({ - // Keep a copy of the old load - _load: jQuery.fn.load, - - load: function( url, params, callback ) { - /// <summary> - /// Loads HTML from a remote file and injects it into the DOM. By default performs a GET request, but if parameters are included - /// then a POST will be performed. - /// </summary> - /// <param name="url" type="String">The URL of the HTML page to load.</param> - /// <param name="data" optional="true" type="Map">Key/value pairs that will be sent to the server.</param> - /// <param name="callback" optional="true" type="Function">The function called when the AJAX request is complete. It should map function(responseText, textStatus, XMLHttpRequest) such that this maps the injected DOM element.</param> - /// <returns type="jQuery" /> - - if ( typeof url !== "string" ) - return this._load( url ); - - var off = url.indexOf(" "); - if ( off >= 0 ) { - var selector = url.slice(off, url.length); - url = url.slice(0, off); - } - - // Default to a GET request - var type = "GET"; - - // If the second parameter was provided - if ( params ) - // If it's a function - if ( jQuery.isFunction( params ) ) { - // We assume that it's the callback - callback = params; - params = null; - - // Otherwise, build a param string - } else if( typeof params === "object" ) { - params = jQuery.param( params ); - type = "POST"; - } - - var self = this; - - // Request the remote document - jQuery.ajax({ - url: url, - type: type, - dataType: "html", - data: params, - complete: function(res, status){ - // If successful, inject the HTML into all the matched elements - if ( status == "success" || status == "notmodified" ) - // See if a selector was specified - self.html( selector ? - // Create a dummy div to hold the results - jQuery("<div/>") - // inject the contents of the document in, removing the scripts - // to avoid any 'Permission Denied' errors in IE - .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, "")) - - // Locate the specified elements - .find(selector) : - - // If not, just inject the full result - res.responseText ); - - if( callback ) - self.each( callback, [res.responseText, status, res] ); - } - }); - return this; - }, - - serialize: function() { - /// <summary> - /// Serializes a set of input elements into a string of data. - /// </summary> - /// <returns type="String">The serialized result</returns> - - return jQuery.param(this.serializeArray()); - }, - serializeArray: function() { - /// <summary> - /// Serializes all forms and form elements but returns a JSON data structure. - /// </summary> - /// <returns type="String">A JSON data structure representing the serialized items.</returns> - - return this.map(function(){ - return this.elements ? jQuery.makeArray(this.elements) : this; - }) - .filter(function(){ - return this.name && !this.disabled && - (this.checked || /select|textarea/i.test(this.nodeName) || - /text|hidden|password|search/i.test(this.type)); - }) - .map(function(i, elem){ - var val = jQuery(this).val(); - return val == null ? null : - jQuery.isArray(val) ? - jQuery.map( val, function(val, i){ - return {name: elem.name, value: val}; - }) : - {name: elem.name, value: val}; - }).get(); - } -}); - -// [vsdoc] The following section has been denormalized from original sources for IntelliSense. -// Attach a bunch of functions for handling common AJAX events -// jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){ -// jQuery.fn[o] = function(f){ -// return this.bind(o, f); -// }; -// }); - -jQuery.fn["ajaxStart"] = function(callback) { - /// <summary> - /// Attach a function to be executed whenever an AJAX request begins and there is none already active. This is an Ajax Event. - /// </summary> - /// <param name="callback" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return this.bind("ajaxStart", f); -}; - -jQuery.fn["ajaxStop"] = function(callback) { - /// <summary> - /// Attach a function to be executed whenever all AJAX requests have ended. This is an Ajax Event. - /// </summary> - /// <param name="callback" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return this.bind("ajaxStop", f); -}; - -jQuery.fn["ajaxComplete"] = function(callback) { - /// <summary> - /// Attach a function to be executed whenever an AJAX request completes. This is an Ajax Event. - /// </summary> - /// <param name="callback" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return this.bind("ajaxComplete", f); -}; - -jQuery.fn["ajaxError"] = function(callback) { - /// <summary> - /// Attach a function to be executed whenever an AJAX request fails. This is an Ajax Event. - /// </summary> - /// <param name="callback" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return this.bind("ajaxError", f); -}; - -jQuery.fn["ajaxSuccess"] = function(callback) { - /// <summary> - /// Attach a function to be executed whenever an AJAX request completes successfully. This is an Ajax Event. - /// </summary> - /// <param name="callback" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return this.bind("ajaxSuccess", f); -}; - -jQuery.fn["ajaxSend"] = function(callback) { - /// <summary> - /// Attach a function to be executed before an AJAX request is sent. This is an Ajax Event. - /// </summary> - /// <param name="callback" type="Function">The function to execute.</param> - /// <returns type="jQuery" /> - return this.bind("ajaxSend", f); -}; - - -var jsc = now(); - -jQuery.extend({ - - get: function( url, data, callback, type ) { - /// <summary> - /// Loads a remote page using an HTTP GET request. - /// </summary> - /// <param name="url" type="String">The URL of the HTML page to load.</param> - /// <param name="data" optional="true" type="Map">Key/value pairs that will be sent to the server.</param> - /// <param name="callback" optional="true" type="Function">The function called when the AJAX request is complete. It should map function(responseText, textStatus) such that this maps the options for this AJAX request.</param> - /// <param name="type" optional="true" type="String">Type of data to be returned to callback function. Valid valiues are xml, html, script, json, text, _default.</param> - /// <returns type="XMLHttpRequest" /> - - // shift arguments if data argument was ommited - if ( jQuery.isFunction( data ) ) { - callback = data; - data = null; - } - - return jQuery.ajax({ - type: "GET", - url: url, - data: data, - success: callback, - dataType: type - }); - }, - - getScript: function( url, callback ) { - /// <summary> - /// Loads and executes a local JavaScript file using an HTTP GET request. - /// </summary> - /// <param name="url" type="String">The URL of the script to load.</param> - /// <param name="callback" optional="true" type="Function">The function called when the AJAX request is complete. It should map function(data, textStatus) such that this maps the options for the AJAX request.</param> - /// <returns type="XMLHttpRequest" /> - - return jQuery.get(url, null, callback, "script"); - }, - - getJSON: function( url, data, callback ) { - /// <summary> - /// Loads JSON data using an HTTP GET request. - /// </summary> - /// <param name="url" type="String">The URL of the JSON data to load.</param> - /// <param name="data" optional="true" type="Map">Key/value pairs that will be sent to the server.</param> - /// <param name="callback" optional="true" type="Function">The function called when the AJAX request is complete if the data is loaded successfully. It should map function(data, textStatus) such that this maps the options for this AJAX request.</param> - /// <returns type="XMLHttpRequest" /> - - return jQuery.get(url, data, callback, "json"); - }, - - post: function( url, data, callback, type ) { - /// <summary> - /// Loads a remote page using an HTTP POST request. - /// </summary> - /// <param name="url" type="String">The URL of the HTML page to load.</param> - /// <param name="data" optional="true" type="Map">Key/value pairs that will be sent to the server.</param> - /// <param name="callback" optional="true" type="Function">The function called when the AJAX request is complete. It should map function(responseText, textStatus) such that this maps the options for this AJAX request.</param> - /// <param name="type" optional="true" type="String">Type of data to be returned to callback function. Valid valiues are xml, html, script, json, text, _default.</param> - /// <returns type="XMLHttpRequest" /> - - if ( jQuery.isFunction( data ) ) { - callback = data; - data = {}; - } - - return jQuery.ajax({ - type: "POST", - url: url, - data: data, - success: callback, - dataType: type - }); - }, - - ajaxSetup: function( settings ) { - /// <summary> - /// Sets up global settings for AJAX requests. - /// </summary> - /// <param name="settings" type="Options">A set of key/value pairs that configure the default Ajax request.</param> - - jQuery.extend( jQuery.ajaxSettings, settings ); - }, - - ajaxSettings: { - url: location.href, - global: true, - type: "GET", - contentType: "application/x-www-form-urlencoded", - processData: true, - async: true, - /* - timeout: 0, - data: null, - username: null, - password: null, - */ - // Create the request object; Microsoft failed to properly - // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available - // This function can be overriden by calling jQuery.ajaxSetup - xhr:function(){ - return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); - }, - accepts: { - xml: "application/xml, text/xml", - html: "text/html", - script: "text/javascript, application/javascript", - json: "application/json, text/javascript", - text: "text/plain", - _default: "*/*" - } - }, - - // Last-Modified header cache for next request - lastModified: {}, - - ajax: function( s ) { - /// <summary> - /// Load a remote page using an HTTP request. - /// </summary> - /// <private /> - - // Extend the settings, but re-extend 's' so that it can be - // checked again later (in the test suite, specifically) - s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s)); - - var jsonp, jsre = /=\?(&|$)/g, status, data, - type = s.type.toUpperCase(); - - // convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) - s.data = jQuery.param(s.data); - - // Handle JSONP Parameter Callbacks - if ( s.dataType == "jsonp" ) { - if ( type == "GET" ) { - if ( !s.url.match(jsre) ) - s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?"; - } else if ( !s.data || !s.data.match(jsre) ) - s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?"; - s.dataType = "json"; - } - - // Build temporary JSONP function - if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) { - jsonp = "jsonp" + jsc++; - - // Replace the =? sequence both in the query string and the data - if ( s.data ) - s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1"); - s.url = s.url.replace(jsre, "=" + jsonp + "$1"); - - // We need to make sure - // that a JSONP style response is executed properly - s.dataType = "script"; - - // Handle JSONP-style loading - window[ jsonp ] = function(tmp){ - data = tmp; - success(); - complete(); - // Garbage collect - window[ jsonp ] = undefined; - try{ delete window[ jsonp ]; } catch(e){} - if ( head ) - head.removeChild( script ); - }; - } - - if ( s.dataType == "script" && s.cache == null ) - s.cache = false; - - if ( s.cache === false && type == "GET" ) { - var ts = now(); - // try replacing _= if it is there - var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2"); - // if nothing was replaced, add timestamp to the end - s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : ""); - } - - // If data is available, append data to url for get requests - if ( s.data && type == "GET" ) { - s.url += (s.url.match(/\?/) ? "&" : "?") + s.data; - - // IE likes to send both get and post data, prevent this - s.data = null; - } - - // Watch for a new set of requests - if ( s.global && ! jQuery.active++ ) - jQuery.event.trigger( "ajaxStart" ); - - // Matches an absolute URL, and saves the domain - var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url ); - - // If we're requesting a remote document - // and trying to load JSON or Script with a GET - if ( s.dataType == "script" && type == "GET" && parts - && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){ - - var head = document.getElementsByTagName("head")[0]; - var script = document.createElement("script"); - script.src = s.url; - if (s.scriptCharset) - script.charset = s.scriptCharset; - - // Handle Script loading - if ( !jsonp ) { - var done = false; - - // Attach handlers for all browsers - script.onload = script.onreadystatechange = function(){ - if ( !done && (!this.readyState || - this.readyState == "loaded" || this.readyState == "complete") ) { - done = true; - success(); - complete(); - - // Handle memory leak in IE - script.onload = script.onreadystatechange = null; - head.removeChild( script ); - } - }; - } - - head.appendChild(script); - - // We handle everything using the script element injection - return undefined; - } - - var requestDone = false; - - // Create the request object - var xhr = s.xhr(); - - // Open the socket - // Passing null username, generates a login popup on Opera (#2865) - if( s.username ) - xhr.open(type, s.url, s.async, s.username, s.password); - else - xhr.open(type, s.url, s.async); - - // Need an extra try/catch for cross domain requests in Firefox 3 - try { - // Set the correct header, if data is being sent - if ( s.data ) - xhr.setRequestHeader("Content-Type", s.contentType); - - // Set the If-Modified-Since header, if ifModified mode. - if ( s.ifModified ) - xhr.setRequestHeader("If-Modified-Since", - jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" ); - - // Set header so the called script knows that it's an XMLHttpRequest - xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - - // Set the Accepts header for the server, depending on the dataType - xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ? - s.accepts[ s.dataType ] + ", */*" : - s.accepts._default ); - } catch(e){} - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && s.beforeSend(xhr, s) === false ) { - // Handle the global AJAX counter - if ( s.global && ! --jQuery.active ) - jQuery.event.trigger( "ajaxStop" ); - // close opended socket - xhr.abort(); - return false; - } - - if ( s.global ) - jQuery.event.trigger("ajaxSend", [xhr, s]); - - // Wait for a response to come back - var onreadystatechange = function(isTimeout){ - // The request was aborted, clear the interval and decrement jQuery.active - if (xhr.readyState == 0) { - if (ival) { - // clear poll interval - clearInterval(ival); - ival = null; - // Handle the global AJAX counter - if ( s.global && ! --jQuery.active ) - jQuery.event.trigger( "ajaxStop" ); - } - // The transfer is complete and the data is available, or the request timed out - } else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) { - requestDone = true; - - // clear poll interval - if (ival) { - clearInterval(ival); - ival = null; - } - - status = isTimeout == "timeout" ? "timeout" : - !jQuery.httpSuccess( xhr ) ? "error" : - s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" : - "success"; - - if ( status == "success" ) { - // Watch for, and catch, XML document parse errors - try { - // process the data (runs the xml through httpData regardless of callback) - data = jQuery.httpData( xhr, s.dataType, s ); - } catch(e) { - status = "parsererror"; - } - } - - // Make sure that the request was successful or notmodified - if ( status == "success" ) { - // Cache Last-Modified header, if ifModified mode. - var modRes; - try { - modRes = xhr.getResponseHeader("Last-Modified"); - } catch(e) {} // swallow exception thrown by FF if header is not available - - if ( s.ifModified && modRes ) - jQuery.lastModified[s.url] = modRes; - - // JSONP handles its own success callback - if ( !jsonp ) - success(); - } else - jQuery.handleError(s, xhr, status); - - // Fire the complete handlers - complete(); - - if ( isTimeout ) - xhr.abort(); - - // Stop memory leaks - if ( s.async ) - xhr = null; - } - }; - - if ( s.async ) { - // don't attach the handler to the request, just poll it instead - var ival = setInterval(onreadystatechange, 13); - - // Timeout checker - if ( s.timeout > 0 ) - setTimeout(function(){ - // Check to see if the request is still happening - if ( xhr && !requestDone ) - onreadystatechange( "timeout" ); - }, s.timeout); - } - - // Send the data - try { - xhr.send(s.data); - } catch(e) { - jQuery.handleError(s, xhr, null, e); - } - - // firefox 1.5 doesn't fire statechange for sync requests - if ( !s.async ) - onreadystatechange(); - - function success(){ - // If a local callback was specified, fire it and pass it the data - if ( s.success ) - s.success( data, status ); - - // Fire the global callback - if ( s.global ) - jQuery.event.trigger( "ajaxSuccess", [xhr, s] ); - } - - function complete(){ - // Process result - if ( s.complete ) - s.complete(xhr, status); - - // The request was completed - if ( s.global ) - jQuery.event.trigger( "ajaxComplete", [xhr, s] ); - - // Handle the global AJAX counter - if ( s.global && ! --jQuery.active ) - jQuery.event.trigger( "ajaxStop" ); - } - - // return XMLHttpRequest to allow aborting the request etc. - return xhr; - }, - - handleError: function( s, xhr, status, e ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - // If a local callback was specified, fire it - if ( s.error ) s.error( xhr, status, e ); - - // Fire the global callback - if ( s.global ) - jQuery.event.trigger( "ajaxError", [xhr, s, e] ); - }, - - // Counter for holding the number of active queries - active: 0, - - // Determines if an XMLHttpRequest was successful or not - httpSuccess: function( xhr ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - try { - // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450 - return !xhr.status && location.protocol == "file:" || - ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223; - } catch(e){} - return false; - }, - - // Determines if an XMLHttpRequest returns NotModified - httpNotModified: function( xhr, url ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - try { - var xhrRes = xhr.getResponseHeader("Last-Modified"); - - // Firefox always returns 200. check Last-Modified date - return xhr.status == 304 || xhrRes == jQuery.lastModified[url]; - } catch(e){} - return false; - }, - - httpData: function( xhr, type, s ) { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - - var ct = xhr.getResponseHeader("content-type"), - xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0, - data = xml ? xhr.responseXML : xhr.responseText; - - if ( xml && data.documentElement.tagName == "parsererror" ) - throw "parsererror"; - - // Allow a pre-filtering function to sanitize the response - // s != null is checked to keep backwards compatibility - if( s && s.dataFilter ) - data = s.dataFilter( data, type ); - - // The filter can actually parse the response - if( typeof data === "string" ){ - - // If the type is "script", eval it in global context - if ( type == "script" ) - jQuery.globalEval( data ); - - // Get the JavaScript object, if JSON is used. - if ( type == "json" ) - data = window["eval"]("(" + data + ")"); - } - - return data; - }, - - // Serialize an array of form elements or a set of - // key/values into a query string - param: function( a ) { - /// <summary> - /// This method is internal. Use serialize() instead. - /// </summary> - /// <param name="a" type="Map">A map of key/value pairs to serialize into a string.</param>' - /// <returns type="String" /> - /// <private /> - - var s = [ ]; - - function add( key, value ){ - s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value); - }; - - // If an array was passed in, assume that it is an array - // of form elements - if ( jQuery.isArray(a) || a.jquery ) - // Serialize the form elements - jQuery.each( a, function(){ - add( this.name, this.value ); - }); - - // Otherwise, assume that it's an object of key/value pairs - else - // Serialize the key/values - for ( var j in a ) - // If the value is an array then the key names need to be repeated - if ( jQuery.isArray(a[j]) ) - jQuery.each( a[j], function(){ - add( j, this ); - }); - else - add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] ); - - // Return the resulting serialization - return s.join("&").replace(/%20/g, "+"); - } - -}); -var elemdisplay = {}, - timerId, - fxAttrs = [ - // height animations - [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], - // width animations - [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], - // opacity animations - [ "opacity" ] - ]; - -function genFx( type, num ){ - var obj = {}; - jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){ - obj[ this ] = type; - }); - return obj; -} - -jQuery.fn.extend({ - show: function(speed,callback){ - /// <summary> - /// Show all matched elements using a graceful animation and firing an optional callback after completion. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - - if ( speed ) { - return this.animate( genFx("show", 3), speed, callback); - } else { - for ( var i = 0, l = this.length; i < l; i++ ){ - var old = jQuery.data(this[i], "olddisplay"); - - this[i].style.display = old || ""; - - if ( jQuery.css(this[i], "display") === "none" ) { - var tagName = this[i].tagName, display; - - if ( elemdisplay[ tagName ] ) { - display = elemdisplay[ tagName ]; - } else { - var elem = jQuery("<" + tagName + " />").appendTo("body"); - - display = elem.css("display"); - if ( display === "none" ) - display = "block"; - - elem.remove(); - - elemdisplay[ tagName ] = display; - } - - jQuery.data(this[i], "olddisplay", display); - } - } - - // Set the display of the elements in a second loop - // to avoid the constant reflow - for ( var i = 0, l = this.length; i < l; i++ ){ - this[i].style.display = jQuery.data(this[i], "olddisplay") || ""; - } - - return this; - } - }, - - hide: function(speed,callback){ - /// <summary> - /// Hides all matched elements using a graceful animation and firing an optional callback after completion. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - - if ( speed ) { - return this.animate( genFx("hide", 3), speed, callback); - } else { - for ( var i = 0, l = this.length; i < l; i++ ){ - var old = jQuery.data(this[i], "olddisplay"); - if ( !old && old !== "none" ) - jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display")); - } - - // Set the display of the elements in a second loop - // to avoid the constant reflow - for ( var i = 0, l = this.length; i < l; i++ ){ - this[i].style.display = "none"; - } - - return this; - } - }, - - // Save the old toggle function - _toggle: jQuery.fn.toggle, - - toggle: function( fn, fn2 ){ - /// <summary> - /// Toggles displaying each of the set of matched elements. - /// </summary> - /// <returns type="jQuery" /> - - var bool = typeof fn === "boolean"; - - return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? - this._toggle.apply( this, arguments ) : - fn == null || bool ? - this.each(function(){ - var state = bool ? fn : jQuery(this).is(":hidden"); - jQuery(this)[ state ? "show" : "hide" ](); - }) : - this.animate(genFx("toggle", 3), fn, fn2); - }, - - fadeTo: function(speed,to,callback){ - /// <summary> - /// Fades the opacity of all matched elements to a specified opacity. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - return this.animate({opacity: to}, speed, callback); - }, - - animate: function( prop, speed, easing, callback ) { - /// <summary> - /// A function for making custom animations. - /// </summary> - /// <param name="prop" type="Options">A set of style attributes that you wish to animate and to what end.</param> - /// <param name="speed" optional="true" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="easing" optional="true" type="String">The name of the easing effect that you want to use. There are two built-in values, 'linear' and 'swing'.</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - - var optall = jQuery.speed(speed, easing, callback); - - return this[ optall.queue === false ? "each" : "queue" ](function(){ - - var opt = jQuery.extend({}, optall), p, - hidden = this.nodeType == 1 && jQuery(this).is(":hidden"), - self = this; - - for ( p in prop ) { - if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden ) - return opt.complete.call(this); - - if ( ( p == "height" || p == "width" ) && this.style ) { - // Store display property - opt.display = jQuery.css(this, "display"); - - // Make sure that nothing sneaks out - opt.overflow = this.style.overflow; - } - } - - if ( opt.overflow != null ) - this.style.overflow = "hidden"; - - opt.curAnim = jQuery.extend({}, prop); - - jQuery.each( prop, function(name, val){ - var e = new jQuery.fx( self, opt, name ); - - if ( /toggle|show|hide/.test(val) ) - e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop ); - else { - var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/), - start = e.cur(true) || 0; - - if ( parts ) { - var end = parseFloat(parts[2]), - unit = parts[3] || "px"; - - // We need to compute starting value - if ( unit != "px" ) { - self.style[ name ] = (end || 1) + unit; - start = ((end || 1) / e.cur(true)) * start; - self.style[ name ] = start + unit; - } - - // If a +=/-= token was provided, we're doing a relative animation - if ( parts[1] ) - end = ((parts[1] == "-=" ? -1 : 1) * end) + start; - - e.custom( start, end, unit ); - } else - e.custom( start, val, "" ); - } - }); - - // For JS strict compliance - return true; - }); - }, - - stop: function(clearQueue, gotoEnd){ - /// <summary> - /// Stops all currently animations on the specified elements. - /// </summary> - /// <param name="clearQueue" optional="true" type="Boolean">True to clear animations that are queued to run.</param> - /// <param name="gotoEnd" optional="true" type="Boolean">True to move the element value to the end of its animation target.</param> - /// <returns type="jQuery" /> - - var timers = jQuery.timers; - - if (clearQueue) - this.queue([]); - - this.each(function(){ - // go in reverse order so anything added to the queue during the loop is ignored - for ( var i = timers.length - 1; i >= 0; i-- ) - if ( timers[i].elem == this ) { - if (gotoEnd) - // force the next step to be the last - timers[i](true); - timers.splice(i, 1); - } - }); - - // start the next in the queue if the last step wasn't forced - if (!gotoEnd) - this.dequeue(); - - return this; - } - -}); - -// Generate shortcuts for custom animations -// jQuery.each({ -// slideDown: genFx("show", 1), -// slideUp: genFx("hide", 1), -// slideToggle: genFx("toggle", 1), -// fadeIn: { opacity: "show" }, -// fadeOut: { opacity: "hide" } -// }, function( name, props ){ -// jQuery.fn[ name ] = function( speed, callback ){ -// return this.animate( props, speed, callback ); -// }; -// }); - -// [vsdoc] The following section has been denormalized from original sources for IntelliSense. - -jQuery.fn.slideDown = function( speed, callback ){ - /// <summary> - /// Reveal all matched elements by adjusting their height. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - return this.animate( genFx("show", 1), speed, callback ); -}; - -jQuery.fn.slideUp = function( speed, callback ){ - /// <summary> - /// Hiding all matched elements by adjusting their height. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - return this.animate( genFx("hide", 1), speed, callback ); -}; - -jQuery.fn.slideToggle = function( speed, callback ){ - /// <summary> - /// Toggles the visibility of all matched elements by adjusting their height. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - return this.animate( genFx("toggle", 1), speed, callback ); -}; - -jQuery.fn.fadeIn = function( speed, callback ){ - /// <summary> - /// Fades in all matched elements by adjusting their opacity. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - return this.animate( { opacity: "show" }, speed, callback ); -}; - -jQuery.fn.fadeOut = function( speed, callback ){ - /// <summary> - /// Fades the opacity of all matched elements to a specified opacity. - /// </summary> - /// <param name="speed" type="String">A string representing one of three predefined speeds ('slow', 'normal', or 'fast'), or - /// the number of milliseconds to run the animation</param> - /// <param name="callback" optional="true" type="Function">A function to be executed whenever the animation completes, once for each animated element. It should map function callback() such that this is the DOM element being animated.</param> - /// <returns type="jQuery" /> - return this.animate( { opacity: "hide" }, speed, callback ); -}; - -jQuery.extend({ - - speed: function(speed, easing, fn) { - /// <summary> - /// This member is internal. - /// </summary> - /// <private /> - var opt = typeof speed === "object" ? speed : { - complete: fn || !fn && easing || - jQuery.isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !jQuery.isFunction(easing) && easing - }; - - opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : - jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default; - - // Queueing - opt.old = opt.complete; - opt.complete = function(){ - if ( opt.queue !== false ) - jQuery(this).dequeue(); - if ( jQuery.isFunction( opt.old ) ) - opt.old.call( this ); - }; - - return opt; - }, - - easing: { - linear: function( p, n, firstNum, diff ) { - /// <summary> - /// This member is internal. - /// </summary> - /// <private /> - return firstNum + diff * p; - }, - swing: function( p, n, firstNum, diff ) { - /// <summary> - /// This member is internal. - /// </summary> - /// <private /> - return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; - } - }, - - timers: [], - - fx: function( elem, options, prop ){ - /// <summary> - /// This member is internal. - /// </summary> - /// <private /> - this.options = options; - this.elem = elem; - this.prop = prop; - - if ( !options.orig ) - options.orig = {}; - } - -}); - -jQuery.fx.prototype = { - - // Simple function for setting a style value - update: function(){ - /// <summary> - /// This member is internal. - /// </summary> - /// <private /> - if ( this.options.step ) - this.options.step.call( this.elem, this.now, this ); - - (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); - - // Set display property to block for height/width animations - if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style ) - this.elem.style.display = "block"; - }, - - // Get the current size - cur: function(force){ - /// <summary> - /// This member is internal. - /// </summary> - /// <private /> - if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) - return this.elem[ this.prop ]; - - var r = parseFloat(jQuery.css(this.elem, this.prop, force)); - return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0; - }, - - // Start an animation from one number to another - custom: function(from, to, unit){ - this.startTime = now(); - this.start = from; - this.end = to; - this.unit = unit || this.unit || "px"; - this.now = this.start; - this.pos = this.state = 0; - - var self = this; - function t(gotoEnd){ - return self.step(gotoEnd); - } - - t.elem = this.elem; - - if ( t() && jQuery.timers.push(t) && !timerId ) { - timerId = setInterval(function(){ - var timers = jQuery.timers; - - for ( var i = 0; i < timers.length; i++ ) - if ( !timers[i]() ) - timers.splice(i--, 1); - - if ( !timers.length ) { - clearInterval( timerId ); - timerId = undefined; - } - }, 13); - } - }, - - // Simple 'show' function - show: function(){ - /// <summary> - /// Displays each of the set of matched elements if they are hidden. - /// </summary> - // Remember where we started, so that we can go back to it later - this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); - this.options.show = true; - - // Begin the animation - // Make sure that we start at a small width/height to avoid any - // flash of content - this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur()); - - // Start by showing the element - jQuery(this.elem).show(); - }, - - // Simple 'hide' function - hide: function(){ - /// <summary> - /// Hides each of the set of matched elements if they are shown. - /// </summary> - - // Remember where we started, so that we can go back to it later - this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); - this.options.hide = true; - - // Begin the animation - this.custom(this.cur(), 0); - }, - - // Each step of an animation - step: function(gotoEnd){ - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - var t = now(); - - if ( gotoEnd || t >= this.options.duration + this.startTime ) { - this.now = this.end; - this.pos = this.state = 1; - this.update(); - - this.options.curAnim[ this.prop ] = true; - - var done = true; - for ( var i in this.options.curAnim ) - if ( this.options.curAnim[i] !== true ) - done = false; - - if ( done ) { - if ( this.options.display != null ) { - // Reset the overflow - this.elem.style.overflow = this.options.overflow; - - // Reset the display - this.elem.style.display = this.options.display; - if ( jQuery.css(this.elem, "display") == "none" ) - this.elem.style.display = "block"; - } - - // Hide the element if the "hide" operation was done - if ( this.options.hide ) - jQuery(this.elem).hide(); - - // Reset the properties, if the item has been hidden or shown - if ( this.options.hide || this.options.show ) - for ( var p in this.options.curAnim ) - jQuery.attr(this.elem.style, p, this.options.orig[p]); - - // Execute the complete function - this.options.complete.call( this.elem ); - } - - return false; - } else { - var n = t - this.startTime; - this.state = n / this.options.duration; - - // Perform the easing function, defaults to swing - this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration); - this.now = this.start + ((this.end - this.start) * this.pos); - - // Perform the next step of the animation - this.update(); - } - - return true; - } - -}; - -jQuery.extend( jQuery.fx, { - speeds:{ - slow: 600, - fast: 200, - // Default speed - _default: 400 - }, - step: { - - opacity: function(fx){ - jQuery.attr(fx.elem.style, "opacity", fx.now); - }, - - _default: function(fx){ - if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) - fx.elem.style[ fx.prop ] = fx.now + fx.unit; - else - fx.elem[ fx.prop ] = fx.now; - } - } -}); -if ( document.documentElement["getBoundingClientRect"] ) - jQuery.fn.offset = function() { - /// <summary> - /// Gets the current offset of the first matched element relative to the viewport. - /// </summary> - /// <returns type="Object">An object with two Integer properties, 'top' and 'left'.</returns> - if ( !this[0] ) return { top: 0, left: 0 }; - if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] ); - var box = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement, - clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, - top = box.top + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop, - left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft; - return { top: top, left: left }; - }; -else - jQuery.fn.offset = function() { - /// <summary> - /// Gets the current offset of the first matched element relative to the viewport. - /// </summary> - /// <returns type="Object">An object with two Integer properties, 'top' and 'left'.</returns> - if ( !this[0] ) return { top: 0, left: 0 }; - if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] ); - jQuery.offset.initialized || jQuery.offset.initialize(); - - var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem, - doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement, - body = doc.body, defaultView = doc.defaultView, - prevComputedStyle = defaultView.getComputedStyle(elem, null), - top = elem.offsetTop, left = elem.offsetLeft; - - while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { - computedStyle = defaultView.getComputedStyle(elem, null); - top -= elem.scrollTop, left -= elem.scrollLeft; - if ( elem === offsetParent ) { - top += elem.offsetTop, left += elem.offsetLeft; - if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) ) - top += parseInt( computedStyle.borderTopWidth, 10) || 0, - left += parseInt( computedStyle.borderLeftWidth, 10) || 0; - prevOffsetParent = offsetParent, offsetParent = elem.offsetParent; - } - if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) - top += parseInt( computedStyle.borderTopWidth, 10) || 0, - left += parseInt( computedStyle.borderLeftWidth, 10) || 0; - prevComputedStyle = computedStyle; - } - - if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) - top += body.offsetTop, - left += body.offsetLeft; - - if ( prevComputedStyle.position === "fixed" ) - top += Math.max(docElem.scrollTop, body.scrollTop), - left += Math.max(docElem.scrollLeft, body.scrollLeft); - - return { top: top, left: left }; - }; - -jQuery.offset = { - initialize: function() { - if ( this.initialized ) return; - var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop, - html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"cellpadding="0"cellspacing="0"><tr><td></td></tr></table>'; - - rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' }; - for ( prop in rules ) container.style[prop] = rules[prop]; - - container.innerHTML = html; - body.insertBefore(container, body.firstChild); - innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild; - - this.doesNotAddBorder = (checkDiv.offsetTop !== 5); - this.doesAddBorderForTableAndCells = (td.offsetTop === 5); - - innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative'; - this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); - - body.style.marginTop = '1px'; - this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0); - body.style.marginTop = bodyMarginTop; - - body.removeChild(container); - this.initialized = true; - }, - - bodyOffset: function(body) { - jQuery.offset.initialized || jQuery.offset.initialize(); - var top = body.offsetTop, left = body.offsetLeft; - if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) - top += parseInt( jQuery.curCSS(body, 'marginTop', true), 10 ) || 0, - left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0; - return { top: top, left: left }; - } -}; - - -jQuery.fn.extend({ - position: function() { - /// <summary> - /// Gets the top and left positions of an element relative to its offset parent. - /// </summary> - /// <returns type="Object">An object with two integer properties, 'top' and 'left'.</returns> - var left = 0, top = 0, results; - - if ( this[0] ) { - // Get *real* offsetParent - var offsetParent = this.offsetParent(), - - // Get correct offsets - offset = this.offset(), - parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset(); - - // Subtract element margins - // note: when an element has margin: auto the offsetLeft and marginLeft - // are the same in Safari causing offset.left to incorrectly be 0 - offset.top -= num( this, 'marginTop' ); - offset.left -= num( this, 'marginLeft' ); - - // Add offsetParent borders - parentOffset.top += num( offsetParent, 'borderTopWidth' ); - parentOffset.left += num( offsetParent, 'borderLeftWidth' ); - - // Subtract the two offsets - results = { - top: offset.top - parentOffset.top, - left: offset.left - parentOffset.left - }; - } - - return results; - }, - - offsetParent: function() { - /// <summary> - /// This method is internal. - /// </summary> - /// <private /> - var offsetParent = this[0].offsetParent || document.body; - while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') ) - offsetParent = offsetParent.offsetParent; - return jQuery(offsetParent); - } -}); - - -// Create scrollLeft and scrollTop methods -jQuery.each( ['Left'], function(i, name) { - var method = 'scroll' + name; - - jQuery.fn[ method ] = function(val) { - /// <summary> - /// Gets and optionally sets the scroll left offset of the first matched element. - /// </summary> - /// <param name="val" type="Number" integer="true" optional="true">A positive number representing the desired scroll left offset.</param> - /// <returns type="Number" integer="true">The scroll left offset of the first matched element.</returns> - if (!this[0]) return null; - - return val !== undefined ? - - // Set the scroll offset - this.each(function() { - this == window || this == document ? - window.scrollTo( - !i ? val : jQuery(window).scrollLeft(), - i ? val : jQuery(window).scrollTop() - ) : - this[ method ] = val; - }) : - - // Return the scroll offset - this[0] == window || this[0] == document ? - self[ i ? 'pageYOffset' : 'pageXOffset' ] || - jQuery.boxModel && document.documentElement[ method ] || - document.body[ method ] : - this[0][ method ]; - }; -}); - -// Create scrollLeft and scrollTop methods -jQuery.each( ['Top'], function(i, name) { - var method = 'scroll' + name; - - jQuery.fn[ method ] = function(val) { - /// <summary> - /// Gets and optionally sets the scroll top offset of the first matched element. - /// </summary> - /// <param name="val" type="Number" integer="true" optional="true">A positive number representing the desired scroll top offset.</param> - /// <returns type="Number" integer="true">The scroll top offset of the first matched element.</returns> - if (!this[0]) return null; - - return val !== undefined ? - - // Set the scroll offset - this.each(function() { - this == window || this == document ? - window.scrollTo( - !i ? val : jQuery(window).scrollLeft(), - i ? val : jQuery(window).scrollTop() - ) : - this[ method ] = val; - }) : - - // Return the scroll offset - this[0] == window || this[0] == document ? - self[ i ? 'pageYOffset' : 'pageXOffset' ] || - jQuery.boxModel && document.documentElement[ method ] || - document.body[ method ] : - this[0][ method ]; - }; -}); - -// Create innerHeight, innerWidth, outerHeight and outerWidth methods -jQuery.each([ "Height" ], function(i, name){ - - var tl = i ? "Left" : "Top", // top or left - br = i ? "Right" : "Bottom", // bottom or right - lower = name.toLowerCase(); - - // innerHeight and innerWidth - jQuery.fn["inner" + name] = function(){ - /// <summary> - /// Gets the inner height of the first matched element, excluding border but including padding. - /// </summary> - /// <returns type="Number" integer="true">The outer height of the first matched element.</returns> - return this[0] ? - jQuery.css( this[0], lower, false, "padding" ) : - null; - }; - - // outerHeight and outerWidth - jQuery.fn["outer" + name] = function(margin) { - /// <summary> - /// Gets the outer height of the first matched element, including border and padding by default. - /// </summary> - /// <param name="margins" type="Map">A set of key/value pairs that specify the options for the method.</param> - /// <returns type="Number" integer="true">The outer height of the first matched element.</returns> - return this[0] ? - jQuery.css( this[0], lower, false, margin ? "margin" : "border" ) : - null; - }; - - var type = name.toLowerCase(); - - jQuery.fn[ type ] = function( size ) { - /// <summary> - /// Set the CSS height of every matched element. If no explicit unit - /// was specified (like 'em' or '%') then "px" is added to the width. If no parameter is specified, it gets - /// the current computed pixel height of the first matched element. - /// Part of CSS - /// </summary> - /// <returns type="jQuery" type="jQuery" /> - /// <param name="cssProperty" type="String"> - /// Set the CSS property to the specified value. Omit to get the value of the first matched element. - /// </param> - - // Get window width or height - return this[0] == window ? - // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode - document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || - document.body[ "client" + name ] : - - // Get document width or height - this[0] == document ? - // Either scroll[Width/Height] or offset[Width/Height], whichever is greater - Math.max( - document.documentElement["client" + name], - document.body["scroll" + name], document.documentElement["scroll" + name], - document.body["offset" + name], document.documentElement["offset" + name] - ) : - - // Get or set width or height on the element - size === undefined ? - // Get width or height on the element - (this.length ? jQuery.css( this[0], type ) : null) : - - // Set the width or height on the element (default to pixels if value is unitless) - this.css( type, typeof size === "string" ? size : size + "px" ); - }; - -}); - -// Create innerHeight, innerWidth, outerHeight and outerWidth methods -jQuery.each([ "Width" ], function(i, name){ - - var tl = i ? "Left" : "Top", // top or left - br = i ? "Right" : "Bottom", // bottom or right - lower = name.toLowerCase(); - - // innerHeight and innerWidth - jQuery.fn["inner" + name] = function(){ - /// <summary> - /// Gets the inner width of the first matched element, excluding border but including padding. - /// </summary> - /// <returns type="Number" integer="true">The outer width of the first matched element.</returns> - return this[0] ? - jQuery.css( this[0], lower, false, "padding" ) : - null; - }; - - // outerHeight and outerWidth - jQuery.fn["outer" + name] = function(margin) { - /// <summary> - /// Gets the outer width of the first matched element, including border and padding by default. - /// </summary> - /// <param name="margins" type="Map">A set of key/value pairs that specify the options for the method.</param> - /// <returns type="Number" integer="true">The outer width of the first matched element.</returns> - return this[0] ? - jQuery.css( this[0], lower, false, margin ? "margin" : "border" ) : - null; - }; - - var type = name.toLowerCase(); - - jQuery.fn[ type ] = function( size ) { - /// <summary> - /// Set the CSS width of every matched element. If no explicit unit - /// was specified (like 'em' or '%') then "px" is added to the width. If no parameter is specified, it gets - /// the current computed pixel width of the first matched element. - /// Part of CSS - /// </summary> - /// <returns type="jQuery" type="jQuery" /> - /// <param name="cssProperty" type="String"> - /// Set the CSS property to the specified value. Omit to get the value of the first matched element. - /// </param> - - // Get window width or height - return this[0] == window ? - // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode - document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || - document.body[ "client" + name ] : - - // Get document width or height - this[0] == document ? - // Either scroll[Width/Height] or offset[Width/Height], whichever is greater - Math.max( - document.documentElement["client" + name], - document.body["scroll" + name], document.documentElement["scroll" + name], - document.body["offset" + name], document.documentElement["offset" + name] - ) : - - // Get or set width or height on the element - size === undefined ? - // Get width or height on the element - (this.length ? jQuery.css( this[0], type ) : null) : - - // Set the width or height on the element (default to pixels if value is unitless) - this.css( type, typeof size === "string" ? size : size + "px" ); - }; - -}); -})(); diff --git a/projecttemplates/MvcRelyingParty/Scripts/jquery-1.3.2.min.js b/projecttemplates/MvcRelyingParty/Scripts/jquery-1.3.2.min.js deleted file mode 100644 index d7db7bf..0000000 --- a/projecttemplates/MvcRelyingParty/Scripts/jquery-1.3.2.min.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * jQuery JavaScript Library v1.3.2 - * - * Copyright (c) 2009 John Resig, http://jquery.com/ - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * More information: http://sizzlejs.com/ - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ -(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Scripts/jquery-ui-personalized-1.6rc6.js b/projecttemplates/MvcRelyingParty/Scripts/jquery-ui-personalized-1.6rc6.js deleted file mode 100644 index 71bea46..0000000 --- a/projecttemplates/MvcRelyingParty/Scripts/jquery-ui-personalized-1.6rc6.js +++ /dev/null @@ -1,4126 +0,0 @@ -/* - * jQuery UI 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI - */ -;(function($) { - -var _remove = $.fn.remove, - isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9); - -//Helper functions and ui object -$.ui = { - version: "1.6rc6", - - // $.ui.plugin is deprecated. Use the proxy pattern instead. - plugin: { - add: function(module, option, set) { - var proto = $.ui[module].prototype; - for(var i in set) { - proto.plugins[i] = proto.plugins[i] || []; - proto.plugins[i].push([option, set[i]]); - } - }, - call: function(instance, name, args) { - var set = instance.plugins[name]; - if(!set) { return; } - - for (var i = 0; i < set.length; i++) { - if (instance.options[set[i][0]]) { - set[i][1].apply(instance.element, args); - } - } - } - }, - - contains: function(a, b) { - return document.compareDocumentPosition - ? a.compareDocumentPosition(b) & 16 - : a !== b && a.contains(b); - }, - - cssCache: {}, - css: function(name) { - if ($.ui.cssCache[name]) { return $.ui.cssCache[name]; } - var tmp = $('<div class="ui-gen"></div>').addClass(name).css({position:'absolute', top:'-5000px', left:'-5000px', display:'block'}).appendTo('body'); - - //if (!$.browser.safari) - //tmp.appendTo('body'); - - //Opera and Safari set width and height to 0px instead of auto - //Safari returns rgba(0,0,0,0) when bgcolor is not set - $.ui.cssCache[name] = !!( - (!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) || - !(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))) - ); - try { $('body').get(0).removeChild(tmp.get(0)); } catch(e){} - return $.ui.cssCache[name]; - }, - - hasScroll: function(el, a) { - - //If overflow is hidden, the element might have extra content, but the user wants to hide it - if ($(el).css('overflow') == 'hidden') { return false; } - - var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop', - has = false; - - if (el[scroll] > 0) { return true; } - - // TODO: determine which cases actually cause this to happen - // if the element doesn't have the scroll set, see if it's possible to - // set the scroll - el[scroll] = 1; - has = (el[scroll] > 0); - el[scroll] = 0; - return has; - }, - - isOverAxis: function(x, reference, size) { - //Determines when x coordinate is over "b" element axis - return (x > reference) && (x < (reference + size)); - }, - - isOver: function(y, x, top, left, height, width) { - //Determines when x, y coordinates is over "b" element - return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width); - }, - - keyCode: { - BACKSPACE: 8, - CAPS_LOCK: 20, - COMMA: 188, - CONTROL: 17, - DELETE: 46, - DOWN: 40, - END: 35, - ENTER: 13, - ESCAPE: 27, - HOME: 36, - INSERT: 45, - LEFT: 37, - NUMPAD_ADD: 107, - NUMPAD_DECIMAL: 110, - NUMPAD_DIVIDE: 111, - NUMPAD_ENTER: 108, - NUMPAD_MULTIPLY: 106, - NUMPAD_SUBTRACT: 109, - PAGE_DOWN: 34, - PAGE_UP: 33, - PERIOD: 190, - RIGHT: 39, - SHIFT: 16, - SPACE: 32, - TAB: 9, - UP: 38 - } -}; - -// WAI-ARIA normalization -if (isFF2) { - var attr = $.attr, - removeAttr = $.fn.removeAttr, - ariaNS = "http://www.w3.org/2005/07/aaa", - ariaState = /^aria-/, - ariaRole = /^wairole:/; - - $.attr = function(elem, name, value) { - var set = value !== undefined; - - return (name == 'role' - ? (set - ? attr.call(this, elem, name, "wairole:" + value) - : (attr.apply(this, arguments) || "").replace(ariaRole, "")) - : (ariaState.test(name) - ? (set - ? elem.setAttributeNS(ariaNS, - name.replace(ariaState, "aaa:"), value) - : attr.call(this, elem, name.replace(ariaState, "aaa:"))) - : attr.apply(this, arguments))); - }; - - $.fn.removeAttr = function(name) { - return (ariaState.test(name) - ? this.each(function() { - this.removeAttributeNS(ariaNS, name.replace(ariaState, "")); - }) : removeAttr.call(this, name)); - }; -} - -//jQuery plugins -$.fn.extend({ - remove: function() { - // Safari has a native remove event which actually removes DOM elements, - // so we have to use triggerHandler instead of trigger (#3037). - $("*", this).add(this).each(function() { - $(this).triggerHandler("remove"); - }); - return _remove.apply(this, arguments ); - }, - - enableSelection: function() { - return this - .attr('unselectable', 'off') - .css('MozUserSelect', '') - .unbind('selectstart.ui'); - }, - - disableSelection: function() { - return this - .attr('unselectable', 'on') - .css('MozUserSelect', 'none') - .bind('selectstart.ui', function() { return false; }); - }, - - scrollParent: function() { - var scrollParent; - if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { - scrollParent = this.parents().filter(function() { - return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); - }).eq(0); - } else { - scrollParent = this.parents().filter(function() { - return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); - }).eq(0); - } - - return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; - } -}); - - -//Additional selectors -$.extend($.expr[':'], { - data: function(elem, i, match) { - return !!$.data(elem, match[3]); - }, - - focusable: function(element) { - var nodeName = element.nodeName.toLowerCase(), - tabIndex = $.attr(element, 'tabindex'); - return (/input|select|textarea|button|object/.test(nodeName) - ? !element.disabled - : 'a' == nodeName || 'area' == nodeName - ? element.href || !isNaN(tabIndex) - : !isNaN(tabIndex)) - // the element and all of its ancestors must be visible - // the browser may report that the area is hidden - && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length; - }, - - tabbable: function(element) { - var tabIndex = $.attr(element, 'tabindex'); - return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable'); - } -}); - - -// $.widget is a factory to create jQuery plugins -// taking some boilerplate code out of the plugin code -function getter(namespace, plugin, method, args) { - function getMethods(type) { - var methods = $[namespace][plugin][type] || []; - return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods); - } - - var methods = getMethods('getter'); - if (args.length == 1 && typeof args[0] == 'string') { - methods = methods.concat(getMethods('getterSetter')); - } - return ($.inArray(method, methods) != -1); -} - -$.widget = function(name, prototype) { - var namespace = name.split(".")[0]; - name = name.split(".")[1]; - - // create plugin method - $.fn[name] = function(options) { - var isMethodCall = (typeof options == 'string'), - args = Array.prototype.slice.call(arguments, 1); - - // prevent calls to internal methods - if (isMethodCall && options.substring(0, 1) == '_') { - return this; - } - - // handle getter methods - if (isMethodCall && getter(namespace, name, options, args)) { - var instance = $.data(this[0], name); - return (instance ? instance[options].apply(instance, args) - : undefined); - } - - // handle initialization and non-getter methods - return this.each(function() { - var instance = $.data(this, name); - - // constructor - (!instance && !isMethodCall && - $.data(this, name, new $[namespace][name](this, options))._init()); - - // method call - (instance && isMethodCall && $.isFunction(instance[options]) && - instance[options].apply(instance, args)); - }); - }; - - // create widget constructor - $[namespace] = $[namespace] || {}; - $[namespace][name] = function(element, options) { - var self = this; - - this.namespace = namespace; - this.widgetName = name; - this.widgetEventPrefix = $[namespace][name].eventPrefix || name; - this.widgetBaseClass = namespace + '-' + name; - - this.options = $.extend({}, - $.widget.defaults, - $[namespace][name].defaults, - $.metadata && $.metadata.get(element)[name], - options); - - this.element = $(element) - .bind('setData.' + name, function(event, key, value) { - if (event.target == element) { - return self._setData(key, value); - } - }) - .bind('getData.' + name, function(event, key) { - if (event.target == element) { - return self._getData(key); - } - }) - .bind('remove', function() { - return self.destroy(); - }); - }; - - // add widget prototype - $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype); - - // TODO: merge getter and getterSetter properties from widget prototype - // and plugin prototype - $[namespace][name].getterSetter = 'option'; -}; - -$.widget.prototype = { - _init: function() {}, - destroy: function() { - this.element.removeData(this.widgetName) - .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled') - .removeAttr('aria-disabled'); - }, - - option: function(key, value) { - var options = key, - self = this; - - if (typeof key == "string") { - if (value === undefined) { - return this._getData(key); - } - options = {}; - options[key] = value; - } - - $.each(options, function(key, value) { - self._setData(key, value); - }); - }, - _getData: function(key) { - return this.options[key]; - }, - _setData: function(key, value) { - this.options[key] = value; - - if (key == 'disabled') { - this.element - [value ? 'addClass' : 'removeClass']( - this.widgetBaseClass + '-disabled' + ' ' + - this.namespace + '-state-disabled') - .attr("aria-disabled", value); - } - }, - - enable: function() { - this._setData('disabled', false); - }, - disable: function() { - this._setData('disabled', true); - }, - - _trigger: function(type, event, data) { - var callback = this.options[type], - eventName = (type == this.widgetEventPrefix - ? type : this.widgetEventPrefix + type); - - event = $.Event(event); - event.type = eventName; - - // copy original event properties over to the new event - // this would happen if we could call $.event.fix instead of $.Event - // but we don't have a way to force an event to be fixed multiple times - if (event.originalEvent) { - for (var i = $.event.props.length, prop; i;) { - prop = $.event.props[--i]; - event[prop] = event.originalEvent[prop]; - } - } - - this.element.trigger(event, data); - - return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false - || event.isDefaultPrevented()); - } -}; - -$.widget.defaults = { - disabled: false -}; - - -/** Mouse Interaction Plugin **/ - -$.ui.mouse = { - _mouseInit: function() { - var self = this; - - this.element - .bind('mousedown.'+this.widgetName, function(event) { - return self._mouseDown(event); - }) - .bind('click.'+this.widgetName, function(event) { - if(self._preventClickEvent) { - self._preventClickEvent = false; - return false; - } - }); - - // Prevent text selection in IE - if ($.browser.msie) { - this._mouseUnselectable = this.element.attr('unselectable'); - this.element.attr('unselectable', 'on'); - } - - this.started = false; - }, - - // TODO: make sure destroying one instance of mouse doesn't mess with - // other instances of mouse - _mouseDestroy: function() { - this.element.unbind('.'+this.widgetName); - - // Restore text selection in IE - ($.browser.msie - && this.element.attr('unselectable', this._mouseUnselectable)); - }, - - _mouseDown: function(event) { - // don't let more than one widget handle mouseStart - if (event.originalEvent.mouseHandled) { return; } - - // we may have missed mouseup (out of window) - (this._mouseStarted && this._mouseUp(event)); - - this._mouseDownEvent = event; - - var self = this, - btnIsLeft = (event.which == 1), - elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false); - if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { - return true; - } - - this.mouseDelayMet = !this.options.delay; - if (!this.mouseDelayMet) { - this._mouseDelayTimer = setTimeout(function() { - self.mouseDelayMet = true; - }, this.options.delay); - } - - if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { - this._mouseStarted = (this._mouseStart(event) !== false); - if (!this._mouseStarted) { - event.preventDefault(); - return true; - } - } - - // these delegates are required to keep context - this._mouseMoveDelegate = function(event) { - return self._mouseMove(event); - }; - this._mouseUpDelegate = function(event) { - return self._mouseUp(event); - }; - $(document) - .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) - .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); - - // preventDefault() is used to prevent the selection of text here - - // however, in Safari, this causes select boxes not to be selectable - // anymore, so this fix is needed - ($.browser.safari || event.preventDefault()); - - event.originalEvent.mouseHandled = true; - return true; - }, - - _mouseMove: function(event) { - // IE mouseup check - mouseup happened when mouse was out of window - if ($.browser.msie && !event.button) { - return this._mouseUp(event); - } - - if (this._mouseStarted) { - this._mouseDrag(event); - return event.preventDefault(); - } - - if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { - this._mouseStarted = - (this._mouseStart(this._mouseDownEvent, event) !== false); - (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); - } - - return !this._mouseStarted; - }, - - _mouseUp: function(event) { - $(document) - .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) - .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); - - if (this._mouseStarted) { - this._mouseStarted = false; - this._preventClickEvent = true; - this._mouseStop(event); - } - - return false; - }, - - _mouseDistanceMet: function(event) { - return (Math.max( - Math.abs(this._mouseDownEvent.pageX - event.pageX), - Math.abs(this._mouseDownEvent.pageY - event.pageY) - ) >= this.options.distance - ); - }, - - _mouseDelayMet: function(event) { - return this.mouseDelayMet; - }, - - // These are placeholder methods, to be overriden by extending plugin - _mouseStart: function(event) {}, - _mouseDrag: function(event) {}, - _mouseStop: function(event) {}, - _mouseCapture: function(event) { return true; } -}; - -$.ui.mouse.defaults = { - cancel: null, - distance: 1, - delay: 0 -}; - -})(jQuery); -/* - * jQuery UI Draggable 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * ui.core.js - */ -(function($) { - -$.widget("ui.draggable", $.extend({}, $.ui.mouse, { - - _init: function() { - - if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position"))) - this.element[0].style.position = 'relative'; - - (this.options.cssNamespace && this.element.addClass(this.options.cssNamespace+"-draggable")); - (this.options.disabled && this.element.addClass(this.options.cssNamespace+'-draggable-disabled')); - - this._mouseInit(); - - }, - - destroy: function() { - if(!this.element.data('draggable')) return; - this.element.removeData("draggable").unbind(".draggable").removeClass(this.options.cssNamespace+'-draggable '+this.options.cssNamespace+'-draggable-dragging '+this.options.cssNamespace+'-draggable-disabled'); - this._mouseDestroy(); - }, - - _mouseCapture: function(event) { - - var o = this.options; - - if (this.helper || o.disabled || $(event.target).is('.'+this.options.cssNamespace+'-resizable-handle')) - return false; - - //Quit if we're not on a valid handle - this.handle = this._getHandle(event); - if (!this.handle) - return false; - - return true; - - }, - - _mouseStart: function(event) { - - var o = this.options; - - //Create and append the visible helper - this.helper = this._createHelper(event); - - //Cache the helper size - this._cacheHelperProportions(); - - //If ddmanager is used for droppables, set the global draggable - if($.ui.ddmanager) - $.ui.ddmanager.current = this; - - /* - * - Position generation - - * This block generates everything position related - it's the core of draggables. - */ - - //Cache the margins of the original element - this._cacheMargins(); - - //Store the helper's css position - this.cssPosition = this.helper.css("position"); - this.scrollParent = this.helper.scrollParent(); - - //The element's absolute position on the page minus margins - this.offset = this.element.offset(); - this.offset = { - top: this.offset.top - this.margins.top, - left: this.offset.left - this.margins.left - }; - - $.extend(this.offset, { - click: { //Where the click happened, relative to the element - left: event.pageX - this.offset.left, - top: event.pageY - this.offset.top - }, - parent: this._getParentOffset(), - relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper - }); - - //Generate the original position - this.originalPosition = this._generatePosition(event); - this.originalPageX = event.pageX; - this.originalPageY = event.pageY; - - //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied - if(o.cursorAt) - this._adjustOffsetFromHelper(o.cursorAt); - - //Set a containment if given in the options - if(o.containment) - this._setContainment(); - - //Call plugins and callbacks - this._trigger("start", event); - - //Recache the helper size - this._cacheHelperProportions(); - - //Prepare the droppable offsets - if ($.ui.ddmanager && !o.dropBehaviour) - $.ui.ddmanager.prepareOffsets(this, event); - - this.helper.addClass(o.cssNamespace+"-draggable-dragging"); - this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position - return true; - }, - - _mouseDrag: function(event, noPropagation) { - - //Compute the helpers position - this.position = this._generatePosition(event); - this.positionAbs = this._convertPositionTo("absolute"); - - //Call plugins and callbacks and use the resulting position if something is returned - if (!noPropagation) { - var ui = this._uiHash(); - this._trigger('drag', event, ui); - this.position = ui.position; - } - - if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; - if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; - if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); - - return false; - }, - - _mouseStop: function(event) { - - //If we are using droppables, inform the manager about the drop - var dropped = false; - if ($.ui.ddmanager && !this.options.dropBehaviour) - dropped = $.ui.ddmanager.drop(this, event); - - //if a drop comes from outside (a sortable) - if(this.dropped) { - dropped = this.dropped; - this.dropped = false; - } - - if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { - var self = this; - $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { - self._trigger("stop", event); - self._clear(); - }); - } else { - this._trigger("stop", event); - this._clear(); - } - - return false; - }, - - _getHandle: function(event) { - - var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; - $(this.options.handle, this.element) - .find("*") - .andSelf() - .each(function() { - if(this == event.target) handle = true; - }); - - return handle; - - }, - - _createHelper: function(event) { - - var o = this.options; - var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element); - - if(!helper.parents('body').length) - helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); - - if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) - helper.css("position", "absolute"); - - return helper; - - }, - - _adjustOffsetFromHelper: function(obj) { - if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left; - if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; - if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top; - if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; - }, - - _getParentOffset: function() { - - //Get the offsetParent and cache its position - this.offsetParent = this.helper.offsetParent(); - var po = this.offsetParent.offset(); - - // This is a special case where we need to modify a offset calculated on start, since the following happened: - // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent - // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that - // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag - if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { - po.left += this.scrollParent.scrollLeft(); - po.top += this.scrollParent.scrollTop(); - } - - if((this.offsetParent[0] == document.body && $.browser.mozilla) //Ugly FF3 fix - || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix - po = { top: 0, left: 0 }; - - return { - top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), - left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) - }; - - }, - - _getRelativeOffset: function() { - - if(this.cssPosition == "relative") { - var p = this.element.position(); - return { - top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), - left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() - }; - } else { - return { top: 0, left: 0 }; - } - - }, - - _cacheMargins: function() { - this.margins = { - left: (parseInt(this.element.css("marginLeft"),10) || 0), - top: (parseInt(this.element.css("marginTop"),10) || 0) - }; - }, - - _cacheHelperProportions: function() { - this.helperProportions = { - width: this.helper.outerWidth(), - height: this.helper.outerHeight() - }; - }, - - _setContainment: function() { - - var o = this.options; - if(o.containment == 'parent') o.containment = this.helper[0].parentNode; - if(o.containment == 'document' || o.containment == 'window') this.containment = [ - 0 - this.offset.relative.left - this.offset.parent.left, - 0 - this.offset.relative.top - this.offset.parent.top, - $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, - ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top - ]; - - if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) { - var ce = $(o.containment)[0]; if(!ce) return; - var co = $(o.containment).offset(); - var over = ($(ce).css("overflow") != 'hidden'); - - this.containment = [ - co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, - co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, - co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, - co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - ]; - } else if(o.containment.constructor == Array) { - this.containment = o.containment; - } - - }, - - _convertPositionTo: function(d, pos) { - - if(!pos) pos = this.position; - var mod = d == "absolute" ? 1 : -1; - var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); - - return { - top: ( - pos.top // The absolute mouse position - + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent - + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) - - ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod - ), - left: ( - pos.left // The absolute mouse position - + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent - + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) - - ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod - ) - }; - - }, - - _generatePosition: function(event) { - - var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); - - // This is another very weird special case that only happens for relative elements: - // 1. If the css position is relative - // 2. and the scroll parent is the document or similar to the offset parent - // we have to refresh the relative offset during the scroll so there are no jumps - if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { - this.offset.relative = this._getRelativeOffset(); - } - - var pageX = event.pageX; - var pageY = event.pageY; - - /* - * - Position constraining - - * Constrain the position to a mix of grid, containment. - */ - - if(this.originalPosition) { //If we are not dragging yet, we won't check for options - - if(this.containment) { - if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left; - if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top; - if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; - if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; - } - - if(o.grid) { - var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; - pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; - - var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; - pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; - } - - } - - return { - top: ( - pageY // The absolute mouse position - - this.offset.click.top // Click offset (relative to the element) - - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent - - this.offset.parent.top // The offsetParent's offset without borders (offset + border) - + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) - ), - left: ( - pageX // The absolute mouse position - - this.offset.click.left // Click offset (relative to the element) - - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent - - this.offset.parent.left // The offsetParent's offset without borders (offset + border) - + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) - ) - }; - - }, - - _clear: function() { - this.helper.removeClass(this.options.cssNamespace+"-draggable-dragging"); - if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove(); - //if($.ui.ddmanager) $.ui.ddmanager.current = null; - this.helper = null; - this.cancelHelperRemoval = false; - }, - - // From now on bulk stuff - mainly helpers - - _trigger: function(type, event, ui) { - ui = ui || this._uiHash(); - $.ui.plugin.call(this, type, [event, ui]); - if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins - return $.widget.prototype._trigger.call(this, type, event, ui); - }, - - plugins: {}, - - _uiHash: function(event) { - return { - helper: this.helper, - position: this.position, - absolutePosition: this.positionAbs, //deprecated - offset: this.positionAbs - }; - } - -})); - -$.extend($.ui.draggable, { - version: "1.6rc6", - eventPrefix: "drag", - defaults: { - appendTo: "parent", - axis: false, - cancel: ":input,option", - connectToSortable: false, - containment: false, - cssNamespace: "ui", - cursor: "default", - cursorAt: false, - delay: 0, - distance: 1, - grid: false, - handle: false, - helper: "original", - iframeFix: false, - opacity: false, - refreshPositions: false, - revert: false, - revertDuration: 500, - scope: "default", - scroll: true, - scrollSensitivity: 20, - scrollSpeed: 20, - snap: false, - snapMode: "both", - snapTolerance: 20, - stack: false, - zIndex: false - } -}); - -$.ui.plugin.add("draggable", "connectToSortable", { - start: function(event, ui) { - - var inst = $(this).data("draggable"), o = inst.options; - inst.sortables = []; - $(o.connectToSortable).each(function() { - // 'this' points to a string, and should therefore resolved as query, but instead, if the string is assigned to a variable, it loops through the strings properties, - // so we have to append '' to make it anonymous again - $(typeof this == 'string' ? this+'': this).each(function() { - if($.data(this, 'sortable')) { - var sortable = $.data(this, 'sortable'); - inst.sortables.push({ - instance: sortable, - shouldRevert: sortable.options.revert - }); - sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache - sortable._trigger("activate", event, inst); - } - }); - }); - - }, - stop: function(event, ui) { - - //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper - var inst = $(this).data("draggable"); - - $.each(inst.sortables, function() { - if(this.instance.isOver) { - - this.instance.isOver = 0; - - inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance - this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) - - //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid' - if(this.shouldRevert) this.instance.options.revert = true; - - //Trigger the stop of the sortable - this.instance._mouseStop(event); - - this.instance.options.helper = this.instance.options._helper; - - //If the helper has been the original item, restore properties in the sortable - if(inst.options.helper == 'original') - this.instance.currentItem.css({ top: 'auto', left: 'auto' }); - - } else { - this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance - this.instance._trigger("deactivate", event, inst); - } - - }); - - }, - drag: function(event, ui) { - - var inst = $(this).data("draggable"), self = this; - - var checkPos = function(o) { - var dyClick = this.offset.click.top, dxClick = this.offset.click.left; - var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left; - var itemHeight = o.height, itemWidth = o.width; - var itemTop = o.top, itemLeft = o.left; - - return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth); - }; - - $.each(inst.sortables, function(i) { - - if(checkPos.call(inst, this.instance.containerCache)) { - - //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once - if(!this.instance.isOver) { - this.instance.isOver = 1; - //Now we fake the start of dragging for the sortable instance, - //by cloning the list group item, appending it to the sortable and using it as inst.currentItem - //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) - this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true); - this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it - this.instance.options.helper = function() { return ui.helper[0]; }; - - event.target = this.instance.currentItem[0]; - this.instance._mouseCapture(event, true); - this.instance._mouseStart(event, true, true); - - //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes - this.instance.offset.click.top = inst.offset.click.top; - this.instance.offset.click.left = inst.offset.click.left; - this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; - this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; - - inst._trigger("toSortable", event); - inst.dropped = this.instance.element; //draggable revert needs that - this.instance.fromOutside = inst; //Little hack so receive/update callbacks work - - } - - //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable - if(this.instance.currentItem) this.instance._mouseDrag(event); - - } else { - - //If it doesn't intersect with the sortable, and it intersected before, - //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval - if(this.instance.isOver) { - this.instance.isOver = 0; - this.instance.cancelHelperRemoval = true; - this.instance.options.revert = false; //No revert here - this.instance._mouseStop(event, true); - this.instance.options.helper = this.instance.options._helper; - - //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size - this.instance.currentItem.remove(); - if(this.instance.placeholder) this.instance.placeholder.remove(); - - inst._trigger("fromSortable", event); - inst.dropped = false; //draggable revert needs that - } - - }; - - }); - - } -}); - -$.ui.plugin.add("draggable", "cursor", { - start: function(event, ui) { - var t = $('body'), o = $(this).data('draggable').options; - if (t.css("cursor")) o._cursor = t.css("cursor"); - t.css("cursor", o.cursor); - }, - stop: function(event, ui) { - var o = $(this).data('draggable').options; - if (o._cursor) $('body').css("cursor", o._cursor); - } -}); - -$.ui.plugin.add("draggable", "iframeFix", { - start: function(event, ui) { - var o = $(this).data('draggable').options; - $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { - $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>') - .css({ - width: this.offsetWidth+"px", height: this.offsetHeight+"px", - position: "absolute", opacity: "0.001", zIndex: 1000 - }) - .css($(this).offset()) - .appendTo("body"); - }); - }, - stop: function(event, ui) { - $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers - } -}); - -$.ui.plugin.add("draggable", "opacity", { - start: function(event, ui) { - var t = $(ui.helper), o = $(this).data('draggable').options; - if(t.css("opacity")) o._opacity = t.css("opacity"); - t.css('opacity', o.opacity); - }, - stop: function(event, ui) { - var o = $(this).data('draggable').options; - if(o._opacity) $(ui.helper).css('opacity', o._opacity); - } -}); - -$.ui.plugin.add("draggable", "scroll", { - start: function(event, ui) { - var i = $(this).data("draggable"); - if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); - }, - drag: function(event, ui) { - - var i = $(this).data("draggable"), o = i.options, scrolled = false; - - if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { - - if(!o.axis || o.axis != 'x') { - if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) - i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed; - else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) - i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed; - } - - if(!o.axis || o.axis != 'y') { - if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) - i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed; - else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) - i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed; - } - - } else { - - if(!o.axis || o.axis != 'x') { - if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) - scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); - else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) - scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); - } - - if(!o.axis || o.axis != 'y') { - if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) - scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); - else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) - scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); - } - - } - - if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) - $.ui.ddmanager.prepareOffsets(i, event); - - } -}); - -$.ui.plugin.add("draggable", "snap", { - start: function(event, ui) { - - var i = $(this).data("draggable"), o = i.options; - i.snapElements = []; - - $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() { - var $t = $(this); var $o = $t.offset(); - if(this != i.element[0]) i.snapElements.push({ - item: this, - width: $t.outerWidth(), height: $t.outerHeight(), - top: $o.top, left: $o.left - }); - }); - - }, - drag: function(event, ui) { - - var inst = $(this).data("draggable"), o = inst.options; - var d = o.snapTolerance; - - var x1 = ui.absolutePosition.left, x2 = x1 + inst.helperProportions.width, - y1 = ui.absolutePosition.top, y2 = y1 + inst.helperProportions.height; - - for (var i = inst.snapElements.length - 1; i >= 0; i--){ - - var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width, - t = inst.snapElements[i].top, b = t + inst.snapElements[i].height; - - //Yes, I know, this is insane ;) - if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) { - if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); - inst.snapElements[i].snapping = false; - continue; - } - - if(o.snapMode != 'inner') { - var ts = Math.abs(t - y2) <= d; - var bs = Math.abs(b - y1) <= d; - var ls = Math.abs(l - x2) <= d; - var rs = Math.abs(r - x1) <= d; - if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top; - if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top; - if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left; - if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left; - } - - var first = (ts || bs || ls || rs); - - if(o.snapMode != 'outer') { - var ts = Math.abs(t - y1) <= d; - var bs = Math.abs(b - y2) <= d; - var ls = Math.abs(l - x1) <= d; - var rs = Math.abs(r - x2) <= d; - if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top; - if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top; - if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left; - if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left; - } - - if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) - (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); - inst.snapElements[i].snapping = (ts || bs || ls || rs || first); - - }; - - } -}); - -$.ui.plugin.add("draggable", "stack", { - start: function(event, ui) { - - var o = $(this).data("draggable").options; - - var group = $.makeArray($(o.stack.group)).sort(function(a,b) { - return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min); - }); - - $(group).each(function(i) { - this.style.zIndex = o.stack.min + i; - }); - - this[0].style.zIndex = o.stack.min + group.length; - - } -}); - -$.ui.plugin.add("draggable", "zIndex", { - start: function(event, ui) { - var t = $(ui.helper), o = $(this).data("draggable").options; - if(t.css("zIndex")) o._zIndex = t.css("zIndex"); - t.css('zIndex', o.zIndex); - }, - stop: function(event, ui) { - var o = $(this).data("draggable").options; - if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex); - } -}); - -})(jQuery); -/* - * jQuery UI Resizable 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Resizables - * - * Depends: - * ui.core.js - */ -(function($) { - -$.widget("ui.resizable", $.extend({}, $.ui.mouse, { - - _init: function() { - - var self = this, o = this.options; - this.element.addClass("ui-resizable"); - - $.extend(this, { - _aspectRatio: !!(o.aspectRatio), - aspectRatio: o.aspectRatio, - originalElement: this.element, - proportionallyResize: o.proportionallyResize ? [o.proportionallyResize] : [], - _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null - }); - - //Wrap the element if it cannot hold child nodes - if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { - - //Opera fix for relative positioning - if (/relative/.test(this.element.css('position')) && $.browser.opera) - this.element.css({ position: 'relative', top: 'auto', left: 'auto' }); - - //Create a wrapper element and set the wrapper to the new current internal element - this.element.wrap( - $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({ - position: this.element.css('position'), - width: this.element.outerWidth(), - height: this.element.outerHeight(), - top: this.element.css('top'), - left: this.element.css('left') - }) - ); - - //Overwrite the original this.element - this.element = this.element.parent(); - this.elementIsWrapper = true; - - //Move margins to the wrapper - this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); - this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0}); - - //Prevent Safari textarea resize - if ($.browser.safari && o.preventDefault) this.originalElement.css('resize', 'none'); - - //Push the actual element to our proportionallyResize internal array - this.proportionallyResize.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' })); - - // avoid IE jump (hard set the margin) - this.originalElement.css({ margin: this.originalElement.css('margin') }); - - // fix handlers offset - this._proportionallyResize(); - - } - - this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' }); - if(this.handles.constructor == String) { - - if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw'; - var n = this.handles.split(","); this.handles = {}; - - for(var i = 0; i < n.length; i++) { - - var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle; - var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>'); - - // increase zIndex of sw, se, ne, nw axis - //TODO : this modifies original option - if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex }); - - //TODO : What's going on here? - if ('se' == handle) { - axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se'); - }; - - //Insert into internal handles object and append to element - this.handles[handle] = '.ui-resizable-'+handle; - this.element.append(axis); - } - - } - - this._renderAxis = function(target) { - - target = target || this.element; - - for(var i in this.handles) { - - if(this.handles[i].constructor == String) - this.handles[i] = $(this.handles[i], this.element).show(); - - if (o.transparent) - this.handles[i].css({ opacity: 0 }); - - //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) - if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { - - var axis = $(this.handles[i], this.element), padWrapper = 0; - - //Checking the correct pad and border - padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); - - //The padding type i have to apply... - var padPos = [ 'padding', - /ne|nw|n/.test(i) ? 'Top' : - /se|sw|s/.test(i) ? 'Bottom' : - /^e$/.test(i) ? 'Right' : 'Left' ].join(""); - - if (!o.transparent) - target.css(padPos, padWrapper); - - this._proportionallyResize(); - - } - - //TODO: What's that good for? There's not anything to be executed left - if(!$(this.handles[i]).length) - continue; - - } - }; - - //TODO: make renderAxis a prototype function - this._renderAxis(this.element); - - this._handles = $('.ui-resizable-handle', this.element); - - if (o.disableSelection) - this._handles.disableSelection(); - - //Matching axis name - this._handles.mouseover(function() { - if (!self.resizing) { - if (this.className) - var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); - //Axis, default = se - self.axis = axis && axis[1] ? axis[1] : 'se'; - } - }); - - //If we want to auto hide the elements - if (o.autoHide) { - this._handles.hide(); - $(this.element) - .addClass("ui-resizable-autohide") - .hover(function() { - $(this).removeClass("ui-resizable-autohide"); - self._handles.show(); - }, - function(){ - if (!self.resizing) { - $(this).addClass("ui-resizable-autohide"); - self._handles.hide(); - } - }); - } - - //Initialize the mouse interaction - this._mouseInit(); - - }, - - destroy: function() { - - this._mouseDestroy(); - - var _destroy = function(exp) { - $(exp).removeClass("ui-resizable ui-resizable-disabled") - .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove(); - }; - - //TODO: Unwrap at same DOM position - if (this.elementIsWrapper) { - _destroy(this.element); - this.wrapper.parent().append( - this.originalElement.css({ - position: this.wrapper.css('position'), - width: this.wrapper.outerWidth(), - height: this.wrapper.outerHeight(), - top: this.wrapper.css('top'), - left: this.wrapper.css('left') - }) - ).end().remove(); - } - - _destroy(this.originalElement); - - }, - - _mouseCapture: function(event) { - - var handle = false; - for(var i in this.handles) { - if($(this.handles[i])[0] == event.target) handle = true; - } - - return this.options.disabled || !!handle; - - }, - - _mouseStart: function(event) { - - var o = this.options, iniPos = this.element.position(), el = this.element; - - this.resizing = true; - this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() }; - - // bugfix for http://dev.jquery.com/ticket/1749 - if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) { - el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left }); - } - - //Opera fixing relative position - if ($.browser.opera && (/relative/).test(el.css('position'))) - el.css({ position: 'relative', top: 'auto', left: 'auto' }); - - this._renderProxy(); - - var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top')); - - if (o.containment) { - curleft += $(o.containment).scrollLeft() || 0; - curtop += $(o.containment).scrollTop() || 0; - } - - //Store needed variables - this.offset = this.helper.offset(); - this.position = { left: curleft, top: curtop }; - this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; - this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; - this.originalPosition = { left: curleft, top: curtop }; - this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; - this.originalMousePosition = { left: event.pageX, top: event.pageY }; - - //Aspect Ratio - this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); - - if (o.preserveCursor) { - var cursor = $('.ui-resizable-' + this.axis).css('cursor'); - $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor); - } - - this._propagate("start", event); - return true; - }, - - _mouseDrag: function(event) { - - //Increase performance, avoid regex - var el = this.helper, o = this.options, props = {}, - self = this, smp = this.originalMousePosition, a = this.axis; - - var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0; - var trigger = this._change[a]; - if (!trigger) return false; - - // Calculate the attrs that will be change - var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff; - - if (this._aspectRatio || event.shiftKey) - data = this._updateRatio(data, event); - - data = this._respectSize(data, event); - - // plugins callbacks need to be called first - this._propagate("resize", event); - - el.css({ - top: this.position.top + "px", left: this.position.left + "px", - width: this.size.width + "px", height: this.size.height + "px" - }); - - if (!this._helper && this.proportionallyResize.length) - this._proportionallyResize(); - - this._updateCache(data); - - // calling the user callback at the end - this._trigger('resize', event, this.ui()); - - return false; - }, - - _mouseStop: function(event) { - - this.resizing = false; - var o = this.options, self = this; - - if(this._helper) { - var pr = this.proportionallyResize, ista = pr.length && (/textarea/i).test(pr[0].nodeName), - soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, - soffsetw = ista ? 0 : self.sizeDiff.width; - - var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, - left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, - top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; - - if (!o.animate) - this.element.css($.extend(s, { top: top, left: left })); - - if (this._helper && !o.animate) this._proportionallyResize(); - } - - if (o.preserveCursor) - $('body').css('cursor', 'auto'); - - this._propagate("stop", event); - - if (this._helper) this.helper.remove(); - return false; - - }, - - _updateCache: function(data) { - var o = this.options; - this.offset = this.helper.offset(); - if (data.left) this.position.left = data.left; - if (data.top) this.position.top = data.top; - if (data.height) this.size.height = data.height; - if (data.width) this.size.width = data.width; - }, - - _updateRatio: function(data, event) { - - var o = this.options, cpos = this.position, csize = this.size, a = this.axis; - - if (data.height) data.width = (csize.height * this.aspectRatio); - else if (data.width) data.height = (csize.width / this.aspectRatio); - - if (a == 'sw') { - data.left = cpos.left + (csize.width - data.width); - data.top = null; - } - if (a == 'nw') { - data.top = cpos.top + (csize.height - data.height); - data.left = cpos.left + (csize.width - data.width); - } - - return data; - }, - - _respectSize: function(data, event) { - - var isNumber = function(value) { - return !isNaN(parseInt(value, 10)) - }; - - var el = this.helper, o = this.options, pRatio = this._aspectRatio || event.shiftKey, a = this.axis, - ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), - isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); - - if (isminw) data.width = o.minWidth; - if (isminh) data.height = o.minHeight; - if (ismaxw) data.width = o.maxWidth; - if (ismaxh) data.height = o.maxHeight; - - var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height; - var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); - - if (isminw && cw) data.left = dw - o.minWidth; - if (ismaxw && cw) data.left = dw - o.maxWidth; - if (isminh && ch) data.top = dh - o.minHeight; - if (ismaxh && ch) data.top = dh - o.maxHeight; - - // fixing jump error on top/left - bug #2330 - var isNotwh = !data.width && !data.height; - if (isNotwh && !data.left && data.top) data.top = null; - else if (isNotwh && !data.top && data.left) data.left = null; - - return data; - }, - - _proportionallyResize: function() { - - var o = this.options; - if (!this.proportionallyResize.length) return; - var element = this.helper || this.element; - - for (var i=0; i < this.proportionallyResize.length; i++) { - - var prel = this.proportionallyResize[i]; - - if (!this.borderDif) { - var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')], - p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')]; - - this.borderDif = $.map(b, function(v, i) { - var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0; - return border + padding; - }); - } - - if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length))) - continue; - - prel.css({ - height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0, - width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 - }); - - }; - - }, - - _renderProxy: function() { - - var el = this.element, o = this.options; - this.elementOffset = el.offset(); - - if(this._helper) { - - this.helper = this.helper || $('<div style="overflow:hidden;"></div>'); - - // fix ie6 offset TODO: This seems broken - var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0), - pxyoffset = ( ie6 ? 2 : -1 ); - - this.helper.addClass(this._helper).css({ - width: this.element.outerWidth() + pxyoffset, - height: this.element.outerHeight() + pxyoffset, - position: 'absolute', - left: this.elementOffset.left - ie6offset +'px', - top: this.elementOffset.top - ie6offset +'px', - zIndex: ++o.zIndex //TODO: Don't modify option - }); - - this.helper.appendTo("body"); - - if (o.disableSelection) - this.helper.disableSelection(); - - } else { - this.helper = this.element; - } - - }, - - _change: { - e: function(event, dx, dy) { - return { width: this.originalSize.width + dx }; - }, - w: function(event, dx, dy) { - var o = this.options, cs = this.originalSize, sp = this.originalPosition; - return { left: sp.left + dx, width: cs.width - dx }; - }, - n: function(event, dx, dy) { - var o = this.options, cs = this.originalSize, sp = this.originalPosition; - return { top: sp.top + dy, height: cs.height - dy }; - }, - s: function(event, dx, dy) { - return { height: this.originalSize.height + dy }; - }, - se: function(event, dx, dy) { - return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); - }, - sw: function(event, dx, dy) { - return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); - }, - ne: function(event, dx, dy) { - return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); - }, - nw: function(event, dx, dy) { - return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); - } - }, - - _propagate: function(n, event) { - $.ui.plugin.call(this, n, [event, this.ui()]); - (n != "resize" && this._trigger(n, event, this.ui())); - }, - - plugins: {}, - - ui: function() { - return { - originalElement: this.originalElement, - element: this.element, - helper: this.helper, - position: this.position, - size: this.size, - originalSize: this.originalSize, - originalPosition: this.originalPosition - }; - } - -})); - -$.extend($.ui.resizable, { - version: "1.6rc6", - eventPrefix: "resize", - defaults: { - alsoResize: false, - animate: false, - animateDuration: "slow", - animateEasing: "swing", - aspectRatio: false, - autoHide: false, - cancel: ":input,option", - containment: false, - delay: 0, - disableSelection: true, - distance: 1, - ghost: false, - grid: false, - handles: "e,s,se", - helper: false, - maxHeight: null, - maxWidth: null, - minHeight: 10, - minWidth: 10, - preserveCursor: true, - preventDefault: true, - proportionallyResize: false, - transparent: false, - zIndex: 1000 - } -}); - -/* - * Resizable Extensions - */ - -$.ui.plugin.add("resizable", "alsoResize", { - - start: function(event, ui) { - - var self = $(this).data("resizable"), o = self.options; - - _store = function(exp) { - $(exp).each(function() { - $(this).data("resizable-alsoresize", { - width: parseInt($(this).width(), 10), height: parseInt($(this).height(), 10), - left: parseInt($(this).css('left'), 10), top: parseInt($(this).css('top'), 10) - }); - }); - }; - - if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) { - if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); } - else { $.each(o.alsoResize, function(exp, c) { _store(exp); }); } - }else{ - _store(o.alsoResize); - } - }, - - resize: function(event, ui){ - var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition; - - var delta = { - height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0, - top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0 - }, - - _alsoResize = function(exp, c) { - $(exp).each(function() { - var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left']; - - $.each(css || ['width', 'height', 'top', 'left'], function(i, prop) { - var sum = (start[prop]||0) + (delta[prop]||0); - if (sum && sum >= 0) - style[prop] = sum || null; - }); - - //Opera fixing relative position - if (/relative/.test(el.css('position')) && $.browser.opera) { - self._revertToRelativePosition = true; - el.css({ position: 'absolute', top: 'auto', left: 'auto' }); - } - - el.css(style); - }); - }; - - if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) { - $.each(o.alsoResize, function(exp, c) { _alsoResize(exp, c); }); - }else{ - _alsoResize(o.alsoResize); - } - }, - - stop: function(event, ui){ - var self = $(this).data("resizable"); - - //Opera fixing relative position - if (self._revertToRelativePosition && $.browser.opera) { - self._revertToRelativePosition = false; - el.css({ position: 'relative' }); - } - - $(this).removeData("resizable-alsoresize-start"); - } -}); - -$.ui.plugin.add("resizable", "animate", { - - stop: function(event, ui) { - var self = $(this).data("resizable"), o = self.options; - - var pr = o.proportionallyResize, ista = pr && (/textarea/i).test(pr.get(0).nodeName), - soffseth = ista && $.ui.hasScroll(pr.get(0), 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, - soffsetw = ista ? 0 : self.sizeDiff.width; - - var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, - left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, - top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; - - self.element.animate( - $.extend(style, top && left ? { top: top, left: left } : {}), { - duration: o.animateDuration, - easing: o.animateEasing, - step: function() { - - var data = { - width: parseInt(self.element.css('width'), 10), - height: parseInt(self.element.css('height'), 10), - top: parseInt(self.element.css('top'), 10), - left: parseInt(self.element.css('left'), 10) - }; - - if (pr) pr.css({ width: data.width, height: data.height }); - - // propagating resize, and updating values for each animation step - self._updateCache(data); - self._propagate("resize", event); - - } - } - ); - } - -}); - -$.ui.plugin.add("resizable", "containment", { - - start: function(event, ui) { - var self = $(this).data("resizable"), o = self.options, el = self.element; - var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; - if (!ce) return; - - self.containerElement = $(ce); - - if (/document/.test(oc) || oc == document) { - self.containerOffset = { left: 0, top: 0 }; - self.containerPosition = { left: 0, top: 0 }; - - self.parentData = { - element: $(document), left: 0, top: 0, - width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight - }; - } - - // i'm a node, so compute top, left, right, bottom - else { - var element = $(ce), p = []; - $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); }); - - self.containerOffset = element.offset(); - self.containerPosition = element.position(); - self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) }; - - var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width, - width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); - - self.parentData = { - element: ce, left: co.left, top: co.top, width: width, height: height - }; - } - }, - - resize: function(event, ui) { - var self = $(this).data("resizable"), o = self.options, - ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position, - pRatio = o._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement; - - if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co; - - if (cp.left < (self._helper ? co.left : 0)) { - self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left)); - if (pRatio) self.size.height = self.size.width / o.aspectRatio; - self.position.left = o.helper ? co.left : 0; - } - - if (cp.top < (self._helper ? co.top : 0)) { - self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top); - if (pRatio) self.size.width = self.size.height * o.aspectRatio; - self.position.top = self._helper ? co.top : 0; - } - - var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ), - hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height ); - - if (woset + self.size.width >= self.parentData.width) { - self.size.width = self.parentData.width - woset; - if (pRatio) self.size.height = self.size.width / o.aspectRatio; - } - - if (hoset + self.size.height >= self.parentData.height) { - self.size.height = self.parentData.height - hoset; - if (pRatio) self.size.width = self.size.height * o.aspectRatio; - } - }, - - stop: function(event, ui){ - var self = $(this).data("resizable"), o = self.options, cp = self.position, - co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement; - - var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height; - - if (self._helper && !o.animate && (/relative/).test(ce.css('position'))) - $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); - - if (self._helper && !o.animate && (/static/).test(ce.css('position'))) - $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); - - } -}); - -$.ui.plugin.add("resizable", "ghost", { - - start: function(event, ui) { - - var self = $(this).data("resizable"), o = self.options, pr = o.proportionallyResize, cs = self.size; - - self.ghost = self.originalElement.clone(); - self.ghost - .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) - .addClass('ui-resizable-ghost') - .addClass(typeof o.ghost == 'string' ? o.ghost : ''); - - self.ghost.appendTo(self.helper); - - }, - - resize: function(event, ui){ - var self = $(this).data("resizable"), o = self.options; - if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width }); - }, - - stop: function(event, ui){ - var self = $(this).data("resizable"), o = self.options; - if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0)); - } - -}); - -$.ui.plugin.add("resizable", "grid", { - - resize: function(event, ui) { - var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey; - o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; - var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); - - if (/^(se|s|e)$/.test(a)) { - self.size.width = os.width + ox; - self.size.height = os.height + oy; - } - else if (/^(ne)$/.test(a)) { - self.size.width = os.width + ox; - self.size.height = os.height + oy; - self.position.top = op.top - oy; - } - else if (/^(sw)$/.test(a)) { - self.size.width = os.width + ox; - self.size.height = os.height + oy; - self.position.left = op.left - ox; - } - else { - self.size.width = os.width + ox; - self.size.height = os.height + oy; - self.position.top = op.top - oy; - self.position.left = op.left - ox; - } - } - -}); - -var num = function(v) { - return parseInt(v, 10) || 0; -}; - -})(jQuery); -/* - * jQuery UI Dialog 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Dialog - * - * Depends: - * ui.core.js - * ui.draggable.js - * ui.resizable.js - */ -(function($) { - -var setDataSwitch = { - dragStart: "start.draggable", - drag: "drag.draggable", - dragStop: "stop.draggable", - maxHeight: "maxHeight.resizable", - minHeight: "minHeight.resizable", - maxWidth: "maxWidth.resizable", - minWidth: "minWidth.resizable", - resizeStart: "start.resizable", - resize: "drag.resizable", - resizeStop: "stop.resizable" -}; - -$.widget("ui.dialog", { - - _init: function() { - this.originalTitle = this.element.attr('title'); - - var self = this, - options = this.options, - - title = options.title || this.originalTitle || ' ', - titleId = $.ui.dialog.getTitleId(this.element), - - uiDialog = (this.uiDialog = $('<div/>')) - .appendTo(document.body) - .hide() - .addClass( - 'ui-dialog ' + - 'ui-widget ' + - 'ui-widget-content ' + - 'ui-corner-all ' + - options.dialogClass - ) - .css({ - position: 'absolute', - overflow: 'hidden', - zIndex: options.zIndex - }) - // setting tabIndex makes the div focusable - // setting outline to 0 prevents a border on focus in Mozilla - .attr('tabIndex', -1).css('outline', 0).keydown(function(event) { - (options.closeOnEscape && event.keyCode - && event.keyCode == $.ui.keyCode.ESCAPE && self.close(event)); - }) - .attr({ - role: 'dialog', - 'aria-labelledby': titleId - }) - .mousedown(function(event) { - self.moveToTop(event); - }), - - uiDialogContent = this.element - .show() - .removeAttr('title') - .addClass( - 'ui-dialog-content ' + - 'ui-widget-content') - .appendTo(uiDialog), - - uiDialogTitlebar = (this.uiDialogTitlebar = $('<div></div>')) - .addClass( - 'ui-dialog-titlebar ' + - 'ui-widget-header ' + - 'ui-corner-all ' + - 'ui-helper-clearfix' - ) - .prependTo(uiDialog), - - uiDialogTitlebarClose = $('<a href="#"/>') - .addClass( - 'ui-dialog-titlebar-close ' + - 'ui-corner-all' - ) - .attr('role', 'button') - .hover( - function() { - uiDialogTitlebarClose.addClass('ui-state-hover'); - }, - function() { - uiDialogTitlebarClose.removeClass('ui-state-hover'); - } - ) - .focus(function() { - uiDialogTitlebarClose.addClass('ui-state-focus'); - }) - .blur(function() { - uiDialogTitlebarClose.removeClass('ui-state-focus'); - }) - .mousedown(function(ev) { - ev.stopPropagation(); - }) - .click(function(event) { - self.close(event); - return false; - }) - .appendTo(uiDialogTitlebar), - - uiDialogTitlebarCloseText = (this.uiDialogTitlebarCloseText = $('<span/>')) - .addClass( - 'ui-icon ' + - 'ui-icon-closethick' - ) - .text(options.closeText) - .appendTo(uiDialogTitlebarClose), - - uiDialogTitle = $('<span/>') - .addClass('ui-dialog-title') - .attr('id', titleId) - .html(title) - .prependTo(uiDialogTitlebar); - - uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection(); - - (options.draggable && $.fn.draggable && this._makeDraggable()); - (options.resizable && $.fn.resizable && this._makeResizable()); - - this._createButtons(options.buttons); - this._isOpen = false; - - (options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe()); - (options.autoOpen && this.open()); - - }, - - destroy: function() { - (this.overlay && this.overlay.destroy()); - (this.shadow && this._destroyShadow()); - this.uiDialog.hide(); - this.element - .unbind('.dialog') - .removeData('dialog') - .removeClass('ui-dialog-content ui-widget-content') - .hide().appendTo('body'); - this.uiDialog.remove(); - - (this.originalTitle && this.element.attr('title', this.originalTitle)); - }, - - close: function(event) { - if (false === this._trigger('beforeclose', event)) { - return; - } - - (this.overlay && this.overlay.destroy()); - (this.shadow && this._destroyShadow()); - this.uiDialog - .hide(this.options.hide) - .unbind('keypress.ui-dialog'); - - this._trigger('close', event); - $.ui.dialog.overlay.resize(); - - this._isOpen = false; - }, - - isOpen: function() { - return this._isOpen; - }, - - // the force parameter allows us to move modal dialogs to their correct - // position on open - moveToTop: function(force, event) { - - if ((this.options.modal && !force) - || (!this.options.stack && !this.options.modal)) { - return this._trigger('focus', event); - } - - var maxZ = this.options.zIndex, options = this.options; - $('.ui-dialog:visible').each(function() { - maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10) || options.zIndex); - }); - (this.overlay && this.overlay.$el.css('z-index', ++maxZ)); - (this.shadow && this.shadow.css('z-index', ++maxZ)); - - //Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed. - // http://ui.jquery.com/bugs/ticket/3193 - var saveScroll = { scrollTop: this.element.attr('scrollTop'), scrollLeft: this.element.attr('scrollLeft') }; - this.uiDialog.css('z-index', ++maxZ); - this.element.attr(saveScroll); - this._trigger('focus', event); - }, - - open: function(event) { - if (this._isOpen) { return; } - - var options = this.options, - uiDialog = this.uiDialog; - - this.overlay = options.modal ? new $.ui.dialog.overlay(this) : null; - (uiDialog.next().length && uiDialog.appendTo('body')); - this._size(); - this._position(options.position); - uiDialog.show(options.show); - this.moveToTop(true, event); - - // prevent tabbing out of modal dialogs - (options.modal && uiDialog.bind('keypress.ui-dialog', function(event) { - if (event.keyCode != $.ui.keyCode.TAB) { - return; - } - - var tabbables = $(':tabbable', this), - first = tabbables.filter(':first')[0], - last = tabbables.filter(':last')[0]; - - if (event.target == last && !event.shiftKey) { - setTimeout(function() { - first.focus(); - }, 1); - } else if (event.target == first && event.shiftKey) { - setTimeout(function() { - last.focus(); - }, 1); - } - })); - - // set focus to the first tabbable element in: - // - content area - // - button pane - // - title bar - $([]) - .add(uiDialog.find('.ui-dialog-content :tabbable:first')) - .add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first')) - .add(uiDialog.find('.ui-dialog-titlebar :tabbable:first')) - .filter(':first') - .focus(); - - if(options.shadow) - this._createShadow(); - - this._trigger('open', event); - this._isOpen = true; - }, - - _createButtons: function(buttons) { - var self = this, - hasButtons = false, - uiDialogButtonPane = $('<div></div>') - .addClass( - 'ui-dialog-buttonpane ' + - 'ui-widget-content ' + - 'ui-helper-clearfix' - ); - - // if we already have a button pane, remove it - this.uiDialog.find('.ui-dialog-buttonpane').remove(); - - (typeof buttons == 'object' && buttons !== null && - $.each(buttons, function() { return !(hasButtons = true); })); - if (hasButtons) { - $.each(buttons, function(name, fn) { - $('<button type="button"></button>') - .addClass( - 'ui-state-default ' + - 'ui-corner-all' - ) - .text(name) - .click(function() { fn.apply(self.element[0], arguments); }) - .hover( - function() { - $(this).addClass('ui-state-hover'); - }, - function() { - $(this).removeClass('ui-state-hover'); - } - ) - .focus(function() { - $(this).addClass('ui-state-focus'); - }) - .blur(function() { - $(this).removeClass('ui-state-focus'); - }) - .appendTo(uiDialogButtonPane); - }); - uiDialogButtonPane.appendTo(this.uiDialog); - } - }, - - _makeDraggable: function() { - var self = this, - options = this.options; - - this.uiDialog.draggable({ - cancel: '.ui-dialog-content', - helper: options.dragHelper, - handle: '.ui-dialog-titlebar', - containment: 'document', - start: function() { - (options.dragStart && options.dragStart.apply(self.element[0], arguments)); - if($.browser.msie && $.browser.version < 7 && self.shadow) self.shadow.hide(); - }, - drag: function() { - (options.drag && options.drag.apply(self.element[0], arguments)); - self._refreshShadow(1); - }, - stop: function() { - (options.dragStop && options.dragStop.apply(self.element[0], arguments)); - $.ui.dialog.overlay.resize(); - if($.browser.msie && $.browser.version < 7 && self.shadow) self.shadow.show(); - self._refreshShadow(); - } - }); - }, - - _makeResizable: function(handles) { - handles = (handles === undefined ? this.options.resizable : handles); - var self = this, - options = this.options, - resizeHandles = typeof handles == 'string' - ? handles - : 'n,e,s,w,se,sw,ne,nw'; - - this.uiDialog.resizable({ - cancel: '.ui-dialog-content', - alsoResize: this.element, - helper: options.resizeHelper, - maxWidth: options.maxWidth, - maxHeight: options.maxHeight, - minWidth: options.minWidth, - minHeight: options.minHeight, - start: function() { - (options.resizeStart && options.resizeStart.apply(self.element[0], arguments)); - if($.browser.msie && $.browser.version < 7 && self.shadow) self.shadow.hide(); - }, - resize: function() { - (options.resize && options.resize.apply(self.element[0], arguments)); - self._refreshShadow(1); - }, - handles: resizeHandles, - stop: function() { - (options.resizeStop && options.resizeStop.apply(self.element[0], arguments)); - $.ui.dialog.overlay.resize(); - if($.browser.msie && $.browser.version < 7 && self.shadow) self.shadow.show(); - self._refreshShadow(); - } - }) - .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se'); - }, - - _position: function(pos) { - var wnd = $(window), doc = $(document), - pTop = doc.scrollTop(), pLeft = doc.scrollLeft(), - minTop = pTop; - - if ($.inArray(pos, ['center','top','right','bottom','left']) >= 0) { - pos = [ - pos == 'right' || pos == 'left' ? pos : 'center', - pos == 'top' || pos == 'bottom' ? pos : 'middle' - ]; - } - if (pos.constructor != Array) { - pos = ['center', 'middle']; - } - if (pos[0].constructor == Number) { - pLeft += pos[0]; - } else { - switch (pos[0]) { - case 'left': - pLeft += 0; - break; - case 'right': - pLeft += wnd.width() - this.uiDialog.outerWidth(); - break; - default: - case 'center': - pLeft += (wnd.width() - this.uiDialog.outerWidth()) / 2; - } - } - if (pos[1].constructor == Number) { - pTop += pos[1]; - } else { - switch (pos[1]) { - case 'top': - pTop += 0; - break; - case 'bottom': - pTop += wnd.height() - this.uiDialog.outerHeight(); - break; - default: - case 'middle': - pTop += (wnd.height() - this.uiDialog.outerHeight()) / 2; - } - } - - // prevent the dialog from being too high (make sure the titlebar - // is accessible) - pTop = Math.max(pTop, minTop); - this.uiDialog.css({top: pTop, left: pLeft}); - }, - - _setData: function(key, value){ - (setDataSwitch[key] && this.uiDialog.data(setDataSwitch[key], value)); - switch (key) { - case "buttons": - this._createButtons(value); - break; - case "closeText": - this.uiDialogTitlebarCloseText.text(value); - break; - case "draggable": - (value - ? this._makeDraggable() - : this.uiDialog.draggable('destroy')); - break; - case "height": - this.uiDialog.height(value); - break; - case "position": - this._position(value); - break; - case "resizable": - var uiDialog = this.uiDialog, - isResizable = this.uiDialog.is(':data(resizable)'); - - // currently resizable, becoming non-resizable - (isResizable && !value && uiDialog.resizable('destroy')); - - // currently resizable, changing handles - (isResizable && typeof value == 'string' && - uiDialog.resizable('option', 'handles', value)); - - // currently non-resizable, becoming resizable - (isResizable || this._makeResizable(value)); - - break; - case "title": - $(".ui-dialog-title", this.uiDialogTitlebar).html(value || ' '); - break; - case "width": - this.uiDialog.width(value); - break; - } - - $.widget.prototype._setData.apply(this, arguments); - }, - - _size: function() { - /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content - * divs will both have width and height set, so we need to reset them - */ - var options = this.options; - - // reset content sizing - this.element.css({ - height: 0, - minHeight: 0, - width: 'auto' - }); - - // reset wrapper sizing - // determine the height of all the non-content elements - var nonContentHeight = this.uiDialog.css({ - height: 'auto', - width: options.width - }) - .height(); - - this.element - .css({ - minHeight: Math.max(options.minHeight - nonContentHeight, 0), - height: options.height == 'auto' - ? 'auto' - : options.height - nonContentHeight - }); - }, - - _createShadow: function() { - this.shadow = $('<div class="ui-widget-shadow"></div>').css('position', 'absolute').appendTo(document.body); - this._refreshShadow(); - return this.shadow; - }, - - _refreshShadow: function(dragging) { - // IE6 is simply to slow to handle the reflow in a good way, so - // resizing only happens on stop, and the shadow is hidden during drag/resize - if(dragging && $.browser.msie && $.browser.version < 7) return; - - var offset = this.uiDialog.offset(); - this.shadow.css({ - left: offset.left, - top: offset.top, - width: this.uiDialog.outerWidth(), - height: this.uiDialog.outerHeight() - }); - }, - - _destroyShadow: function() { - this.shadow.remove(); - this.shadow = null; - } - -}); - -$.extend($.ui.dialog, { - version: "1.6rc6", - defaults: { - autoOpen: true, - bgiframe: false, - buttons: {}, - closeOnEscape: true, - closeText: 'close', - draggable: true, - height: 'auto', - minHeight: 150, - minWidth: 150, - modal: false, - position: 'center', - resizable: true, - shadow: true, - stack: true, - title: '', - width: 300, - zIndex: 1000 - }, - - getter: 'isOpen', - - uuid: 0, - - getTitleId: function($el) { - return 'ui-dialog-title-' + ($el.attr('id') || ++this.uuid); - }, - - overlay: function(dialog) { - this.$el = $.ui.dialog.overlay.create(dialog); - } -}); - -$.extend($.ui.dialog.overlay, { - instances: [], - events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','), - function(event) { return event + '.dialog-overlay'; }).join(' '), - create: function(dialog) { - if (this.instances.length === 0) { - // prevent use of anchors and inputs - // we use a setTimeout in case the overlay is created from an - // event that we're going to be cancelling (see #2804) - setTimeout(function() { - $('a, :input').bind($.ui.dialog.overlay.events, function() { - // allow use of the element if inside a dialog and - // - there are no modal dialogs - // - there are modal dialogs, but we are in front of the topmost modal - var allow = false; - var $dialog = $(this).parents('.ui-dialog'); - if ($dialog.length) { - var $overlays = $('.ui-dialog-overlay'); - if ($overlays.length) { - var maxZ = parseInt($overlays.css('z-index'), 10); - $overlays.each(function() { - maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10)); - }); - allow = parseInt($dialog.css('z-index'), 10) > maxZ; - } else { - allow = true; - } - } - return allow; - }); - }, 1); - - // allow closing by pressing the escape key - $(document).bind('keydown.dialog-overlay', function(event) { - (dialog.options.closeOnEscape && event.keyCode - && event.keyCode == $.ui.keyCode.ESCAPE && dialog.close(event)); - }); - - // handle window resize - $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize); - } - - var $el = $('<div></div>').appendTo(document.body) - .addClass('ui-widget-overlay').css({ - width: this.width(), - height: this.height() - }); - - (dialog.options.bgiframe && $.fn.bgiframe && $el.bgiframe()); - - this.instances.push($el); - return $el; - }, - - destroy: function($el) { - this.instances.splice($.inArray(this.instances, $el), 1); - - if (this.instances.length === 0) { - $('a, :input').add([document, window]).unbind('.dialog-overlay'); - } - - $el.remove(); - }, - - height: function() { - // handle IE 6 - if ($.browser.msie && $.browser.version < 7) { - var scrollHeight = Math.max( - document.documentElement.scrollHeight, - document.body.scrollHeight - ); - var offsetHeight = Math.max( - document.documentElement.offsetHeight, - document.body.offsetHeight - ); - - if (scrollHeight < offsetHeight) { - return $(window).height() + 'px'; - } else { - return scrollHeight + 'px'; - } - // handle "good" browsers - } else { - return $(document).height() + 'px'; - } - }, - - width: function() { - // handle IE 6 - if ($.browser.msie && $.browser.version < 7) { - var scrollWidth = Math.max( - document.documentElement.scrollWidth, - document.body.scrollWidth - ); - var offsetWidth = Math.max( - document.documentElement.offsetWidth, - document.body.offsetWidth - ); - - if (scrollWidth < offsetWidth) { - return $(window).width() + 'px'; - } else { - return scrollWidth + 'px'; - } - // handle "good" browsers - } else { - return $(document).width() + 'px'; - } - }, - - resize: function() { - /* If the dialog is draggable and the user drags it past the - * right edge of the window, the document becomes wider so we - * need to stretch the overlay. If the user then drags the - * dialog back to the left, the document will become narrower, - * so we need to shrink the overlay to the appropriate size. - * This is handled by shrinking the overlay before setting it - * to the full document size. - */ - var $overlays = $([]); - $.each($.ui.dialog.overlay.instances, function() { - $overlays = $overlays.add(this); - }); - - $overlays.css({ - width: 0, - height: 0 - }).css({ - width: $.ui.dialog.overlay.width(), - height: $.ui.dialog.overlay.height() - }); - } -}); - -$.extend($.ui.dialog.overlay.prototype, { - destroy: function() { - $.ui.dialog.overlay.destroy(this.$el); - } -}); - -})(jQuery); -/* - * jQuery UI Effects 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/ - */ -;(function($) { - -$.effects = $.effects || {}; //Add the 'effects' scope - -$.extend($.effects, { - version: "1.6rc6", - - // Saves a set of properties in a data storage - save: function(element, set) { - for(var i=0; i < set.length; i++) { - if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]); - } - }, - - // Restores a set of previously saved properties from a data storage - restore: function(element, set) { - for(var i=0; i < set.length; i++) { - if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i])); - } - }, - - setMode: function(el, mode) { - if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle - return mode; - }, - - getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value - // this should be a little more flexible in the future to handle a string & hash - var y, x; - switch (origin[0]) { - case 'top': y = 0; break; - case 'middle': y = 0.5; break; - case 'bottom': y = 1; break; - default: y = origin[0] / original.height; - }; - switch (origin[1]) { - case 'left': x = 0; break; - case 'center': x = 0.5; break; - case 'right': x = 1; break; - default: x = origin[1] / original.width; - }; - return {x: x, y: y}; - }, - - // Wraps the element around a wrapper that copies position properties - createWrapper: function(element) { - - //if the element is already wrapped, return it - if (element.parent().is('.ui-effects-wrapper')) - return element.parent(); - - //Cache width,height and float properties of the element, and create a wrapper around it - var props = { width: element.outerWidth(true), height: element.outerHeight(true), 'float': element.css('float') }; - element.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>'); - var wrapper = element.parent(); - - //Transfer the positioning of the element to the wrapper - if (element.css('position') == 'static') { - wrapper.css({ position: 'relative' }); - element.css({ position: 'relative'} ); - } else { - var top = element.css('top'); if(isNaN(parseInt(top,10))) top = 'auto'; - var left = element.css('left'); if(isNaN(parseInt(left,10))) left = 'auto'; - wrapper.css({ position: element.css('position'), top: top, left: left, zIndex: element.css('z-index') }).show(); - element.css({position: 'relative', top: 0, left: 0 }); - } - - wrapper.css(props); - return wrapper; - }, - - removeWrapper: function(element) { - if (element.parent().is('.ui-effects-wrapper')) - return element.parent().replaceWith(element); - return element; - }, - - setTransition: function(element, list, factor, value) { - value = value || {}; - $.each(list, function(i, x){ - unit = element.cssUnit(x); - if (unit[0] > 0) value[x] = unit[0] * factor + unit[1]; - }); - return value; - }, - - //Base function to animate from one class to another in a seamless transition - animateClass: function(value, duration, easing, callback) { - - var cb = (typeof easing == "function" ? easing : (callback ? callback : null)); - var ea = (typeof easing == "string" ? easing : null); - - return this.each(function() { - - var offset = {}; var that = $(this); var oldStyleAttr = that.attr("style") || ''; - if(typeof oldStyleAttr == 'object') oldStyleAttr = oldStyleAttr["cssText"]; /* Stupidly in IE, style is a object.. */ - if(value.toggle) { that.hasClass(value.toggle) ? value.remove = value.toggle : value.add = value.toggle; } - - //Let's get a style offset - var oldStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle)); - if(value.add) that.addClass(value.add); if(value.remove) that.removeClass(value.remove); - var newStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle)); - if(value.add) that.removeClass(value.add); if(value.remove) that.addClass(value.remove); - - // The main function to form the object for animation - for(var n in newStyle) { - if( typeof newStyle[n] != "function" && newStyle[n] /* No functions and null properties */ - && n.indexOf("Moz") == -1 && n.indexOf("length") == -1 /* No mozilla spezific render properties. */ - && newStyle[n] != oldStyle[n] /* Only values that have changed are used for the animation */ - && (n.match(/color/i) || (!n.match(/color/i) && !isNaN(parseInt(newStyle[n],10)))) /* Only things that can be parsed to integers or colors */ - && (oldStyle.position != "static" || (oldStyle.position == "static" && !n.match(/left|top|bottom|right/))) /* No need for positions when dealing with static positions */ - ) offset[n] = newStyle[n]; - } - - that.animate(offset, duration, ea, function() { // Animate the newly constructed offset object - // Change style attribute back to original. For stupid IE, we need to clear the damn object. - if(typeof $(this).attr("style") == 'object') { $(this).attr("style")["cssText"] = ""; $(this).attr("style")["cssText"] = oldStyleAttr; } else $(this).attr("style", oldStyleAttr); - if(value.add) $(this).addClass(value.add); if(value.remove) $(this).removeClass(value.remove); - if(cb) cb.apply(this, arguments); - }); - - }); - } -}); - - -function _normalizeArguments(a, m) { - - var o = a[1] && a[1].constructor == Object ? a[1] : {}; if(m) o.mode = m; - var speed = a[1] && a[1].constructor != Object ? a[1] : o.duration; //either comes from options.duration or the second argument - speed = $.fx.off ? 0 : typeof speed === "number" ? speed : $.fx.speeds[speed] || $.fx.speeds._default; - var callback = o.callback || ( $.isFunction(a[2]) && a[2] ) || ( $.isFunction(a[3]) && a[3] ); - - return [a[0], o, speed, callback]; - -} - -//Extend the methods of jQuery -$.fn.extend({ - - //Save old methods - _show: $.fn.show, - _hide: $.fn.hide, - __toggle: $.fn.toggle, - _addClass: $.fn.addClass, - _removeClass: $.fn.removeClass, - _toggleClass: $.fn.toggleClass, - - // New effect methods - effect: function(fx, options, speed, callback) { - return $.effects[fx] ? $.effects[fx].call(this, {method: fx, options: options || {}, duration: speed, callback: callback }) : null; - }, - - show: function() { - if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0]))) - return this._show.apply(this, arguments); - else { - return this.effect.apply(this, _normalizeArguments(arguments, 'show')); - } - }, - - hide: function() { - if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0]))) - return this._hide.apply(this, arguments); - else { - return this.effect.apply(this, _normalizeArguments(arguments, 'hide')); - } - }, - - toggle: function(){ - if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])) || (arguments[0].constructor == Function)) - return this.__toggle.apply(this, arguments); - else { - return this.effect.apply(this, _normalizeArguments(arguments, 'toggle')); - } - }, - - addClass: function(classNames, speed, easing, callback) { - return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames); - }, - removeClass: function(classNames,speed,easing,callback) { - return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames); - }, - toggleClass: function(classNames,speed,easing,callback) { - return ( (typeof speed !== "boolean") && speed ) ? $.effects.animateClass.apply(this, [{ toggle: classNames },speed,easing,callback]) : this._toggleClass(classNames, speed); - }, - morph: function(remove,add,speed,easing,callback) { - return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]); - }, - switchClass: function() { - return this.morph.apply(this, arguments); - }, - - // helper functions - cssUnit: function(key) { - var style = this.css(key), val = []; - $.each( ['em','px','%','pt'], function(i, unit){ - if(style.indexOf(unit) > 0) - val = [parseFloat(style), unit]; - }); - return val; - } -}); - -/* - * jQuery Color Animations - * Copyright 2007 John Resig - * Released under the MIT and GPL licenses. - */ - -// We override the animation for all of these color styles -$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){ - $.fx.step[attr] = function(fx) { - if ( fx.state == 0 ) { - fx.start = getColor( fx.elem, attr ); - fx.end = getRGB( fx.end ); - } - - fx.elem.style[attr] = "rgb(" + [ - Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0],10), 255), 0), - Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1],10), 255), 0), - Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2],10), 255), 0) - ].join(",") + ")"; - }; -}); - -// Color Conversion functions from highlightFade -// By Blair Mitchelmore -// http://jquery.offput.ca/highlightFade/ - -// Parse strings looking for color tuples [255,255,255] -function getRGB(color) { - var result; - - // Check if we're already dealing with an array of colors - if ( color && color.constructor == Array && color.length == 3 ) - return color; - - // Look for rgb(num,num,num) - if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) - return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)]; - - // Look for rgb(num%,num%,num%) - if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) - return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; - - // Look for #a0b1c2 - if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) - return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; - - // Look for #fff - if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) - return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; - - // Look for rgba(0, 0, 0, 0) == transparent in Safari 3 - if (result = /rgba\(0, 0, 0, 0\)/.exec(color)) - return colors['transparent']; - - // Otherwise, we're most likely dealing with a named color - return colors[$.trim(color).toLowerCase()]; -} - -function getColor(elem, attr) { - var color; - - do { - color = $.curCSS(elem, attr); - - // Keep going until we find an element that has color, or we hit the body - if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") ) - break; - - attr = "backgroundColor"; - } while ( elem = elem.parentNode ); - - return getRGB(color); -}; - -// Some named colors to work with -// From Interface by Stefan Petre -// http://interface.eyecon.ro/ - -var colors = { - aqua:[0,255,255], - azure:[240,255,255], - beige:[245,245,220], - black:[0,0,0], - blue:[0,0,255], - brown:[165,42,42], - cyan:[0,255,255], - darkblue:[0,0,139], - darkcyan:[0,139,139], - darkgrey:[169,169,169], - darkgreen:[0,100,0], - darkkhaki:[189,183,107], - darkmagenta:[139,0,139], - darkolivegreen:[85,107,47], - darkorange:[255,140,0], - darkorchid:[153,50,204], - darkred:[139,0,0], - darksalmon:[233,150,122], - darkviolet:[148,0,211], - fuchsia:[255,0,255], - gold:[255,215,0], - green:[0,128,0], - indigo:[75,0,130], - khaki:[240,230,140], - lightblue:[173,216,230], - lightcyan:[224,255,255], - lightgreen:[144,238,144], - lightgrey:[211,211,211], - lightpink:[255,182,193], - lightyellow:[255,255,224], - lime:[0,255,0], - magenta:[255,0,255], - maroon:[128,0,0], - navy:[0,0,128], - olive:[128,128,0], - orange:[255,165,0], - pink:[255,192,203], - purple:[128,0,128], - violet:[128,0,128], - red:[255,0,0], - silver:[192,192,192], - white:[255,255,255], - yellow:[255,255,0], - transparent: [255,255,255] -}; - -/* - * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ - * - * Uses the built in easing capabilities added In jQuery 1.1 - * to offer multiple easing options - * - * TERMS OF USE - jQuery Easing - * - * Open source under the BSD License. - * - * Copyright 2008 George McGinley Smith - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * Neither the name of the author nor the names of contributors may be used to endorse - * or promote products derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * -*/ - -// t: current time, b: begInnIng value, c: change In value, d: duration -$.easing.jswing = $.easing.swing; - -$.extend($.easing, -{ - def: 'easeOutQuad', - swing: function (x, t, b, c, d) { - //alert($.easing.default); - return $.easing[$.easing.def](x, t, b, c, d); - }, - easeInQuad: function (x, t, b, c, d) { - return c*(t/=d)*t + b; - }, - easeOutQuad: function (x, t, b, c, d) { - return -c *(t/=d)*(t-2) + b; - }, - easeInOutQuad: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t + b; - return -c/2 * ((--t)*(t-2) - 1) + b; - }, - easeInCubic: function (x, t, b, c, d) { - return c*(t/=d)*t*t + b; - }, - easeOutCubic: function (x, t, b, c, d) { - return c*((t=t/d-1)*t*t + 1) + b; - }, - easeInOutCubic: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t*t + b; - return c/2*((t-=2)*t*t + 2) + b; - }, - easeInQuart: function (x, t, b, c, d) { - return c*(t/=d)*t*t*t + b; - }, - easeOutQuart: function (x, t, b, c, d) { - return -c * ((t=t/d-1)*t*t*t - 1) + b; - }, - easeInOutQuart: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t*t*t + b; - return -c/2 * ((t-=2)*t*t*t - 2) + b; - }, - easeInQuint: function (x, t, b, c, d) { - return c*(t/=d)*t*t*t*t + b; - }, - easeOutQuint: function (x, t, b, c, d) { - return c*((t=t/d-1)*t*t*t*t + 1) + b; - }, - easeInOutQuint: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; - return c/2*((t-=2)*t*t*t*t + 2) + b; - }, - easeInSine: function (x, t, b, c, d) { - return -c * Math.cos(t/d * (Math.PI/2)) + c + b; - }, - easeOutSine: function (x, t, b, c, d) { - return c * Math.sin(t/d * (Math.PI/2)) + b; - }, - easeInOutSine: function (x, t, b, c, d) { - return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; - }, - easeInExpo: function (x, t, b, c, d) { - return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; - }, - easeOutExpo: function (x, t, b, c, d) { - return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; - }, - easeInOutExpo: function (x, t, b, c, d) { - if (t==0) return b; - if (t==d) return b+c; - if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; - return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; - }, - easeInCirc: function (x, t, b, c, d) { - return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; - }, - easeOutCirc: function (x, t, b, c, d) { - return c * Math.sqrt(1 - (t=t/d-1)*t) + b; - }, - easeInOutCirc: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; - return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; - }, - easeInElastic: function (x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; - }, - easeOutElastic: function (x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; - }, - easeInOutElastic: function (x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; - return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; - }, - easeInBack: function (x, t, b, c, d, s) { - if (s == undefined) s = 1.70158; - return c*(t/=d)*t*((s+1)*t - s) + b; - }, - easeOutBack: function (x, t, b, c, d, s) { - if (s == undefined) s = 1.70158; - return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; - }, - easeInOutBack: function (x, t, b, c, d, s) { - if (s == undefined) s = 1.70158; - if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; - return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; - }, - easeInBounce: function (x, t, b, c, d) { - return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b; - }, - easeOutBounce: function (x, t, b, c, d) { - if ((t/=d) < (1/2.75)) { - return c*(7.5625*t*t) + b; - } else if (t < (2/2.75)) { - return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; - } else if (t < (2.5/2.75)) { - return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; - } else { - return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; - } - }, - easeInOutBounce: function (x, t, b, c, d) { - if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; - return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; - } -}); - -/* - * - * TERMS OF USE - EASING EQUATIONS - * - * Open source under the BSD License. - * - * Copyright 2001 Robert Penner - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * Neither the name of the author nor the names of contributors may be used to endorse - * or promote products derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -})(jQuery); -/* - * jQuery UI Effects Blind 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Blind - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.blind = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode - var direction = o.options.direction || 'vertical'; // Default direction - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper - var ref = (direction == 'vertical') ? 'height' : 'width'; - var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width(); - if(mode == 'show') wrapper.css(ref, 0); // Shift - - // Animation - var animation = {}; - animation[ref] = mode == 'show' ? distance : 0; - - // Animate - wrapper.animate(animation, o.duration, o.options.easing, function() { - if(mode == 'hide') el.hide(); // Hide - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(el[0], arguments); // Callback - el.dequeue(); - }); - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Bounce 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Bounce - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.bounce = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode - var direction = o.options.direction || 'up'; // Default direction - var distance = o.options.distance || 20; // Default distance - var times = o.options.times || 5; // Default # of times - var speed = o.duration || 250; // Default speed per bounce - if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - $.effects.createWrapper(el); // Create Wrapper - var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; - var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; - var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 3 : el.outerWidth({margin:true}) / 3); - if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift - if (mode == 'hide') distance = distance / (times * 2); - if (mode != 'hide') times--; - - // Animate - if (mode == 'show') { // Show Bounce - var animation = {opacity: 1}; - animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance; - el.animate(animation, speed / 2, o.options.easing); - distance = distance / 2; - times--; - }; - for (var i = 0; i < times; i++) { // Bounces - var animation1 = {}, animation2 = {}; - animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance; - animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance; - el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing); - distance = (mode == 'hide') ? distance * 2 : distance / 2; - }; - if (mode == 'hide') { // Last Bounce - var animation = {opacity: 0}; - animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance; - el.animate(animation, speed / 2, o.options.easing, function(){ - el.hide(); // Hide - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(this, arguments); // Callback - }); - } else { - var animation1 = {}, animation2 = {}; - animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance; - animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance; - el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){ - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(this, arguments); // Callback - }); - }; - el.queue('fx', function() { el.dequeue(); }); - el.dequeue(); - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Clip 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Clip - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.clip = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left','height','width']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode - var direction = o.options.direction || 'vertical'; // Default direction - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper - var animate = el[0].tagName == 'IMG' ? wrapper : el; - var ref = { - size: (direction == 'vertical') ? 'height' : 'width', - position: (direction == 'vertical') ? 'top' : 'left' - }; - var distance = (direction == 'vertical') ? animate.height() : animate.width(); - if(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift - - // Animation - var animation = {}; - animation[ref.size] = mode == 'show' ? distance : 0; - animation[ref.position] = mode == 'show' ? 0 : distance / 2; - - // Animate - animate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { - if(mode == 'hide') el.hide(); // Hide - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(el[0], arguments); // Callback - el.dequeue(); - }}); - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Drop 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Drop - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.drop = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left','opacity']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode - var direction = o.options.direction || 'left'; // Default Direction - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - $.effects.createWrapper(el); // Create Wrapper - var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; - var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; - var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2); - if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift - - // Animation - var animation = {opacity: mode == 'show' ? 1 : 0}; - animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; - - // Animate - el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { - if(mode == 'hide') el.hide(); // Hide - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(this, arguments); // Callback - el.dequeue(); - }}); - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Explode 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Explode - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.explode = function(o) { - - return this.queue(function() { - - var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3; - var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3; - - o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode; - var el = $(this).show().css('visibility', 'hidden'); - var offset = el.offset(); - - //Substract the margins - not fixing the problem yet. - offset.top -= parseInt(el.css("marginTop")) || 0; - offset.left -= parseInt(el.css("marginLeft")) || 0; - - var width = el.outerWidth(true); - var height = el.outerHeight(true); - - for(var i=0;i<rows;i++) { // = - for(var j=0;j<cells;j++) { // || - el - .clone() - .appendTo('body') - .wrap('<div></div>') - .css({ - position: 'absolute', - visibility: 'visible', - left: -j*(width/cells), - top: -i*(height/rows) - }) - .parent() - .addClass('ui-effects-explode') - .css({ - position: 'absolute', - overflow: 'hidden', - width: width/cells, - height: height/rows, - left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0), - top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0), - opacity: o.options.mode == 'show' ? 0 : 1 - }).animate({ - left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)), - top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)), - opacity: o.options.mode == 'show' ? 1 : 0 - }, o.duration || 500); - } - } - - // Set a timeout, to call the callback approx. when the other animations have finished - setTimeout(function() { - - o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide(); - if(o.callback) o.callback.apply(el[0]); // Callback - el.dequeue(); - - $('div.ui-effects-explode').remove(); - - }, o.duration || 500); - - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Fold 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Fold - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.fold = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode - var size = o.options.size || 15; // Default fold size - var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value - var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2; - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper - var widthFirst = ((mode == 'show') != horizFirst); - var ref = widthFirst ? ['width', 'height'] : ['height', 'width']; - var distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()]; - var percent = /([0-9]+)%/.exec(size); - if(percent) size = parseInt(percent[1]) / 100 * distance[mode == 'hide' ? 0 : 1]; - if(mode == 'show') wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); // Shift - - // Animation - var animation1 = {}, animation2 = {}; - animation1[ref[0]] = mode == 'show' ? distance[0] : size; - animation2[ref[1]] = mode == 'show' ? distance[1] : 0; - - // Animate - wrapper.animate(animation1, duration, o.options.easing) - .animate(animation2, duration, o.options.easing, function() { - if(mode == 'hide') el.hide(); // Hide - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(el[0], arguments); // Callback - el.dequeue(); - }); - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Highlight 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Highlight - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.highlight = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['backgroundImage','backgroundColor','opacity']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode - var color = o.options.color || "#ffff99"; // Default highlight color - var oldColor = el.css("backgroundColor"); - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - el.css({backgroundImage: 'none', backgroundColor: color}); // Shift - - // Animation - var animation = {backgroundColor: oldColor }; - if (mode == "hide") animation['opacity'] = 0; - - // Animate - el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { - if(mode == "hide") el.hide(); - $.effects.restore(el, props); - if (mode == "show" && $.browser.msie) this.style.removeAttribute('filter'); - if(o.callback) o.callback.apply(this, arguments); - el.dequeue(); - }}); - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Pulsate 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Pulsate - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.pulsate = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this); - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode - var times = o.options.times || 5; // Default # of times - var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2; - - // Adjust - if (mode == 'hide') times--; - if (el.is(':hidden')) { // Show fadeIn - el.css('opacity', 0); - el.show(); // Show - el.animate({opacity: 1}, duration, o.options.easing); - times = times-2; - } - - // Animate - for (var i = 0; i < times; i++) { // Pulsate - el.animate({opacity: 0}, duration, o.options.easing).animate({opacity: 1}, duration, o.options.easing); - }; - if (mode == 'hide') { // Last Pulse - el.animate({opacity: 0}, duration, o.options.easing, function(){ - el.hide(); // Hide - if(o.callback) o.callback.apply(this, arguments); // Callback - }); - } else { - el.animate({opacity: 0}, duration, o.options.easing).animate({opacity: 1}, duration, o.options.easing, function(){ - if(o.callback) o.callback.apply(this, arguments); // Callback - }); - }; - el.queue('fx', function() { el.dequeue(); }); - el.dequeue(); - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Scale 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Scale - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.puff = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this); - - // Set options - var options = $.extend(true, {}, o.options); - var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode - var percent = parseInt(o.options.percent) || 150; // Set default puff percent - options.fade = true; // It's not a puff if it doesn't fade! :) - var original = {height: el.height(), width: el.width()}; // Save original - - // Adjust - var factor = percent / 100; - el.from = (mode == 'hide') ? original : {height: original.height * factor, width: original.width * factor}; - - // Animation - options.from = el.from; - options.percent = (mode == 'hide') ? percent : 100; - options.mode = mode; - - // Animate - el.effect('scale', options, o.duration, o.callback); - el.dequeue(); - }); - -}; - -$.effects.scale = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this); - - // Set options - var options = $.extend(true, {}, o.options); - var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode - var percent = parseInt(o.options.percent) || (parseInt(o.options.percent) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent - var direction = o.options.direction || 'both'; // Set default axis - var origin = o.options.origin; // The origin of the scaling - if (mode != 'effect') { // Set default origin and restore for show/hide - options.origin = origin || ['middle','center']; - options.restore = true; - } - var original = {height: el.height(), width: el.width()}; // Save original - el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state - - // Adjust - var factor = { // Set scaling factor - y: direction != 'horizontal' ? (percent / 100) : 1, - x: direction != 'vertical' ? (percent / 100) : 1 - }; - el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state - - if (o.options.fade) { // Fade option to support puff - if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;}; - if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;}; - }; - - // Animation - options.from = el.from; options.to = el.to; options.mode = mode; - - // Animate - el.effect('size', options, o.duration, o.callback); - el.dequeue(); - }); - -}; - -$.effects.size = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left','width','height','overflow','opacity']; - var props1 = ['position','top','left','overflow','opacity']; // Always restore - var props2 = ['width','height','overflow']; // Copy for children - var cProps = ['fontSize']; - var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom']; - var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode - var restore = o.options.restore || false; // Default restore - var scale = o.options.scale || 'both'; // Default scale mode - var origin = o.options.origin; // The origin of the sizing - var original = {height: el.height(), width: el.width()}; // Save original - el.from = o.options.from || original; // Default from state - el.to = o.options.to || original; // Default to state - // Adjust - if (origin) { // Calculate baseline shifts - var baseline = $.effects.getBaseline(origin, original); - el.from.top = (original.height - el.from.height) * baseline.y; - el.from.left = (original.width - el.from.width) * baseline.x; - el.to.top = (original.height - el.to.height) * baseline.y; - el.to.left = (original.width - el.to.width) * baseline.x; - }; - var factor = { // Set scaling factor - from: {y: el.from.height / original.height, x: el.from.width / original.width}, - to: {y: el.to.height / original.height, x: el.to.width / original.width} - }; - if (scale == 'box' || scale == 'both') { // Scale the css box - if (factor.from.y != factor.to.y) { // Vertical props scaling - props = props.concat(vProps); - el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from); - el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to); - }; - if (factor.from.x != factor.to.x) { // Horizontal props scaling - props = props.concat(hProps); - el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from); - el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to); - }; - }; - if (scale == 'content' || scale == 'both') { // Scale the content - if (factor.from.y != factor.to.y) { // Vertical props scaling - props = props.concat(cProps); - el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from); - el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to); - }; - }; - $.effects.save(el, restore ? props : props1); el.show(); // Save & Show - $.effects.createWrapper(el); // Create Wrapper - el.css('overflow','hidden').css(el.from); // Shift - - // Animate - if (scale == 'content' || scale == 'both') { // Scale the children - vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size - hProps = hProps.concat(['marginLeft','marginRight']); // Add margins - props2 = props.concat(vProps).concat(hProps); // Concat - el.find("*[width]").each(function(){ - child = $(this); - if (restore) $.effects.save(child, props2); - var c_original = {height: child.height(), width: child.width()}; // Save original - child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x}; - child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x}; - if (factor.from.y != factor.to.y) { // Vertical props scaling - child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from); - child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to); - }; - if (factor.from.x != factor.to.x) { // Horizontal props scaling - child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from); - child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to); - }; - child.css(child.from); // Shift children - child.animate(child.to, o.duration, o.options.easing, function(){ - if (restore) $.effects.restore(child, props2); // Restore children - }); // Animate children - }); - }; - - // Animate - el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { - if(mode == 'hide') el.hide(); // Hide - $.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(this, arguments); // Callback - el.dequeue(); - }}); - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Shake 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Shake - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.shake = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode - var direction = o.options.direction || 'left'; // Default direction - var distance = o.options.distance || 20; // Default distance - var times = o.options.times || 3; // Default # of times - var speed = o.duration || o.options.duration || 140; // Default speed per shake - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - $.effects.createWrapper(el); // Create Wrapper - var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; - var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; - - // Animation - var animation = {}, animation1 = {}, animation2 = {}; - animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance; - animation1[ref] = (motion == 'pos' ? '+=' : '-=') + distance * 2; - animation2[ref] = (motion == 'pos' ? '-=' : '+=') + distance * 2; - - // Animate - el.animate(animation, speed, o.options.easing); - for (var i = 1; i < times; i++) { // Shakes - el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing); - }; - el.animate(animation1, speed, o.options.easing). - animate(animation, speed / 2, o.options.easing, function(){ // Last shake - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(this, arguments); // Callback - }); - el.queue('fx', function() { el.dequeue(); }); - el.dequeue(); - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Slide 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Slide - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.slide = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode - var direction = o.options.direction || 'left'; // Default Direction - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper - var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; - var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; - var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true})); - if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); // Shift - - // Animation - var animation = {}; - animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; - - // Animate - el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { - if(mode == 'hide') el.hide(); // Hide - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(this, arguments); // Callback - el.dequeue(); - }}); - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Transfer 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Transfer - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.transfer = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this); - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode - var target = $(o.options.to); // Find Target - var position = el.offset(); - var transfer = $('<div class="ui-effects-transfer"></div>').appendTo(document.body); - if(o.options.className) transfer.addClass(o.options.className); - - // Set target css - transfer.addClass(o.options.className); - transfer.css({ - top: position.top, - left: position.left, - height: el.outerHeight() - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')), - width: el.outerWidth() - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth')), - position: 'absolute' - }); - - // Animation - position = target.offset(); - animation = { - top: position.top, - left: position.left, - height: target.outerHeight() - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')), - width: target.outerWidth() - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth')) - }; - - // Animate - transfer.animate(animation, o.duration, o.options.easing, function() { - transfer.remove(); // Remove div - if(o.callback) o.callback.apply(el[0], arguments); // Callback - el.dequeue(); - }); - - }); - -}; - -})(jQuery); diff --git a/projecttemplates/MvcRelyingParty/Scripts/jquery-ui-personalized-1.6rc6.min.js b/projecttemplates/MvcRelyingParty/Scripts/jquery-ui-personalized-1.6rc6.min.js deleted file mode 100644 index 2d97bb8..0000000 --- a/projecttemplates/MvcRelyingParty/Scripts/jquery-ui-personalized-1.6rc6.min.js +++ /dev/null @@ -1,184 +0,0 @@ -/*
- * jQuery UI 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI
- */
(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.6rc6",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},cssCache:{},css:function(j){if(c.ui.cssCache[j]){return c.ui.cssCache[j]}var k=c('<div class="ui-gen"></div>').addClass(j).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");c.ui.cssCache[j]=!!((!(/auto|default/).test(k.css("cursor"))||(/^[1-9]/).test(k.css("height"))||(/^[1-9]/).test(k.css("width"))||!(/none/).test(k.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(k.css("backgroundColor"))));try{c("body").get(0).removeChild(k.get(0))}catch(l){}return c.ui.cssCache[j]},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=true;this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/*
- * jQuery UI Draggable 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Draggables
- *
- * Depends:
- * ui.core.js
- */
(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-draggable"));(this.options.disabled&&this.element.addClass(this.options.cssNamespace+"-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass(this.options.cssNamespace+"-draggable "+this.options.cssNamespace+"-draggable-dragging "+this.options.cssNamespace+"-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is("."+this.options.cssNamespace+"-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass(c.cssNamespace+"-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body&&a.browser.mozilla)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c)}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop()))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft()))}},_clear:function(){this.helper.removeClass(this.options.cssNamespace+"-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);if(b=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(b){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));a.extend(a.ui.draggable,{version:"1.6rc6",eventPrefix:"drag",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cssNamespace:"ui",cursor:"default",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});a.ui.plugin.add("draggable","connectToSortable",{start:function(b,d){var c=a(this).data("draggable"),e=c.options;c.sortables=[];a(e.connectToSortable).each(function(){a(typeof this=="string"?this+"":this).each(function(){if(a.data(this,"sortable")){var f=a.data(this,"sortable");c.sortables.push({instance:f,shouldRevert:f.options.revert});f._refreshItems();f._trigger("activate",b,c)}})})},stop:function(b,d){var c=a(this).data("draggable");a.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(b);this.instance.options.helper=this.instance.options._helper;if(c.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",b,c)}})},drag:function(c,f){var e=a(this).data("draggable"),b=this;var d=function(i){var n=this.offset.click.top,m=this.offset.click.left;var g=this.positionAbs.top,k=this.positionAbs.left;var j=i.height,l=i.width;var p=i.top,h=i.left;return a.ui.isOver(g+n,k+m,p,h,j,l)};a.each(e.sortables,function(g){if(d.call(e,this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(b).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return f.helper[0]};c.target=this.instance.currentItem[0];this.instance._mouseCapture(c,true);this.instance._mouseStart(c,true,true);this.instance.offset.click.top=e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;e._trigger("toSortable",c);e.dropped=this.instance.element;this.instance.fromOutside=e}if(this.instance.currentItem){this.instance._mouseDrag(c)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._mouseStop(c,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}e._trigger("fromSortable",c);e.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(c,d){var b=a("body"),e=a(this).data("draggable").options;if(b.css("cursor")){e._cursor=b.css("cursor")}b.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._cursor){a("body").css("cursor",d._cursor)}}});a.ui.plugin.add("draggable","iframeFix",{start:function(b,c){var d=a(this).data("draggable").options;a(d.iframeFix===true?"iframe":d.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop+f.scrollSpeed}else{if(d.pageY-c.overflowOffset.top<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop-f.scrollSpeed}}}if(!f.axis||f.axis!="y"){if((c.overflowOffset.left+c.scrollParent[0].offsetWidth)-d.pageX<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft+f.scrollSpeed}else{if(d.pageX-c.overflowOffset.left<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft-f.scrollSpeed}}}}else{if(!f.axis||f.axis!="x"){if(d.pageY-a(document).scrollTop()<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-f.scrollSpeed)}else{if(a(window).height()-(d.pageY-a(document).scrollTop())<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+f.scrollSpeed)}}}if(!f.axis||f.axis!="y"){if(d.pageX-a(document).scrollLeft()<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-f.scrollSpeed)}else{if(a(window).width()-(d.pageX-a(document).scrollLeft())<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+f.scrollSpeed)}}}}if(b!==false&&a.ui.ddmanager&&!f.dropBehaviour){a.ui.ddmanager.prepareOffsets(c,d)}}});a.ui.plugin.add("draggable","snap",{start:function(c,d){var b=a(this).data("draggable"),e=b.options;b.snapElements=[];a(e.snap.constructor!=String?(e.snap.items||":data(draggable)"):e.snap).each(function(){var g=a(this);var f=g.offset();if(this!=b.element[0]){b.snapElements.push({item:this,width:g.outerWidth(),height:g.outerHeight(),top:f.top,left:f.left})}})},drag:function(u,p){var g=a(this).data("draggable"),q=g.options;var y=q.snapTolerance;var x=p.absolutePosition.left,w=x+g.helperProportions.width,f=p.absolutePosition.top,e=f+g.helperProportions.height;for(var v=g.snapElements.length-1;v>=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y<x&&x<n+y&&m-y<f&&f<A+y)||(s-y<x&&x<n+y&&m-y<e&&e<A+y)||(s-y<w&&w<n+y&&m-y<f&&f<A+y)||(s-y<w&&w<n+y&&m-y<e&&e<A+y))){if(g.snapElements[v].snapping){(g.options.snap.release&&g.options.snap.release.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=false;continue}if(q.snapMode!="inner"){var c=Math.abs(m-e)<=y;var z=Math.abs(A-f)<=y;var j=Math.abs(s-w)<=y;var k=Math.abs(n-x)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m-g.helperProportions.height,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s-g.helperProportions.width}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n}).left-g.margins.left}}var h=(c||z||j||k);if(q.snapMode!="outer"){var c=Math.abs(m-f)<=y;var z=Math.abs(A-e)<=y;var j=Math.abs(s-x)<=y;var k=Math.abs(n-w)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A-g.helperProportions.height,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n-g.helperProportions.width}).left-g.margins.left}}if(!g.snapElements[v].snapping&&(c||z||j||k||h)){(g.options.snap.snap&&g.options.snap.snap.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=(c||z||j||k||h)}}});a.ui.plugin.add("draggable","stack",{start:function(b,c){var e=a(this).data("draggable").options;var d=a.makeArray(a(e.stack.group)).sort(function(g,f){return(parseInt(a(g).css("zIndex"),10)||e.stack.min)-(parseInt(a(f).css("zIndex"),10)||e.stack.min)});a(d).each(function(f){this.style.zIndex=e.stack.min+f});this[0].style.zIndex=e.stack.min+d.length}});a.ui.plugin.add("draggable","zIndex",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("zIndex")){e._zIndex=b.css("zIndex")}b.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._zIndex){a(c.helper).css("zIndex",d._zIndex)}}})})(jQuery);;/*
- * jQuery UI Resizable 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Resizables
- *
- * Depends:
- * ui.core.js
- */
(function(b){b.widget("ui.resizable",b.extend({},b.ui.mouse,{_init:function(){var d=this,h=this.options;this.element.addClass("ui-resizable");b.extend(this,{_aspectRatio:!!(h.aspectRatio),aspectRatio:h.aspectRatio,originalElement:this.element,proportionallyResize:h.proportionallyResize?[h.proportionallyResize]:[],_helper:h.helper||h.ghost||h.animate?h.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&b.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(b('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent();this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});if(b.browser.safari&&h.preventDefault){this.originalElement.css("resize","none")}this.proportionallyResize.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=h.handles||(!b(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var j=this.handles.split(",");this.handles={};for(var e=0;e<j.length;e++){var g=b.trim(j[e]),c="ui-resizable-"+g;var f=b('<div class="ui-resizable-handle '+c+'"></div>');if(/sw|se|ne|nw/.test(g)){f.css({zIndex:++h.zIndex})}if("se"==g){f.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[g]=".ui-resizable-"+g;this.element.append(f)}}this._renderAxis=function(o){o=o||this.element;for(var l in this.handles){if(this.handles[l].constructor==String){this.handles[l]=b(this.handles[l],this.element).show()}if(h.transparent){this.handles[l].css({opacity:0})}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var m=b(this.handles[l],this.element),n=0;n=/sw|ne|nw|se|n|s/.test(l)?m.outerHeight():m.outerWidth();var k=["padding",/ne|nw|n/.test(l)?"Top":/se|sw|s/.test(l)?"Bottom":/^e$/.test(l)?"Right":"Left"].join("");if(!h.transparent){o.css(k,n)}this._proportionallyResize()}if(!b(this.handles[l]).length){continue}}};this._renderAxis(this.element);this._handles=b(".ui-resizable-handle",this.element);if(h.disableSelection){this._handles.disableSelection()}this._handles.mouseover(function(){if(!d.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}d.axis=i&&i[1]?i[1]:"se"}});if(h.autoHide){this._handles.hide();b(this.element).addClass("ui-resizable-autohide").hover(function(){b(this).removeClass("ui-resizable-autohide");d._handles.show()},function(){if(!d.resizing){b(this).addClass("ui-resizable-autohide");d._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var c=function(d){b(d).removeClass("ui-resizable ui-resizable-disabled").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){c(this.element);this.wrapper.parent().append(this.originalElement.css({position:this.wrapper.css("position"),width:this.wrapper.outerWidth(),height:this.wrapper.outerHeight(),top:this.wrapper.css("top"),left:this.wrapper.css("left")})).end().remove()}c(this.originalElement)},_mouseCapture:function(d){var e=false;for(var c in this.handles){if(b(this.handles[c])[0]==d.target){e=true}}return this.options.disabled||!!e},_mouseStart:function(e){var h=this.options,d=this.element.position(),c=this.element;this.resizing=true;this.documentScroll={top:b(document).scrollTop(),left:b(document).scrollLeft()};if(c.is(".ui-draggable")||(/absolute/).test(c.css("position"))){c.css({position:"absolute",top:d.top,left:d.left})}if(b.browser.opera&&(/relative/).test(c.css("position"))){c.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var i=a(this.helper.css("left")),f=a(this.helper.css("top"));if(h.containment){i+=b(h.containment).scrollLeft()||0;f+=b(h.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:i,top:f};this.size=this._helper?{width:c.outerWidth(),height:c.outerHeight()}:{width:c.width(),height:c.height()};this.originalSize=this._helper?{width:c.outerWidth(),height:c.outerHeight()}:{width:c.width(),height:c.height()};this.originalPosition={left:i,top:f};this.sizeDiff={width:c.outerWidth()-c.width(),height:c.outerHeight()-c.height()};this.originalMousePosition={left:e.pageX,top:e.pageY};this.aspectRatio=(typeof h.aspectRatio=="number")?h.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);if(h.preserveCursor){var g=b(".ui-resizable-"+this.axis).css("cursor");b("body").css("cursor",g=="auto"?this.axis+"-resize":g)}this._propagate("start",e);return true},_mouseDrag:function(c){var f=this.helper,e=this.options,k={},n=this,h=this.originalMousePosition,l=this.axis;var p=(c.pageX-h.left)||0,m=(c.pageY-h.top)||0;var g=this._change[l];if(!g){return false}var j=g.apply(this,[c,p,m]),i=b.browser.msie&&b.browser.version<7,d=this.sizeDiff;if(this._aspectRatio||c.shiftKey){j=this._updateRatio(j,c)}j=this._respectSize(j,c);this._propagate("resize",c);f.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this.proportionallyResize.length){this._proportionallyResize()}this._updateCache(j);this._trigger("resize",c,this.ui());return false},_mouseStop:function(f){this.resizing=false;var g=this.options,k=this;if(this._helper){var e=this.proportionallyResize,c=e.length&&(/textarea/i).test(e[0].nodeName),d=c&&b.ui.hasScroll(e[0],"left")?0:k.sizeDiff.height,i=c?0:k.sizeDiff.width;var l={width:(k.size.width-i),height:(k.size.height-d)},h=(parseInt(k.element.css("left"),10)+(k.position.left-k.originalPosition.left))||null,j=(parseInt(k.element.css("top"),10)+(k.position.top-k.originalPosition.top))||null;if(!g.animate){this.element.css(b.extend(l,{top:j,left:h}))}if(this._helper&&!g.animate){this._proportionallyResize()}}if(g.preserveCursor){b("body").css("cursor","auto")}this._propagate("stop",f);if(this._helper){this.helper.remove()}return false},_updateCache:function(c){var d=this.options;this.offset=this.helper.offset();if(c.left){this.position.left=c.left}if(c.top){this.position.top=c.top}if(c.height){this.size.height=c.height}if(c.width){this.size.width=c.width}},_updateRatio:function(f,e){var g=this.options,h=this.position,d=this.size,c=this.axis;if(f.height){f.width=(d.height*this.aspectRatio)}else{if(f.width){f.height=(d.width/this.aspectRatio)}}if(c=="sw"){f.left=h.left+(d.width-f.width);f.top=null}if(c=="nw"){f.top=h.top+(d.height-f.height);f.left=h.left+(d.width-f.width)}return f},_respectSize:function(j,e){var r=function(o){return !isNaN(parseInt(o,10))};var h=this.helper,g=this.options,p=this._aspectRatio||e.shiftKey,n=this.axis,s=r(j.width)&&g.maxWidth&&(g.maxWidth<j.width),k=r(j.height)&&g.maxHeight&&(g.maxHeight<j.height),f=r(j.width)&&g.minWidth&&(g.minWidth>j.width),q=r(j.height)&&g.minHeight&&(g.minHeight>j.height);if(f){j.width=g.minWidth}if(q){j.height=g.minHeight}if(s){j.width=g.maxWidth}if(k){j.height=g.maxHeight}var d=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height;var i=/sw|nw|w/.test(n),c=/nw|ne|n/.test(n);if(f&&i){j.left=d-g.minWidth}if(s&&i){j.left=d-g.maxWidth}if(q&&c){j.top=m-g.minHeight}if(k&&c){j.top=m-g.maxHeight}var l=!j.width&&!j.height;if(l&&!j.left&&j.top){j.top=null}else{if(l&&!j.top&&j.left){j.left=null}}return j},_proportionallyResize:function(){var h=this.options;if(!this.proportionallyResize.length){return}var e=this.helper||this.element;for(var d=0;d<this.proportionallyResize.length;d++){var f=this.proportionallyResize[d];if(!this.borderDif){var c=[f.css("borderTopWidth"),f.css("borderRightWidth"),f.css("borderBottomWidth"),f.css("borderLeftWidth")],g=[f.css("paddingTop"),f.css("paddingRight"),f.css("paddingBottom"),f.css("paddingLeft")];this.borderDif=b.map(c,function(j,l){var k=parseInt(j,10)||0,m=parseInt(g[l],10)||0;return k+m})}if(b.browser.msie&&!(!(b(e).is(":hidden")||b(e).parents(":hidden").length))){continue}f.css({height:(e.height()-this.borderDif[0]-this.borderDif[2])||0,width:(e.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var d=this.element,g=this.options;this.elementOffset=d.offset();if(this._helper){this.helper=this.helper||b('<div style="overflow:hidden;"></div>');var c=b.browser.msie&&b.browser.version<7,e=(c?1:0),f=(c?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++g.zIndex});this.helper.appendTo("body");if(g.disableSelection){this.helper.disableSelection()}}else{this.helper=this.element}},_change:{e:function(e,d,c){return{width:this.originalSize.width+d}},w:function(f,d,c){var h=this.options,e=this.originalSize,g=this.originalPosition;return{left:g.left+d,width:e.width-d}},n:function(f,d,c){var h=this.options,e=this.originalSize,g=this.originalPosition;return{top:g.top+c,height:e.height-c}},s:function(e,d,c){return{height:this.originalSize.height+c}},se:function(e,d,c){return b.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,d,c]))},sw:function(e,d,c){return b.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,d,c]))},ne:function(e,d,c){return b.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,d,c]))},nw:function(e,d,c){return b.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,d,c]))}},_propagate:function(d,c){b.ui.plugin.call(this,d,[c,this.ui()]);(d!="resize"&&this._trigger(d,c,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));b.extend(b.ui.resizable,{version:"1.6rc6",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,disableSelection:true,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,preserveCursor:true,preventDefault:true,proportionallyResize:false,transparent:false,zIndex:1000}});b.ui.plugin.add("resizable","alsoResize",{start:function(d,e){var c=b(this).data("resizable"),f=c.options;_store=function(g){b(g).each(function(){b(this).data("resizable-alsoresize",{width:parseInt(b(this).width(),10),height:parseInt(b(this).height(),10),left:parseInt(b(this).css("left"),10),top:parseInt(b(this).css("top"),10)})})};if(typeof(f.alsoResize)=="object"&&!f.alsoResize.parentNode){if(f.alsoResize.length){f.alsoResize=f.alsoResize[0];_store(f.alsoResize)}else{b.each(f.alsoResize,function(g,h){_store(g)})}}else{_store(f.alsoResize)}},resize:function(e,g){var d=b(this).data("resizable"),h=d.options,f=d.originalSize,j=d.originalPosition;var i={height:(d.size.height-f.height)||0,width:(d.size.width-f.width)||0,top:(d.position.top-j.top)||0,left:(d.position.left-j.left)||0},c=function(k,l){b(k).each(function(){var o=b(this),p=b(this).data("resizable-alsoresize"),n={},m=l&&l.length?l:["width","height","top","left"];b.each(m||["width","height","top","left"],function(q,s){var r=(p[s]||0)+(i[s]||0);if(r&&r>=0){n[s]=r||null}});if(/relative/.test(o.css("position"))&&b.browser.opera){d._revertToRelativePosition=true;o.css({position:"absolute",top:"auto",left:"auto"})}o.css(n)})};if(typeof(h.alsoResize)=="object"&&!h.alsoResize.nodeType){b.each(h.alsoResize,function(k,l){c(k,l)})}else{c(h.alsoResize)}},stop:function(d,e){var c=b(this).data("resizable");if(c._revertToRelativePosition&&b.browser.opera){c._revertToRelativePosition=false;el.css({position:"relative"})}b(this).removeData("resizable-alsoresize-start")}});b.ui.plugin.add("resizable","animate",{stop:function(g,l){var m=b(this).data("resizable"),h=m.options;var f=h.proportionallyResize,c=f&&(/textarea/i).test(f.get(0).nodeName),d=c&&b.ui.hasScroll(f.get(0),"left")?0:m.sizeDiff.height,j=c?0:m.sizeDiff.width;var e={width:(m.size.width-j),height:(m.size.height-d)},i=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,k=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;m.element.animate(b.extend(e,k&&i?{top:k,left:i}:{}),{duration:h.animateDuration,easing:h.animateEasing,step:function(){var n={width:parseInt(m.element.css("width"),10),height:parseInt(m.element.css("height"),10),top:parseInt(m.element.css("top"),10),left:parseInt(m.element.css("left"),10)};if(f){f.css({width:n.width,height:n.height})}m._updateCache(n);m._propagate("resize",g)}})}});b.ui.plugin.add("resizable","containment",{start:function(d,n){var r=b(this).data("resizable"),h=r.options,j=r.element;var e=h.containment,i=(e instanceof b)?e.get(0):(/parent/.test(e))?j.parent().get(0):e;if(!i){return}r.containerElement=b(i);if(/document/.test(e)||e==document){r.containerOffset={left:0,top:0};r.containerPosition={left:0,top:0};r.parentData={element:b(document),left:0,top:0,width:b(document).width(),height:b(document).height()||document.body.parentNode.scrollHeight}}else{var l=b(i),g=[];b(["Top","Right","Left","Bottom"]).each(function(p,o){g[p]=a(l.css("padding"+o))});r.containerOffset=l.offset();r.containerPosition=l.position();r.containerSize={height:(l.innerHeight()-g[3]),width:(l.innerWidth()-g[1])};var m=r.containerOffset,c=r.containerSize.height,k=r.containerSize.width,f=(b.ui.hasScroll(i,"left")?i.scrollWidth:k),q=(b.ui.hasScroll(i)?i.scrollHeight:c);r.parentData={element:i,left:m.left,top:m.top,width:f,height:q}}},resize:function(e,l){var p=b(this).data("resizable"),g=p.options,d=p.containerSize,k=p.containerOffset,i=p.size,j=p.position,m=g._aspectRatio||e.shiftKey,c={top:0,left:0},f=p.containerElement;if(f[0]!=document&&(/static/).test(f.css("position"))){c=k}if(j.left<(p._helper?k.left:0)){p.size.width=p.size.width+(p._helper?(p.position.left-k.left):(p.position.left-c.left));if(m){p.size.height=p.size.width/g.aspectRatio}p.position.left=g.helper?k.left:0}if(j.top<(p._helper?k.top:0)){p.size.height=p.size.height+(p._helper?(p.position.top-k.top):p.position.top);if(m){p.size.width=p.size.height*g.aspectRatio}p.position.top=p._helper?k.top:0}var h=Math.abs((p._helper?p.offset.left-c.left:(p.offset.left-c.left))+p.sizeDiff.width),n=Math.abs((p._helper?p.offset.top-c.top:(p.offset.top-k.top))+p.sizeDiff.height);if(h+p.size.width>=p.parentData.width){p.size.width=p.parentData.width-h;if(m){p.size.height=p.size.width/g.aspectRatio}}if(n+p.size.height>=p.parentData.height){p.size.height=p.parentData.height-n;if(m){p.size.width=p.size.height*g.aspectRatio}}},stop:function(d,l){var n=b(this).data("resizable"),e=n.options,j=n.position,k=n.containerOffset,c=n.containerPosition,f=n.containerElement;var g=b(n.helper),p=g.offset(),m=g.outerWidth()-n.sizeDiff.width,i=g.outerHeight()-n.sizeDiff.height;if(n._helper&&!e.animate&&(/relative/).test(f.css("position"))){b(this).css({left:p.left-c.left-k.left,width:m,height:i})}if(n._helper&&!e.animate&&(/static/).test(f.css("position"))){b(this).css({left:p.left-c.left-k.left,width:m,height:i})}}});b.ui.plugin.add("resizable","ghost",{start:function(e,f){var c=b(this).data("resizable"),g=c.options,h=g.proportionallyResize,d=c.size;c.ghost=c.originalElement.clone();c.ghost.css({opacity:0.25,display:"block",position:"relative",height:d.height,width:d.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof g.ghost=="string"?g.ghost:"");c.ghost.appendTo(c.helper)},resize:function(d,e){var c=b(this).data("resizable"),f=c.options;if(c.ghost){c.ghost.css({position:"relative",height:c.size.height,width:c.size.width})}},stop:function(d,e){var c=b(this).data("resizable"),f=c.options;if(c.ghost&&c.helper){c.helper.get(0).removeChild(c.ghost.get(0))}}});b.ui.plugin.add("resizable","grid",{resize:function(c,k){var m=b(this).data("resizable"),f=m.options,i=m.size,g=m.originalSize,h=m.originalPosition,l=m.axis,j=f._aspectRatio||c.shiftKey;f.grid=typeof f.grid=="number"?[f.grid,f.grid]:f.grid;var e=Math.round((i.width-g.width)/(f.grid[0]||1))*(f.grid[0]||1),d=Math.round((i.height-g.height)/(f.grid[1]||1))*(f.grid[1]||1);if(/^(se|s|e)$/.test(l)){m.size.width=g.width+e;m.size.height=g.height+d}else{if(/^(ne)$/.test(l)){m.size.width=g.width+e;m.size.height=g.height+d;m.position.top=h.top-d}else{if(/^(sw)$/.test(l)){m.size.width=g.width+e;m.size.height=g.height+d;m.position.left=h.left-e}else{m.size.width=g.width+e;m.size.height=g.height+d;m.position.top=h.top-d;m.position.left=h.left-e}}}}});var a=function(c){return parseInt(c,10)||0}})(jQuery);;/*
- * jQuery UI Dialog 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Dialog
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- * ui.resizable.js
- */
(function(b){var a={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"};b.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var k=this,l=this.options,i=l.title||this.originalTitle||" ",d=b.ui.dialog.getTitleId(this.element),j=(this.uiDialog=b("<div/>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+l.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:l.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(m){(l.closeOnEscape&&m.keyCode&&m.keyCode==b.ui.keyCode.ESCAPE&&k.close(m))}).attr({role:"dialog","aria-labelledby":d}).mousedown(function(m){k.moveToTop(m)}),f=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(j),e=(this.uiDialogTitlebar=b("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(j),h=b('<a href="#"/>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).mousedown(function(m){m.stopPropagation()}).click(function(m){k.close(m);return false}).appendTo(e),g=(this.uiDialogTitlebarCloseText=b("<span/>")).addClass("ui-icon ui-icon-closethick").text(l.closeText).appendTo(h),c=b("<span/>").addClass("ui-dialog-title").attr("id",d).html(i).prependTo(e);e.find("*").add(e).disableSelection();(l.draggable&&b.fn.draggable&&this._makeDraggable());(l.resizable&&b.fn.resizable&&this._makeResizable());this._createButtons(l.buttons);this._isOpen=false;(l.bgiframe&&b.fn.bgiframe&&j.bgiframe());(l.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());(this.shadow&&this._destroyShadow());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(c){if(false===this._trigger("beforeclose",c)){return}(this.overlay&&this.overlay.destroy());(this.shadow&&this._destroyShadow());this.uiDialog.hide(this.options.hide).unbind("keypress.ui-dialog");this._trigger("close",c);b.ui.dialog.overlay.resize();this._isOpen=false},isOpen:function(){return this._isOpen},moveToTop:function(g,f){if((this.options.modal&&!g)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",f)}var e=this.options.zIndex,d=this.options;b(".ui-dialog:visible").each(function(){e=Math.max(e,parseInt(b(this).css("z-index"),10)||d.zIndex)});(this.overlay&&this.overlay.$el.css("z-index",++e));(this.shadow&&this.shadow.css("z-index",++e));var c={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++e);this.element.attr(c);this._trigger("focus",f)},open:function(e){if(this._isOpen){return}var d=this.options,c=this.uiDialog;this.overlay=d.modal?new b.ui.dialog.overlay(this):null;(c.next().length&&c.appendTo("body"));this._size();this._position(d.position);c.show(d.show);this.moveToTop(true,e);(d.modal&&c.bind("keypress.ui-dialog",function(h){if(h.keyCode!=b.ui.keyCode.TAB){return}var g=b(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));b([]).add(c.find(".ui-dialog-content :tabbable:first")).add(c.find(".ui-dialog-buttonpane :tabbable:first")).add(c.find(".ui-dialog-titlebar :tabbable:first")).filter(":first").focus();if(d.shadow){this._createShadow()}this._trigger("open",e);this._isOpen=true},_createButtons:function(f){var e=this,c=false,d=b("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof f=="object"&&f!==null&&b.each(f,function(){return !(c=true)}));if(c){b.each(f,function(g,h){b('<button type="button"></button>').addClass("ui-state-default ui-corner-all").text(g).click(function(){h.apply(e.element[0],arguments)}).hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")}).focus(function(){b(this).addClass("ui-state-focus")}).blur(function(){b(this).removeClass("ui-state-focus")}).appendTo(d)});d.appendTo(this.uiDialog)}},_makeDraggable:function(){var c=this,d=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content",helper:d.dragHelper,handle:".ui-dialog-titlebar",containment:"document",start:function(){(d.dragStart&&d.dragStart.apply(c.element[0],arguments));if(b.browser.msie&&b.browser.version<7&&c.shadow){c.shadow.hide()}},drag:function(){(d.drag&&d.drag.apply(c.element[0],arguments));c._refreshShadow(1)},stop:function(){(d.dragStop&&d.dragStop.apply(c.element[0],arguments));b.ui.dialog.overlay.resize();if(b.browser.msie&&b.browser.version<7&&c.shadow){c.shadow.show()}c._refreshShadow()}})},_makeResizable:function(f){f=(f===undefined?this.options.resizable:f);var c=this,e=this.options,d=typeof f=="string"?f:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,helper:e.resizeHelper,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:e.minHeight,start:function(){(e.resizeStart&&e.resizeStart.apply(c.element[0],arguments));if(b.browser.msie&&b.browser.version<7&&c.shadow){c.shadow.hide()}},resize:function(){(e.resize&&e.resize.apply(c.element[0],arguments));c._refreshShadow(1)},handles:d,stop:function(){(e.resizeStop&&e.resizeStop.apply(c.element[0],arguments));b.ui.dialog.overlay.resize();if(b.browser.msie&&b.browser.version<7&&c.shadow){c.shadow.show()}c._refreshShadow()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(h){var d=b(window),e=b(document),f=e.scrollTop(),c=e.scrollLeft(),g=f;if(b.inArray(h,["center","top","right","bottom","left"])>=0){h=[h=="right"||h=="left"?h:"center",h=="top"||h=="bottom"?h:"middle"]}if(h.constructor!=Array){h=["center","middle"]}if(h[0].constructor==Number){c+=h[0]}else{switch(h[0]){case"left":c+=0;break;case"right":c+=d.width()-this.uiDialog.outerWidth();break;default:case"center":c+=(d.width()-this.uiDialog.outerWidth())/2}}if(h[1].constructor==Number){f+=h[1]}else{switch(h[1]){case"top":f+=0;break;case"bottom":f+=d.height()-this.uiDialog.outerHeight();break;default:case"middle":f+=(d.height()-this.uiDialog.outerHeight())/2}}f=Math.max(f,g);this.uiDialog.css({top:f,left:c})},_setData:function(d,e){(a[d]&&this.uiDialog.data(a[d],e));switch(d){case"buttons":this._createButtons(e);break;case"closeText":this.uiDialogTitlebarCloseText.text(e);break;case"draggable":(e?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(e);break;case"position":this._position(e);break;case"resizable":var c=this.uiDialog,f=this.uiDialog.is(":data(resizable)");(f&&!e&&c.resizable("destroy"));(f&&typeof e=="string"&&c.resizable("option","handles",e));(f||this._makeResizable(e));break;case"title":b(".ui-dialog-title",this.uiDialogTitlebar).html(e||" ");break;case"width":this.uiDialog.width(e);break}b.widget.prototype._setData.apply(this,arguments)},_size:function(){var d=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var c=this.uiDialog.css({height:"auto",width:d.width}).height();this.element.css({minHeight:Math.max(d.minHeight-c,0),height:d.height=="auto"?"auto":d.height-c})},_createShadow:function(){this.shadow=b('<div class="ui-widget-shadow"></div>').css("position","absolute").appendTo(document.body);this._refreshShadow();return this.shadow},_refreshShadow:function(c){if(c&&b.browser.msie&&b.browser.version<7){return}var d=this.uiDialog.offset();this.shadow.css({left:d.left,top:d.top,width:this.uiDialog.outerWidth(),height:this.uiDialog.outerHeight()})},_destroyShadow:function(){this.shadow.remove();this.shadow=null}});b.extend(b.ui.dialog,{version:"1.6rc6",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",draggable:true,height:"auto",minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,shadow:true,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,getTitleId:function(c){return"ui-dialog-title-"+(c.attr("id")||++this.uuid)},overlay:function(c){this.$el=b.ui.dialog.overlay.create(c)}});b.extend(b.ui.dialog.overlay,{instances:[],events:b.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(c){return c+".dialog-overlay"}).join(" "),create:function(d){if(this.instances.length===0){setTimeout(function(){b("a, :input").bind(b.ui.dialog.overlay.events,function(){var f=false;var h=b(this).parents(".ui-dialog");if(h.length){var e=b(".ui-dialog-overlay");if(e.length){var g=parseInt(e.css("z-index"),10);e.each(function(){g=Math.max(g,parseInt(b(this).css("z-index"),10))});f=parseInt(h.css("z-index"),10)>g}else{f=true}}return f})},1);b(document).bind("keydown.dialog-overlay",function(e){(d.options.closeOnEscape&&e.keyCode&&e.keyCode==b.ui.keyCode.ESCAPE&&d.close(e))});b(window).bind("resize.dialog-overlay",b.ui.dialog.overlay.resize)}var c=b("<div></div>").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(d.options.bgiframe&&b.fn.bgiframe&&c.bgiframe());this.instances.push(c);return c},destroy:function(c){this.instances.splice(b.inArray(this.instances,c),1);if(this.instances.length===0){b("a, :input").add([document,window]).unbind(".dialog-overlay")}c.remove()},height:function(){if(b.browser.msie&&b.browser.version<7){var d=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(d<c){return b(window).height()+"px"}else{return d+"px"}}else{return b(document).height()+"px"}},width:function(){if(b.browser.msie&&b.browser.version<7){var c=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var d=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(c<d){return b(window).width()+"px"}else{return c+"px"}}else{return b(document).width()+"px"}},resize:function(){var c=b([]);b.each(b.ui.dialog.overlay.instances,function(){c=c.add(this)});c.css({width:0,height:0}).css({width:b.ui.dialog.overlay.width(),height:b.ui.dialog.overlay.height()})}});b.extend(b.ui.dialog.overlay.prototype,{destroy:function(){b.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);;/*
- * jQuery UI Effects 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/
- */
(function(d){d.effects=d.effects||{};d.extend(d.effects,{version:"1.6rc6",save:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.data("ec.storage."+h[f],g[0].style[h[f]])}}},restore:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.css(h[f],g.data("ec.storage."+h[f]))}}},setMode:function(f,g){if(g=="toggle"){g=f.is(":hidden")?"show":"hide"}return g},getBaseline:function(g,h){var i,f;switch(g[0]){case"top":i=0;break;case"middle":i=0.5;break;case"bottom":i=1;break;default:i=g[0]/h.height}switch(g[1]){case"left":f=0;break;case"center":f=0.5;break;case"right":f=1;break;default:f=g[1]/h.width}return{x:f,y:i}},createWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent()}var g={width:f.outerWidth(true),height:f.outerHeight(true),"float":f.css("float")};f.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}});function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:i.duration;h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(arguments[0].constructor==Function)){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return -(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f},easeOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return h*Math.pow(2,-10*i)*Math.sin((i*l-j)*(2*Math.PI)/k)+m+f},easeInOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l/2)==2){return f+m}if(!k){k=l*(0.3*1.5)}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}if(i<1){return -0.5*(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f}return h*Math.pow(2,-10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k)*0.5+m+f},easeInBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*(h/=j)*h*((i+1)*h-i)+f},easeOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*((h=h/j-1)*h*((i+1)*h+i)+1)+f},easeInOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}if((h/=j/2)<1){return k/2*(h*h*(((i*=(1.525))+1)*h-i))+f}return k/2*((h-=2)*h*(((i*=(1.525))+1)*h+i)+2)+f},easeInBounce:function(g,h,f,j,i){return j-d.easing.easeOutBounce(g,i-h,0,j,i)+f},easeOutBounce:function(g,h,f,j,i){if((h/=i)<(1/2.75)){return j*(7.5625*h*h)+f}else{if(h<(2/2.75)){return j*(7.5625*(h-=(1.5/2.75))*h+0.75)+f}else{if(h<(2.5/2.75)){return j*(7.5625*(h-=(2.25/2.75))*h+0.9375)+f}else{return j*(7.5625*(h-=(2.625/2.75))*h+0.984375)+f}}}},easeInOutBounce:function(g,h,f,j,i){if(h<i/2){return d.easing.easeInBounce(g,h*2,0,j,i)*0.5+f}return d.easing.easeOutBounce(g,h*2-i,0,j,i)*0.5+j*0.5+f}})})(jQuery);;/*
- * jQuery UI Effects Blind 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Blind
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.blind=function(b){return this.queue(function(){var d=a(this),c=["position","top","left"];var h=a.effects.setMode(d,b.options.mode||"hide");var g=b.options.direction||"vertical";a.effects.save(d,c);d.show();var j=a.effects.createWrapper(d).css({overflow:"hidden"});var e=(g=="vertical")?"height":"width";var i=(g=="vertical")?j.height():j.width();if(h=="show"){j.css(e,0)}var f={};f[e]=h=="show"?i:0;j.animate(f,b.duration,b.options.easing,function(){if(h=="hide"){d.hide()}a.effects.restore(d,c);a.effects.removeWrapper(d);if(b.callback){b.callback.apply(d[0],arguments)}d.dequeue()})})}})(jQuery);;/*
- * jQuery UI Effects Bounce 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Bounce
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.bounce=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"up";var c=b.options.distance||20;var d=b.options.times||5;var g=b.duration||250;if(/show|hide/.test(k)){l.push("opacity")}a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var c=b.options.distance||(f=="top"?e.outerHeight({margin:true})/3:e.outerWidth({margin:true})/3);if(k=="show"){e.css("opacity",0).css(f,p=="pos"?-c:c)}if(k=="hide"){c=c/(d*2)}if(k!="hide"){d--}if(k=="show"){var h={opacity:1};h[f]=(p=="pos"?"+=":"-=")+c;e.animate(h,g/2,b.options.easing);c=c/2;d--}for(var j=0;j<d;j++){var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing);c=(k=="hide")?c*2:c/2}if(k=="hide"){var h={opacity:0};h[f]=(p=="pos"?"-=":"+=")+c;e.animate(h,g/2,b.options.easing,function(){e.hide();a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}else{var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/*
- * jQuery UI Effects Clip 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Clip
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.clip=function(b){return this.queue(function(){var f=a(this),j=["position","top","left","height","width"];var i=a.effects.setMode(f,b.options.mode||"hide");var k=b.options.direction||"vertical";a.effects.save(f,j);f.show();var c=a.effects.createWrapper(f).css({overflow:"hidden"});var e=f[0].tagName=="IMG"?c:f;var g={size:(k=="vertical")?"height":"width",position:(k=="vertical")?"top":"left"};var d=(k=="vertical")?e.height():e.width();if(i=="show"){e.css(g.size,0);e.css(g.position,d/2)}var h={};h[g.size]=i=="show"?d:0;h[g.position]=i=="show"?0:d/2;e.animate(h,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){f.hide()}a.effects.restore(f,j);a.effects.removeWrapper(f);if(b.callback){b.callback.apply(f[0],arguments)}f.dequeue()}})})}})(jQuery);;/*
- * jQuery UI Effects Drop 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Drop
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.drop=function(b){return this.queue(function(){var e=a(this),d=["position","top","left","opacity"];var i=a.effects.setMode(e,b.options.mode||"hide");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e);var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true})/2:e.outerWidth({margin:true})/2);if(i=="show"){e.css("opacity",0).css(f,c=="pos"?-j:j)}var g={opacity:i=="show"?1:0};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/*
- * jQuery UI Effects Explode 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Explode
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.explode=function(b){return this.queue(function(){var k=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;var e=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?(a(this).is(":visible")?"hide":"show"):b.options.mode;var h=a(this).show().css("visibility","hidden");var l=h.offset();l.top-=parseInt(h.css("marginTop"))||0;l.left-=parseInt(h.css("marginLeft"))||0;var g=h.outerWidth(true);var c=h.outerHeight(true);for(var f=0;f<k;f++){for(var d=0;d<e;d++){h.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-d*(g/e),top:-f*(c/k)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/e,height:c/k,left:l.left+d*(g/e)+(b.options.mode=="show"?(d-Math.floor(e/2))*(g/e):0),top:l.top+f*(c/k)+(b.options.mode=="show"?(f-Math.floor(k/2))*(c/k):0),opacity:b.options.mode=="show"?0:1}).animate({left:l.left+d*(g/e)+(b.options.mode=="show"?0:(d-Math.floor(e/2))*(g/e)),top:l.top+f*(c/k)+(b.options.mode=="show"?0:(f-Math.floor(k/2))*(c/k)),opacity:b.options.mode=="show"?1:0},b.duration||500)}}setTimeout(function(){b.options.mode=="show"?h.css({visibility:"visible"}):h.css({visibility:"visible"}).hide();if(b.callback){b.callback.apply(h[0])}h.dequeue();a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);;/*
- * jQuery UI Effects Fold 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Fold
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.fold=function(b){return this.queue(function(){var e=a(this),k=["position","top","left"];var h=a.effects.setMode(e,b.options.mode||"hide");var o=b.options.size||15;var n=!(!b.options.horizFirst);var g=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(e,k);e.show();var d=a.effects.createWrapper(e).css({overflow:"hidden"});var i=((h=="show")!=n);var f=i?["width","height"]:["height","width"];var c=i?[d.width(),d.height()]:[d.height(),d.width()];var j=/([0-9]+)%/.exec(o);if(j){o=parseInt(j[1])/100*c[h=="hide"?0:1]}if(h=="show"){d.css(n?{height:0,width:o}:{height:o,width:0})}var m={},l={};m[f[0]]=h=="show"?c[0]:o;l[f[1]]=h=="show"?c[1]:0;d.animate(m,g,b.options.easing).animate(l,g,b.options.easing,function(){if(h=="hide"){e.hide()}a.effects.restore(e,k);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(e[0],arguments)}e.dequeue()})})}})(jQuery);;/*
- * jQuery UI Effects Highlight 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Highlight
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.highlight=function(b){return this.queue(function(){var e=a(this),d=["backgroundImage","backgroundColor","opacity"];var h=a.effects.setMode(e,b.options.mode||"show");var c=b.options.color||"#ffff99";var g=e.css("backgroundColor");a.effects.save(e,d);e.show();e.css({backgroundImage:"none",backgroundColor:c});var f={backgroundColor:g};if(h=="hide"){f.opacity=0}e.animate(f,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(h=="hide"){e.hide()}a.effects.restore(e,d);if(h=="show"&&a.browser.msie){this.style.removeAttribute("filter")}if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/*
- * jQuery UI Effects Pulsate 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Pulsate
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.pulsate=function(b){return this.queue(function(){var d=a(this);var g=a.effects.setMode(d,b.options.mode||"show");var f=b.options.times||5;var e=b.duration?b.duration/2:a.fx.speeds._default/2;if(g=="hide"){f--}if(d.is(":hidden")){d.css("opacity",0);d.show();d.animate({opacity:1},e,b.options.easing);f=f-2}for(var c=0;c<f;c++){d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing)}if(g=="hide"){d.animate({opacity:0},e,b.options.easing,function(){d.hide();if(b.callback){b.callback.apply(this,arguments)}})}else{d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing,function(){if(b.callback){b.callback.apply(this,arguments)}})}d.queue("fx",function(){d.dequeue()});d.dequeue()})}})(jQuery);;/*
- * jQuery UI Effects Scale 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Scale
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.puff=function(b){return this.queue(function(){var f=a(this);var c=a.extend(true,{},b.options);var h=a.effects.setMode(f,b.options.mode||"hide");var g=parseInt(b.options.percent)||150;c.fade=true;var e={height:f.height(),width:f.width()};var d=g/100;f.from=(h=="hide")?e:{height:e.height*d,width:e.width*d};c.from=f.from;c.percent=(h=="hide")?g:100;c.mode=h;f.effect("scale",c,b.duration,b.callback);f.dequeue()})};a.effects.scale=function(b){return this.queue(function(){var g=a(this);var d=a.extend(true,{},b.options);var j=a.effects.setMode(g,b.options.mode||"effect");var h=parseInt(b.options.percent)||(parseInt(b.options.percent)==0?0:(j=="hide"?0:100));var i=b.options.direction||"both";var c=b.options.origin;if(j!="effect"){d.origin=c||["middle","center"];d.restore=true}var f={height:g.height(),width:g.width()};g.from=b.options.from||(j=="show"?{height:0,width:0}:f);var e={y:i!="horizontal"?(h/100):1,x:i!="vertical"?(h/100):1};g.to={height:f.height*e.y,width:f.width*e.x};if(b.options.fade){if(j=="show"){g.from.opacity=0;g.to.opacity=1}if(j=="hide"){g.from.opacity=1;g.to.opacity=0}}d.from=g.from;d.to=g.to;d.mode=j;g.effect("size",d,b.duration,b.callback);g.dequeue()})};a.effects.size=function(b){return this.queue(function(){var c=a(this),n=["position","top","left","width","height","overflow","opacity"];var m=["position","top","left","overflow","opacity"];var j=["width","height","overflow"];var p=["fontSize"];var k=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var f=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];var g=a.effects.setMode(c,b.options.mode||"effect");var i=b.options.restore||false;var e=b.options.scale||"both";var o=b.options.origin;var d={height:c.height(),width:c.width()};c.from=b.options.from||d;c.to=b.options.to||d;if(o){var h=a.effects.getBaseline(o,d);c.from.top=(d.height-c.from.height)*h.y;c.from.left=(d.width-c.from.width)*h.x;c.to.top=(d.height-c.to.height)*h.y;c.to.left=(d.width-c.to.width)*h.x}var l={from:{y:c.from.height/d.height,x:c.from.width/d.width},to:{y:c.to.height/d.height,x:c.to.width/d.width}};if(e=="box"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(k);c.from=a.effects.setTransition(c,k,l.from.y,c.from);c.to=a.effects.setTransition(c,k,l.to.y,c.to)}if(l.from.x!=l.to.x){n=n.concat(f);c.from=a.effects.setTransition(c,f,l.from.x,c.from);c.to=a.effects.setTransition(c,f,l.to.x,c.to)}}if(e=="content"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(p);c.from=a.effects.setTransition(c,p,l.from.y,c.from);c.to=a.effects.setTransition(c,p,l.to.y,c.to)}}a.effects.save(c,i?n:m);c.show();a.effects.createWrapper(c);c.css("overflow","hidden").css(c.from);if(e=="content"||e=="both"){k=k.concat(["marginTop","marginBottom"]).concat(p);f=f.concat(["marginLeft","marginRight"]);j=n.concat(k).concat(f);c.find("*[width]").each(function(){child=a(this);if(i){a.effects.save(child,j)}var q={height:child.height(),width:child.width()};child.from={height:q.height*l.from.y,width:q.width*l.from.x};child.to={height:q.height*l.to.y,width:q.width*l.to.x};if(l.from.y!=l.to.y){child.from=a.effects.setTransition(child,k,l.from.y,child.from);child.to=a.effects.setTransition(child,k,l.to.y,child.to)}if(l.from.x!=l.to.x){child.from=a.effects.setTransition(child,f,l.from.x,child.from);child.to=a.effects.setTransition(child,f,l.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){if(i){a.effects.restore(child,j)}})})}c.animate(c.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(g=="hide"){c.hide()}a.effects.restore(c,i?n:m);a.effects.removeWrapper(c);if(b.callback){b.callback.apply(this,arguments)}c.dequeue()}})})}})(jQuery);;/*
- * jQuery UI Effects Shake 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Shake
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.shake=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"left";var c=b.options.distance||20;var d=b.options.times||3;var g=b.duration||b.options.duration||140;a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var h={},o={},m={};h[f]=(p=="pos"?"-=":"+=")+c;o[f]=(p=="pos"?"+=":"-=")+c*2;m[f]=(p=="pos"?"-=":"+=")+c*2;e.animate(h,g,b.options.easing);for(var j=1;j<d;j++){e.animate(o,g,b.options.easing).animate(m,g,b.options.easing)}e.animate(o,g,b.options.easing).animate(h,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}});e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/*
- * jQuery UI Effects Slide 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Slide
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.slide=function(b){return this.queue(function(){var e=a(this),d=["position","top","left"];var i=a.effects.setMode(e,b.options.mode||"show");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e).css({overflow:"hidden"});var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true}):e.outerWidth({margin:true}));if(i=="show"){e.css(f,c=="pos"?-j:j)}var g={};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/*
- * jQuery UI Effects Transfer 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Transfer
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.transfer=function(b){return this.queue(function(){var e=a(this);var g=a.effects.setMode(e,b.options.mode||"effect");var f=a(b.options.to);var c=e.offset();var d=a('<div class="ui-effects-transfer"></div>').appendTo(document.body);if(b.options.className){d.addClass(b.options.className)}d.addClass(b.options.className);d.css({top:c.top,left:c.left,height:e.outerHeight()-parseInt(d.css("borderTopWidth"))-parseInt(d.css("borderBottomWidth")),width:e.outerWidth()-parseInt(d.css("borderLeftWidth"))-parseInt(d.css("borderRightWidth")),position:"absolute"});c=f.offset();animation={top:c.top,left:c.left,height:f.outerHeight()-parseInt(d.css("borderTopWidth"))-parseInt(d.css("borderBottomWidth")),width:f.outerWidth()-parseInt(d.css("borderLeftWidth"))-parseInt(d.css("borderRightWidth"))};d.animate(animation,b.duration,b.options.easing,function(){d.remove();if(b.callback){b.callback.apply(e[0],arguments)}e.dequeue()})})}})(jQuery);;
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Scripts/jquery.cookie.js b/projecttemplates/MvcRelyingParty/Scripts/jquery.cookie.js deleted file mode 100644 index 121f723..0000000 --- a/projecttemplates/MvcRelyingParty/Scripts/jquery.cookie.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* Cookie plugin -* -* Copyright (c) 2006 Klaus Hartl (stilbuero.de) -* Dual licensed under the MIT and GPL licenses: -* http://www.opensource.org/licenses/mit-license.php -* http://www.gnu.org/licenses/gpl.html -* -*/ - -/** -* Create a cookie with the given name and value and other optional parameters. -* -* @example $.cookie('the_cookie', 'the_value'); -* @desc Set the value of a cookie. -* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); -* @desc Create a cookie with all available options. -* @example $.cookie('the_cookie', 'the_value'); -* @desc Create a session cookie. -* @example $.cookie('the_cookie', null); -* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain -* used when the cookie was set. -* -* @param String name The name of the cookie. -* @param String value The value of the cookie. -* @param Object options An object literal containing key/value pairs to provide optional cookie attributes. -* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. -* If a negative value is specified (e.g. a date in the past), the cookie will be deleted. -* If set to null or omitted, the cookie will be a session cookie and will not be retained -* when the the browser exits. -* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). -* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). -* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will -* require a secure protocol (like HTTPS). -* @type undefined -* -* @name $.cookie -* @cat Plugins/Cookie -* @author Klaus Hartl/klaus.hartl@stilbuero.de -*/ - -/** -* Get the value of a cookie with the given name. -* -* @example $.cookie('the_cookie'); -* @desc Get the value of a cookie. -* -* @param String name The name of the cookie. -* @return The value of the cookie. -* @type String -* -* @name $.cookie -* @cat Plugins/Cookie -* @author Klaus Hartl/klaus.hartl@stilbuero.de -*/ -jQuery.cookie = function(name, value, options) { - if (typeof value != 'undefined') { // name and value given, set cookie - options = options || {}; - if (value === null) { - value = ''; - options.expires = -1; - } - var expires = ''; - if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { - var date; - if (typeof options.expires == 'number') { - date = new Date(); - date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); - } else { - date = options.expires; - } - expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE - } - // CAUTION: Needed to parenthesize options.path and options.domain - // in the following expressions, otherwise they evaluate to undefined - // in the packed version for some reason... - var path = options.path ? '; path=' + (options.path) : ''; - var domain = options.domain ? '; domain=' + (options.domain) : ''; - var secure = options.secure ? '; secure' : ''; - document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); - } else { // only name given, get cookie - var cookieValue = null; - if (document.cookie && document.cookie != '') { - var cookies = document.cookie.split(';'); - for (var i = 0; i < cookies.length; i++) { - var cookie = jQuery.trim(cookies[i]); - // Does this cookie string begin with the name we want? - if (cookie.substring(0, name.length + 1) == (name + '=')) { - cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); - break; - } - } - } - return cookieValue; - } -};
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Setup.aspx b/projecttemplates/MvcRelyingParty/Setup.aspx deleted file mode 100644 index 4e28c49..0000000 --- a/projecttemplates/MvcRelyingParty/Setup.aspx +++ /dev/null @@ -1,43 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Setup.aspx.cs" Inherits="MvcRelyingParty.Setup" %> - -<%@ Register Assembly="DotNetOpenAuth.OpenID.RelyingParty.UI" Namespace="DotNetOpenAuth.OpenId.RelyingParty" - TagPrefix="rp" %> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head runat="server"> - <title>OpenID RP one-time setup</title> -</head> -<body> - <form id="form1" runat="server"> - <h2> - First steps: - </h2> - <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0"> - <asp:View ID="View1" runat="server"> - <p> - Before you can use this site, you must create your SQL database that will store - your user accounts and add an admin account to that database. - Just tell me what OpenID you will use to administer the site. - </p> - <rp:OpenIdLogin runat="server" ButtonText="Create database" ID="openidLogin" - OnLoggingIn="openidLogin_LoggingIn" Stateless="true" - TabIndex="1" LabelText="Administrator's OpenID:" - ButtonToolTip="Clicking this button will create the database and initialize the OpenID you specify as an admin of this web site." - RegisterText="get an OpenID" /> - <asp:Label ID="noOPIdentifierLabel" Visible="false" EnableViewState="false" ForeColor="Red" Font-Bold="true" runat="server" Text="Sorry. To help your admin account remain functional when you push this web site to production, directed identity is disabled on this page. Please use your personal claimed identifier." /> - </asp:View> - <asp:View ID="View2" runat="server"> - <p> - Your database has been successfully initialized. - </p> - <p> - <b>Remember to delete this Setup.aspx page.</b> - </p> - <p> - Visit the <a href="Default.aspx">home page</a>. - </p> - </asp:View> - </asp:MultiView> - </form> -</body> -</html> diff --git a/projecttemplates/MvcRelyingParty/Setup.aspx.cs b/projecttemplates/MvcRelyingParty/Setup.aspx.cs deleted file mode 100644 index 633496f..0000000 --- a/projecttemplates/MvcRelyingParty/Setup.aspx.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace MvcRelyingParty { - using System; - using System.Collections.Generic; - using System.Globalization; - using System.IO; - using System.Linq; - using System.Web; - using System.Web.UI; - using System.Web.UI.WebControls; - using DotNetOpenAuth.OpenId; - using DotNetOpenAuth.OpenId.RelyingParty; - using RelyingPartyLogic; - - public partial class Setup : System.Web.UI.Page { - private bool databaseCreated; - - protected void Page_Load(object sender, EventArgs e) { - if (!Page.IsPostBack) { - this.openidLogin.Focus(); - } - } - - protected void openidLogin_LoggingIn(object sender, OpenIdEventArgs e) { - // We don't actually want to log in... we just want the claimed identifier. - e.Cancel = true; - if (e.IsDirectedIdentity) { - this.noOPIdentifierLabel.Visible = true; - } else if (!this.databaseCreated) { - Utilities.CreateDatabase(e.ClaimedIdentifier, this.openidLogin.Text, "MvcRelyingParty"); - this.MultiView1.ActiveViewIndex = 1; - - // indicate we have already created the database so that if the - // identifier the user gave has multiple service endpoints, - // we won't try to recreate the database as the next one is considered. - this.databaseCreated = true; - } - } - } -} diff --git a/projecttemplates/MvcRelyingParty/Setup.aspx.designer.cs b/projecttemplates/MvcRelyingParty/Setup.aspx.designer.cs deleted file mode 100644 index d8ab448..0000000 --- a/projecttemplates/MvcRelyingParty/Setup.aspx.designer.cs +++ /dev/null @@ -1,70 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace MvcRelyingParty { - - - public partial class Setup { - - /// <summary> - /// form1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// <summary> - /// MultiView1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.MultiView MultiView1; - - /// <summary> - /// View1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.View View1; - - /// <summary> - /// openidLogin control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::DotNetOpenAuth.OpenId.RelyingParty.OpenIdLogin openidLogin; - - /// <summary> - /// noOPIdentifierLabel control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Label noOPIdentifierLabel; - - /// <summary> - /// View2 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.View View2; - } -} diff --git a/projecttemplates/MvcRelyingParty/Views/Account/AuthenticationTokens.ascx b/projecttemplates/MvcRelyingParty/Views/Account/AuthenticationTokens.ascx deleted file mode 100644 index 9cf016b..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Account/AuthenticationTokens.ascx +++ /dev/null @@ -1,28 +0,0 @@ -<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MvcRelyingParty.Models.AccountInfoModel>" %> -<%@ Import Namespace="DotNetOpenAuth.Mvc" %> -<%@ Import Namespace="DotNetOpenAuth.OpenId.RelyingParty" %> - -<h3> - Login methods -</h3> -<ul class="AuthTokens"> -<% foreach(var token in Model.AuthenticationTokens) { %> - <li class="<%= token.IsInfoCard ? "InfoCard" : "OpenID" %>" title="<%= Html.Encode(token.ClaimedIdentifier) %>"> - <%= Html.Encode(token.FriendlyIdentifier) %> - </li> -<% } %> -</ul> - -<h4>Add a new login method </h4> - -<% using(Html.BeginForm("AddAuthenticationToken", "Auth", FormMethod.Post)) { %> -<%= Html.AntiForgeryToken() %> -<%= Html.Hidden("openid_openidAuthData") %> - -<%= Html.OpenIdSelector(new SelectorButton[] { - new SelectorProviderButton("https://me.yahoo.com/", Url.Content("~/Content/images/yahoo.gif")), - new SelectorProviderButton("https://www.google.com/accounts/o8/id", Url.Content("~/Content/images/google.gif")), - new SelectorOpenIdButton(Url.Content("~/Content/images/openid.gif")), -}) %> - -<% } %>
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Views/Account/Authorize.aspx b/projecttemplates/MvcRelyingParty/Views/Account/Authorize.aspx deleted file mode 100644 index 986a3eb..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Account/Authorize.aspx +++ /dev/null @@ -1,61 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcRelyingParty.Models.AccountAuthorizeModel>" %> -<%@ Import Namespace="DotNetOpenAuth.OAuth2" %> - -<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> - Authorize -</asp:Content> -<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> - <h2> - Authorize - </h2> - <div style="background-color: Yellow"> - <b>Warning</b>: Never give your login credentials to another web site or application. - </div> - <p> - The - <%= Html.Encode(Model.ClientApp) %> - application is requesting to access the private data in your account here. Is that - alright with you? - </p> - <p> - <b>Requested access: </b> - <%= Html.Encode(String.Join(" ", Model.Scope.ToArray())) %> - </p> - <p> - If you grant access now, you can revoke it at any time by returning to - <%= Html.ActionLink("your account page", "Edit") %>. - </p> - <% using (Html.BeginForm("AuthorizeResponse", "Account")) { %> - <%= Html.AntiForgeryToken() %> - <%= Html.Hidden("IsApproved") %> - <%= Html.Hidden("client_id", Model.AuthorizationRequest.ClientIdentifier) %> - <%= Html.Hidden("redirect_uri", Model.AuthorizationRequest.Callback) %> - <%= Html.Hidden("state", Model.AuthorizationRequest.ClientState) %> - <%= Html.Hidden("scope", OAuthUtilities.JoinScopes(Model.AuthorizationRequest.Scope)) %> - <%= Html.Hidden("response_type", "code") %> - <div style="display: none" id="responseButtonsDiv"> - <input type="submit" value="Yes" onclick="document.getElementsByName('IsApproved')[0].value = true; return true;" /> - <input type="submit" value="No" onclick="document.getElementsByName('IsApproved')[0].value = false; return true;" /> - </div> - <div id="javascriptDisabled"> - <b>Javascript appears to be disabled in your browser. </b>This page requires Javascript - to be enabled to better protect your security. - </div> - - <script language="javascript" type="text/javascript"> - //<![CDATA[ - // we use HTML to hide the action buttons and Javascript to show them - // to protect against click-jacking in an iframe whose javascript is disabled. - document.getElementById('responseButtonsDiv').style.display = 'block'; - document.getElementById('javascriptDisabled').style.display = 'none'; - - // Frame busting code (to protect us from being hosted in an iframe). - // This protects us from click-jacking. - if (document.location !== window.top.location) { - window.top.location = document.location; - } - //]]> - </script> - - <% } %> -</asp:Content> diff --git a/projecttemplates/MvcRelyingParty/Views/Account/AuthorizedApps.ascx b/projecttemplates/MvcRelyingParty/Views/Account/AuthorizedApps.ascx deleted file mode 100644 index 4fadad9..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Account/AuthorizedApps.ascx +++ /dev/null @@ -1,15 +0,0 @@ -<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MvcRelyingParty.Models.AccountInfoModel>" %> -<h3> - Authorized applications -</h3> -<% if (Model.AuthorizedApps.Count == 0) { %> -<p> - You have not authorized any applications or web sites to access your data. -</p> -<% } else { %> - <ul> - <% foreach (var app in Model.AuthorizedApps) { %> - <li><%= Html.Encode(app.AppName) %> - <%= Html.Encode(app.Scope) %> - <%= Ajax.ActionLink("revoke", "RevokeAuthorization", new { authorizationId = app.AuthorizationId }, new AjaxOptions { HttpMethod = "DELETE", UpdateTargetId = "authorizedApps", OnFailure = "function(e) { alert('Revoking authorization for this application failed.'); }" })%></li> - <% } %> - </ul> -<% } %>
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Views/Account/Edit.aspx b/projecttemplates/MvcRelyingParty/Views/Account/Edit.aspx deleted file mode 100644 index 15d5aeb..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Account/Edit.aspx +++ /dev/null @@ -1,45 +0,0 @@ -<%@ Page Title="Edit Account Information" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" - Inherits="System.Web.Mvc.ViewPage<AccountInfoModel>" %> - -<%@ Import Namespace="MvcRelyingParty.Models" %> -<%@ Import Namespace="DotNetOpenAuth.Mvc" %> -<%@ Import Namespace="DotNetOpenAuth.OpenId.RelyingParty" %> -<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> - Edit -</asp:Content> -<asp:Content ContentPlaceHolderID="Head" runat="server"> - <%= Html.OpenIdSelectorStyles() %> -</asp:Content> -<asp:Content ContentPlaceHolderID="ScriptsArea" runat="server"> - <script type="text/javascript" src='<%= Url.Content("~/Scripts/MicrosoftAjax.js") %>'></script> - <script type="text/javascript" src='<%= Url.Content("~/Scripts/MicrosoftMvcAjax.js") %>'></script> - <script type="text/javascript" src='<%= Url.Content("~/Scripts/jquery.cookie.js") %>'></script> - <% var selector = new OpenIdSelector(); - selector.TextBox.LogOnText = "ADD"; - selector.TextBox.LogOnToolTip = "Bind this OpenID to your account."; - var additionalOptions = new OpenIdAjaxOptions { - FormIndex = 1, - }; %> - <%= Html.OpenIdSelectorScripts(selector, additionalOptions)%> -</asp:Content> -<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> - <h2> - Edit Account Information - </h2> - <% using (Ajax.BeginForm("Update", new AjaxOptions { HttpMethod = "PUT", UpdateTargetId = "editPartial", LoadingElementId = "updatingMessage" })) { %> - <%= Html.AntiForgeryToken()%> - <div id="editPartial"> - <% Html.RenderPartial("EditFields"); %> - </div> - <input type="submit" value="Save" /> - <span id="updatingMessage" style="display: none">Saving...</span> - <% } %> - - <div id="authorizedApps"> - <% Html.RenderPartial("AuthorizedApps"); %> - </div> - - <div id="authenticationTokens"> - <% Html.RenderPartial("AuthenticationTokens"); %> - </div> -</asp:Content> diff --git a/projecttemplates/MvcRelyingParty/Views/Account/EditFields.ascx b/projecttemplates/MvcRelyingParty/Views/Account/EditFields.ascx deleted file mode 100644 index 39b4358..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Account/EditFields.ascx +++ /dev/null @@ -1,34 +0,0 @@ -<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MvcRelyingParty.Models.AccountInfoModel>" %> -<%= Html.ValidationSummary("Edit was unsuccessful. Please correct the errors and try again.") %> -<fieldset> - <legend>Account Details</legend> - <table> - <tr> - <td> - <label for="FirstName">First Name:</label> - </td> - <td> - <%= Html.TextBox("FirstName", Model.FirstName) %> - <%= Html.ValidationMessage("FirstName", "*") %> - </td> - </tr> - <tr> - <td> - <label for="LastName">Last Name:</label> - </td> - <td> - <%= Html.TextBox("LastName", Model.LastName) %> - <%= Html.ValidationMessage("LastName", "*") %> - </td> - </tr> - <tr> - <td> - <label for="EmailAddress">Email Address:</label> - </td> - <td> - <%= Html.TextBox("EmailAddress", Model.EmailAddress) %> - <%= Html.ValidationMessage("EmailAddress", "*") %> - </td> - </tr> - </table> -</fieldset> diff --git a/projecttemplates/MvcRelyingParty/Views/Auth/LogOn.aspx b/projecttemplates/MvcRelyingParty/Views/Auth/LogOn.aspx deleted file mode 100644 index e66cfee..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Auth/LogOn.aspx +++ /dev/null @@ -1,11 +0,0 @@ -<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> -<%@ Import Namespace="DotNetOpenAuth.Mvc" %> -<asp:Content ContentPlaceHolderID="Head" runat="server"> - <%= Html.OpenIdSelectorStyles() %> -</asp:Content> -<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> - <% Html.RenderPartial("LogOnContent"); %> -</asp:Content> -<asp:Content ContentPlaceHolderID="ScriptsArea" runat="server"> - <% Html.RenderPartial("LogOnScripts"); %> -</asp:Content>
\ No newline at end of file diff --git a/projecttemplates/MvcRelyingParty/Views/Auth/LogOnContent.ascx b/projecttemplates/MvcRelyingParty/Views/Auth/LogOnContent.ascx deleted file mode 100644 index 8e704df..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Auth/LogOnContent.ascx +++ /dev/null @@ -1,29 +0,0 @@ -<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> -<%@ Import Namespace="DotNetOpenAuth.Mvc" %> -<%@ Import Namespace="DotNetOpenAuth.OpenId.RelyingParty" %> -<p>Login using an account you already use. </p> -<%= Html.ValidationSummary("Login was unsuccessful. Please correct the errors and try again.") %> - -<% using (Html.BeginForm("LogOnPostAssertion", "Auth", FormMethod.Post, new { target = "_top" })) { %> -<%= Html.AntiForgeryToken() %> -<%= Html.Hidden("ReturnUrl", Request.QueryString["ReturnUrl"], new { id = "ReturnUrl" }) %> -<%= Html.Hidden("openid_openidAuthData") %> -<div> -<%= Html.OpenIdSelector(new SelectorButton[] { - new SelectorProviderButton("https://me.yahoo.com/", Url.Content("~/Content/images/yahoo.gif")), - new SelectorProviderButton("https://www.google.com/accounts/o8/id", Url.Content("~/Content/images/google.gif")), - new SelectorOpenIdButton(Url.Content("~/Content/images/openid.png")), -}) %> - - <div class="helpDoc"> - <p> - If you have logged in previously, click the same button you did last time. - </p> - <p> - If you don't have an account with any of these services, just pick Google. They'll - help you set up an account. - </p> - </div> - -</div> -<% } %> diff --git a/projecttemplates/MvcRelyingParty/Views/Auth/LogOnPopup.aspx b/projecttemplates/MvcRelyingParty/Views/Auth/LogOnPopup.aspx deleted file mode 100644 index d5a3ed3..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Auth/LogOnPopup.aspx +++ /dev/null @@ -1,25 +0,0 @@ -<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %> -<%@ Import Namespace="DotNetOpenAuth.Mvc" %> - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <title>Login</title> - <%= Html.OpenIdSelectorStyles() %> - <link rel="stylesheet" type="text/css" href='<%= Url.Content("~/Content/loginpopup.css") %>' /> -</head> -<body> -<% Html.RenderPartial("LogOnContent"); %> - <% if (Request.Url.IsLoopback) { %> - <script type="text/javascript" src='<%= Url.Content("~/Scripts/jquery-1.3.2.min.js") %>'></script> - <script type="text/javascript" src='<%= Url.Content("~/Scripts/jquery-ui-personalized-1.6rc6.min.js") %>'></script> - <% } else { %> - <script type="text/javascript" language="javascript" src="http://www.google.com/jsapi"></script> - <script type="text/javascript" language="javascript"> - google.load("jquery", "1.3.2"); - google.load("jqueryui", "1.7.2"); - </script> - <% } %> -<% Html.RenderPartial("LogOnScripts"); %> -</body> -</html> diff --git a/projecttemplates/MvcRelyingParty/Views/Auth/LogOnScripts.ascx b/projecttemplates/MvcRelyingParty/Views/Auth/LogOnScripts.ascx deleted file mode 100644 index 6689a0d..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Auth/LogOnScripts.ascx +++ /dev/null @@ -1,11 +0,0 @@ -<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> -<%@ Import Namespace="DotNetOpenAuth.Mvc" %> -<script type="text/javascript" src='<%= Url.Content("~/Scripts/MicrosoftAjax.js") %>'></script> -<script type="text/javascript" src='<%= Url.Content("~/Scripts/MicrosoftMvcAjax.js") %>'></script> -<script type="text/javascript" src='<%= Url.Content("~/Scripts/jquery.cookie.js") %>'></script> -<% - var options = new OpenIdAjaxOptions { - PreloadedDiscoveryResults = (string)this.ViewData["PreloadedDiscoveryResults"], - }; -%> -<%= Html.OpenIdSelectorScripts(null, options)%> diff --git a/projecttemplates/MvcRelyingParty/Views/Home/About.aspx b/projecttemplates/MvcRelyingParty/Views/Home/About.aspx deleted file mode 100644 index 1893e26..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Home/About.aspx +++ /dev/null @@ -1,13 +0,0 @@ -<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> - -<asp:Content ID="aboutTitle" ContentPlaceHolderID="TitleContent" runat="server"> - About Us -</asp:Content> -<asp:Content ID="aboutContent" ContentPlaceHolderID="MainContent" runat="server"> - <h2> - About - </h2> - <p> - Put content here. - </p> -</asp:Content> diff --git a/projecttemplates/MvcRelyingParty/Views/Home/Index.aspx b/projecttemplates/MvcRelyingParty/Views/Home/Index.aspx deleted file mode 100644 index 4efd7f6..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Home/Index.aspx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> - -<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server"> - Home Page -</asp:Content> -<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server"> - <h2> - <%= Html.Encode(ViewData["Message"]) %></h2> - <p> - To learn more about DotNetOpenAuth visit <a href="http://www.dotnetopenauth.net/" - title="DotNetOpenAuth web site">http://www.dotnetopenauth.net/</a>. - </p> - <p> - Try logging in. - </p> -</asp:Content> diff --git a/projecttemplates/MvcRelyingParty/Views/Home/PrivacyPolicy.aspx b/projecttemplates/MvcRelyingParty/Views/Home/PrivacyPolicy.aspx deleted file mode 100644 index 34b2e59..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Home/PrivacyPolicy.aspx +++ /dev/null @@ -1,13 +0,0 @@ -<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> - -<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> - Privacy Policy -</asp:Content> -<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> - <h2> - Privacy Policy - </h2> - <p> - [placeholder] - </p> -</asp:Content> diff --git a/projecttemplates/MvcRelyingParty/Views/Shared/Error.aspx b/projecttemplates/MvcRelyingParty/Views/Shared/Error.aspx deleted file mode 100644 index 144df3f..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Shared/Error.aspx +++ /dev/null @@ -1,11 +0,0 @@ -<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<System.Web.Mvc.HandleErrorInfo>" %> - -<asp:Content ID="errorTitle" ContentPlaceHolderID="TitleContent" runat="server"> - Error -</asp:Content> - -<asp:Content ID="errorContent" ContentPlaceHolderID="MainContent" runat="server"> - <h2> - Sorry, an error occurred while processing your request. - </h2> -</asp:Content> diff --git a/projecttemplates/MvcRelyingParty/Views/Shared/LogOnUserControl.ascx b/projecttemplates/MvcRelyingParty/Views/Shared/LogOnUserControl.ascx deleted file mode 100644 index 214696a..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Shared/LogOnUserControl.ascx +++ /dev/null @@ -1,29 +0,0 @@ -<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> -<%@ Import Namespace="RelyingPartyLogic" %> -<%@ Import Namespace="System.Linq" %> -<% - if (Request.IsAuthenticated) { -%> -Welcome <b> - <% - var authToken = Database.DataContext.AuthenticationTokens.Include("User").First(token => token.ClaimedIdentifier == Page.User.Identity.Name); - if (!string.IsNullOrEmpty(authToken.User.EmailAddress)) { - Response.Write(HttpUtility.HtmlEncode(authToken.User.EmailAddress)); - } else if (!string.IsNullOrEmpty(authToken.User.FirstName)) { - Response.Write(HttpUtility.HtmlEncode(authToken.User.FirstName)); - } else { - Response.Write(HttpUtility.HtmlEncode(authToken.FriendlyIdentifier)); - } - %> -</b>! [ -<%= Html.ActionLink("Log Off", "LogOff", "Auth") %> -] -<% - } else { -%> -[ -<a href="#" class="loginPopupLink">Login / Register</a> -] -<% - } -%> diff --git a/projecttemplates/MvcRelyingParty/Views/Shared/Site.Master b/projecttemplates/MvcRelyingParty/Views/Shared/Site.Master deleted file mode 100644 index b819105..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Shared/Site.Master +++ /dev/null @@ -1,59 +0,0 @@ -<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %> - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <title> - <asp:ContentPlaceHolder ID="TitleContent" runat="server" /> - </title> - <link rel="stylesheet" type="text/css" href='<%= Url.Content("~/Content/Site.css") %>' /> - <link rel="stylesheet" type="text/css" href='<%= Url.Content("~/Content/theme/ui.all.css") %>' /> - <asp:ContentPlaceHolder ID="Head" runat="server" /> -</head> -<body> - <div class="page"> - <div id="header"> - <div id="title"> - <h1> - My MVC Application - </h1> - </div> - <div id="logindisplay"> - <% Html.RenderPartial("LogOnUserControl"); %> - </div> - <div id="menucontainer"> - <ul id="menu"> - <li> - <%= Html.ActionLink("Home", "Index", "Home")%> - </li> - <li> - <%= Html.ActionLink("About", "About", "Home")%> - </li> - <% if (Page.User.Identity.IsAuthenticated) { %> - <li> - <%= Html.ActionLink("Account", "Edit", "Account")%> - </li> - <% } %> - </ul> - </div> - </div> - <div id="main"> - <asp:ContentPlaceHolder ID="MainContent" runat="server" /> - <div id="footer"> - </div> - </div> - </div> - <% if (false && Request.Url.IsLoopback) { /* for some reason, Request.Url.IsLoopback fails on Casini. TODO: learn more and fix this. */%> - <script type="text/javascript" src='<%= Url.Content("~/Scripts/jquery-1.3.2.min.js") %>'></script> - <script type="text/javascript" src='<%= Url.Content("~/Scripts/jquery-ui-personalized-1.6rc6.min.js") %>'></script> - <% } else { %> - <script type="text/javascript" language="javascript" src="http://www.google.com/jsapi"></script> - <script type="text/javascript" language="javascript"> - google.load("jquery", "1.3.2"); - google.load("jqueryui", "1.7.2"); - </script> - <% } %> - <script type="text/javascript" language="javascript" src='<%= Url.Content("~/Scripts/LoginLink.js") %>'></script> - <asp:ContentPlaceHolder runat="server" ID="ScriptsArea" /> -</body> -</html> diff --git a/projecttemplates/MvcRelyingParty/Views/Web.config b/projecttemplates/MvcRelyingParty/Views/Web.config deleted file mode 100644 index 6c19565..0000000 --- a/projecttemplates/MvcRelyingParty/Views/Web.config +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0"?> -<configuration> - <system.web> - <httpHandlers> - <add path="*" verb="*" - type="System.Web.HttpNotFoundHandler"/> - </httpHandlers> - - <!-- - Enabling request validation in view pages would cause validation to occur - after the input has already been processed by the controller. By default - MVC performs request validation before a controller processes the input. - To change this behavior apply the ValidateInputAttribute to a - controller or action. - --> - <pages - validateRequest="false" - pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" - pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" - userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> - <controls> - <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" /> - </controls> - </pages> - </system.web> - - <system.webServer> - <validation validateIntegratedModeConfiguration="false"/> - <handlers> - <remove name="BlockViewHandler"/> - <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/> - </handlers> - </system.webServer> -</configuration> diff --git a/projecttemplates/MvcRelyingParty/Web.config b/projecttemplates/MvcRelyingParty/Web.config deleted file mode 100644 index 5b00f66..0000000 --- a/projecttemplates/MvcRelyingParty/Web.config +++ /dev/null @@ -1,254 +0,0 @@ -<?xml version="1.0"?> -<!-- - Note: As an alternative to hand editing this file you can use the - web admin tool to configure settings for your application. Use - the Website->Asp.Net Configuration option in Visual Studio. - A full list of settings and comments can be found in - machine.config.comments usually located in - \Windows\Microsoft.Net\Framework\v2.x\Config ---> -<configuration> - <configSections> - <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler" requirePermission="false"/> - <sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth.Core"> - <section name="openid" type="DotNetOpenAuth.Configuration.OpenIdElement, DotNetOpenAuth.OpenId" requirePermission="false" allowLocation="true" /> - <section name="oauth" type="DotNetOpenAuth.Configuration.OAuthElement, DotNetOpenAuth.OAuth" requirePermission="false" allowLocation="true" /> - <section name="messaging" type="DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" /> - <section name="reporting" type="DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" /> - </sectionGroup> - </configSections> - <!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names), - which is necessary for OpenID urls with unicode characters in the domain/host name. - It is also required to put the Uri class into RFC 3986 escaping mode, which OpenID and OAuth require. --> - <uri> - <idn enabled="All"/> - <iriParsing enabled="true"/> - </uri> - <system.net> - <defaultProxy enabled="true"/> - <settings> - <!-- This setting causes .NET to check certificate revocation lists (CRL) - before trusting HTTPS certificates. But this setting tends to not - be allowed in shared hosting environments. --> - <servicePointManager checkCertificateRevocationList="true"/> - </settings> - </system.net> - <!-- this is an optional configuration section where aspects of dotnetopenauth can be customized --> - <dotNetOpenAuth> - <messaging> - <untrustedWebRequest> - <whitelistHosts> - <!--<add name="localhost" />--> - </whitelistHosts> - </untrustedWebRequest> - </messaging> - <openid> - <relyingParty> - <security requireSsl="false"> - <!-- Uncomment the trustedProviders tag if your relying party should only accept positive assertions from a closed set of OpenID Providers. --> - <!--<trustedProviders rejectAssertionsFromUntrustedProviders="true"> - <add endpoint="https://www.google.com/accounts/o8/ud" /> - </trustedProviders>--> - </security> - <behaviors> - <!-- The following OPTIONAL behavior allows RPs to use SREG only, but be compatible - with OPs that use Attribute Exchange (in various formats). --> - <add type="DotNetOpenAuth.OpenId.RelyingParty.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth.OpenId.RelyingParty"/> - </behaviors> - <store type="RelyingPartyLogic.RelyingPartyApplicationDbStore, RelyingPartyLogic"/> - </relyingParty> - </openid> - <oauth> - <serviceProvider> - <store type="RelyingPartyLogic.NonceDbStore, RelyingPartyLogic"/> - </serviceProvider> - </oauth> - <!-- Allow DotNetOpenAuth to publish usage statistics to library authors to improve the library. --> - <reporting enabled="true"/> - </dotNetOpenAuth> - <!-- log4net is a 3rd party (free) logger library that DotNetOpenAuth will use if present but does not require. --> - <log4net> - <appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender"> - <bufferSize value="100"/> - <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> - <connectionString value="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\WebFormsRelyingParty.mdf;Integrated Security=True;User Instance=True"/> - <commandText value="INSERT INTO [Log] ([Date],[Thread],[Level],[Logger],[Message],[Exception]) VALUES (@log_date, @thread, @log_level, @logger, @message, @exception)"/> - <parameter> - <parameterName value="@log_date"/> - <dbType value="DateTime"/> - <layout type="log4net.Layout.RawTimeStampLayout"/> - </parameter> - <parameter> - <parameterName value="@thread"/> - <dbType value="String"/> - <size value="255"/> - <layout type="log4net.Layout.PatternLayout"> - <conversionPattern value="%thread"/> - </layout> - </parameter> - <parameter> - <parameterName value="@log_level"/> - <dbType value="String"/> - <size value="50"/> - <layout type="log4net.Layout.PatternLayout"> - <conversionPattern value="%level"/> - </layout> - </parameter> - <parameter> - <parameterName value="@logger"/> - <dbType value="String"/> - <size value="255"/> - <layout type="log4net.Layout.PatternLayout"> - <conversionPattern value="%logger"/> - </layout> - </parameter> - <parameter> - <parameterName value="@message"/> - <dbType value="String"/> - <size value="4000"/> - <layout type="log4net.Layout.PatternLayout"> - <conversionPattern value="%message"/> - </layout> - </parameter> - <parameter> - <parameterName value="@exception"/> - <dbType value="String"/> - <size value="2000"/> - <layout type="log4net.Layout.ExceptionLayout"/> - </parameter> - </appender> - <!-- Setup the root category, add the appenders and set the default level --> - <root> - <level value="WARN"/> - <appender-ref ref="AdoNetAppender"/> - </root> - <!-- Specify the level for some specific categories --> - <logger name="DotNetOpenAuth"> - <level value="WARN"/> - </logger> - <logger name="DotNetOpenAuth.OpenId"> - <level value="INFO"/> - </logger> - <logger name="DotNetOpenAuth.OAuth"> - <level value="INFO"/> - </logger> - </log4net> - <appSettings> - <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" /> - </appSettings> - <connectionStrings> - <!-- Remember to keep this connection string in sync with the one (if any) that appears in the log4net section. --> - <add name="DatabaseEntities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\MvcRelyingParty.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient"/> - </connectionStrings> - <system.web> - <httpRuntime targetFramework="4.5" /> - <!-- - Set compilation debug="true" to insert debugging - symbols into the compiled page. Because this - affects performance, set this value to true only - during development. - --> - <compilation debug="true" targetFramework="4.0"> - <assemblies> - <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> - <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> - <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> - <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> - <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> - </assemblies> - </compilation> - <!-- - The <authentication> section enables configuration - of the security authentication mode used by - ASP.NET to identify an incoming user. - --> - <authentication mode="Forms"> - <forms loginUrl="~/Auth/LogOn" timeout="2880" name="MvcRelyingParty"/> - </authentication> - <roleManager enabled="true" defaultProvider="Database"> - <providers> - <add name="Database" type="RelyingPartyLogic.DataRoleProvider, RelyingPartyLogic"/> - </providers> - </roleManager> - <!-- - The <customErrors> section enables configuration - of what to do if/when an unhandled error occurs - during the execution of a request. Specifically, - it enables developers to configure html error pages - to be displayed in place of a error stack trace. - - <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> - <error statusCode="403" redirect="NoAccess.htm" /> - <error statusCode="404" redirect="FileNotFound.htm" /> - </customErrors> - --> - <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"> - <namespaces> - <add namespace="System.Web.Mvc"/> - <add namespace="System.Web.Mvc.Ajax"/> - <add namespace="System.Web.Mvc.Html"/> - <add namespace="System.Web.Routing"/> - <add namespace="System.Linq"/> - <add namespace="System.Collections.Generic"/> - </namespaces> - </pages> - <httpHandlers> - <add verb="*" path="*.mvc" validate="false" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> - </httpHandlers> - <httpModules> - <add name="OAuthAuthenticationModule" type="RelyingPartyLogic.OAuthAuthenticationModule, RelyingPartyLogic"/> - <add name="Database" type="RelyingPartyLogic.Database, RelyingPartyLogic"/> - </httpModules> - </system.web> - <system.web.extensions/> - <!-- - The system.webServer section is required for running ASP.NET AJAX under Internet - Information Services 7.0. It is not necessary for previous version of IIS. - --> - <system.webServer> - <validation validateIntegratedModeConfiguration="false"/> - <modules runAllManagedModulesForAllRequests="true"> - <add name="OAuthAuthenticationModule" type="RelyingPartyLogic.OAuthAuthenticationModule, RelyingPartyLogic"/> - <add name="Database" type="RelyingPartyLogic.Database, RelyingPartyLogic"/> - </modules> - <handlers> - <remove name="MvcHttpHandler"/> - <remove name="UrlRoutingHandler"/> - <add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> - </handlers> - </system.webServer> - <runtime> - <legacyHMACWarning enabled="0"/> - <!-- When targeting ASP.NET MVC 3, this assemblyBinding makes MVC 1 and 2 references relink - to MVC 3 so libraries such as DotNetOpenAuth that compile against MVC 1 will work with it. --> - <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> - <dependentAssembly> - <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> - <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> - </dependentAssembly> - </assemblyBinding> - </runtime> - <system.serviceModel> - <behaviors> - <serviceBehaviors> - <behavior name="DataApiBehavior"> - <serviceMetadata httpGetEnabled="true"/> - <serviceDebug includeExceptionDetailInFaults="true"/> - <serviceAuthorization serviceAuthorizationManagerType="OAuthAuthorizationManager, __code" principalPermissionMode="Custom"/> - </behavior> - </serviceBehaviors> - </behaviors> - <services> - <!--<service behaviorConfiguration="DataApiBehavior" name="DataApi"> - </service>--> - </services> - </system.serviceModel> - <!-- Protect certain user pages from delegated (OAuth) clients. --> - <location path="Account"> - <system.web> - <authorization> - <deny roles="delegated"/> - </authorization> - </system.web> - </location> -</configuration> diff --git a/projecttemplates/MvcRelyingParty/packages.config b/projecttemplates/MvcRelyingParty/packages.config deleted file mode 100644 index 2f4e283..0000000 --- a/projecttemplates/MvcRelyingParty/packages.config +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<packages> - <package id="log4net" version="2.0.0" targetFramework="net45" /> - <package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" /> - <package id="Validation" version="2.0.2.13022" targetFramework="net45" /> -</packages>
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyDatabase/.gitignore b/projecttemplates/RelyingPartyDatabase/.gitignore deleted file mode 100644 index 43b64c4..0000000 --- a/projecttemplates/RelyingPartyDatabase/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -sql/debug -sql/release -*.dbmdl -*.scmp -*.publish.xml diff --git a/projecttemplates/RelyingPartyDatabase/Permissions.sql b/projecttemplates/RelyingPartyDatabase/Permissions.sql deleted file mode 100644 index 5f28270..0000000 --- a/projecttemplates/RelyingPartyDatabase/Permissions.sql +++ /dev/null @@ -1 +0,0 @@ -
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyDatabase/Properties/Database.sqlcmdvars b/projecttemplates/RelyingPartyDatabase/Properties/Database.sqlcmdvars deleted file mode 100644 index dbdd8c5..0000000 --- a/projecttemplates/RelyingPartyDatabase/Properties/Database.sqlcmdvars +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<SqlCommandVariables xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.SqlCmdVars"> - <Version>1.0</Version> - <Properties> - </Properties> -</SqlCommandVariables>
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyDatabase/Properties/Database.sqldeployment b/projecttemplates/RelyingPartyDatabase/Properties/Database.sqldeployment deleted file mode 100644 index a51546c..0000000 --- a/projecttemplates/RelyingPartyDatabase/Properties/Database.sqldeployment +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<DeploymentConfigurationSettings xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.DeploymentConfigurationSettings"> - <Version>1.0</Version> - <Properties> - <AbortOnFirstError>False</AbortOnFirstError> - <AlwaysCreateNewDatabase>True</AlwaysCreateNewDatabase> - <BlockIncrementalDeploymentIfDataLoss>True</BlockIncrementalDeploymentIfDataLoss> - <CommentOutSetVarDeclarations>True</CommentOutSetVarDeclarations> - <DeployDatabaseProperties>True</DeployDatabaseProperties> - <DeploymentCollationPreference>UseSourceModelCollation</DeploymentCollationPreference> - <DoNotUseAlterAssemblyStatementsToUpdateCLRTypes>False</DoNotUseAlterAssemblyStatementsToUpdateCLRTypes> - <GenerateDropsIfNotInProject>False</GenerateDropsIfNotInProject> - <PerformDatabaseBackup>False</PerformDatabaseBackup> - <SingleUserMode>False</SingleUserMode> - </Properties> -</DeploymentConfigurationSettings>
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyDatabase/Properties/Database.sqlpermissions b/projecttemplates/RelyingPartyDatabase/Properties/Database.sqlpermissions deleted file mode 100644 index 2b973b7..0000000 --- a/projecttemplates/RelyingPartyDatabase/Properties/Database.sqlpermissions +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Permissions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:Microsoft.VisualStudio.Data.Schema.Permissions" Version="1.0"> - <!-- The examples below are provided to illustrate how permissions - are defined in the project system for Databases, Objects, - and Columns. - - GRANT Database Permissions - - <PermissionStatement Action ="GRANT"> - <Permission>CREATE TABLE</Permission> - <Grantee>User1</Grantee> - </PermissionStatement> - - GRANT Object Permission - - <PermissionStatement Action ="GRANT"> - <Permission>SELECT</Permission> - <Grantee>User1</Grantee> - <Object Name ="Table1" Schema ="User1" Type ="OBJECT"/> - </PermissionStatement> - - DENY Object Permission - - <PermissionStatement Action ="DENY"> - <Permission>DELETE</Permission> - <Grantee>User1</Grantee> - <Object Name ="Table1" Schema ="User1" Type ="OBJECT"/> - </PermissionStatement> - - GRANT Object Column Permission - - <PermissionStatement Action ="GRANT"> - <Permission>SELECT</Permission> - <Grantee>User1</Grantee> - <Object Name ="Table1" Schema ="User1" Type ="OBJECT"> - <Columns Treatment ="INCLUDE"> - <Column Name=”Col1”/> - <Column Name=”Col2”/> - <Column Name=”…”/> - </Columns> - </Object> - </PermissionStatement> - --> -</Permissions>
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyDatabase/Properties/Database.sqlsettings b/projecttemplates/RelyingPartyDatabase/Properties/Database.sqlsettings deleted file mode 100644 index f83aff5..0000000 --- a/projecttemplates/RelyingPartyDatabase/Properties/Database.sqlsettings +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<CatalogProperties xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.CatalogProperties"> - <Version>1.0</Version> - <Properties> - <AllowSnapshotIsolation>False</AllowSnapshotIsolation> - <AnsiNullDefault>False</AnsiNullDefault> - <AnsiNulls>False</AnsiNulls> - <AnsiPadding>False</AnsiPadding> - <AnsiWarnings>False</AnsiWarnings> - <ArithAbort>False</ArithAbort> - <AutoClose>True</AutoClose> - <AutoCreateStatistics>True</AutoCreateStatistics> - <AutoShrink>False</AutoShrink> - <AutoUpdateStatistics>True</AutoUpdateStatistics> - <AutoUpdateStatisticsAsynchronously>False</AutoUpdateStatisticsAsynchronously> - <ChangeTrackingRetentionPeriod>2</ChangeTrackingRetentionPeriod> - <ChangeTrackingRetentionUnit>Days</ChangeTrackingRetentionUnit> - <CloseCursorOnCommitEnabled>False</CloseCursorOnCommitEnabled> - <CompatibilityMode>90</CompatibilityMode> - <ConcatNullYieldsNull>False</ConcatNullYieldsNull> - <DatabaseAccess>MULTI_USER</DatabaseAccess> - <DatabaseChaining>False</DatabaseChaining> - <DatabaseState>ONLINE</DatabaseState> - <DateCorrelationOptimizationOn>False</DateCorrelationOptimizationOn> - <DefaultCollation>SQL_Latin1_General_CP1_CI_AS</DefaultCollation> - <DefaultCursor>GLOBAL</DefaultCursor> - <DefaultFilegroup>PRIMARY</DefaultFilegroup> - <EnableFullTextSearch>True</EnableFullTextSearch> - <IsBrokerPriorityHonored>False</IsBrokerPriorityHonored> - <IsChangeTrackingAutoCleanupOn>True</IsChangeTrackingAutoCleanupOn> - <IsChangeTrackingOn>False</IsChangeTrackingOn> - <IsEncryptionOn>False</IsEncryptionOn> - <NumericRoundAbort>False</NumericRoundAbort> - <PageVerify>CHECKSUM</PageVerify> - <Parameterization>SIMPLE</Parameterization> - <QuotedIdentifier>False</QuotedIdentifier> - <ReadCommittedSnapshot>False</ReadCommittedSnapshot> - <Recovery>SIMPLE</Recovery> - <RecursiveTriggersEnabled>False</RecursiveTriggersEnabled> - <ServiceBrokerOption>DisableBroker</ServiceBrokerOption> - <SupplementalLoggingOn>False</SupplementalLoggingOn> - <TornPageDetection>False</TornPageDetection> - <Trustworthy>False</Trustworthy> - <UpdateOptions>READ_WRITE</UpdateOptions> - <VardecimalStorageFormatOn>True</VardecimalStorageFormatOn> - </Properties> -</CatalogProperties>
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyDatabase/RelyingPartyDatabase.sqlproj b/projecttemplates/RelyingPartyDatabase/RelyingPartyDatabase.sqlproj deleted file mode 100644 index ea17196..0000000 --- a/projecttemplates/RelyingPartyDatabase/RelyingPartyDatabase.sqlproj +++ /dev/null @@ -1,317 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))' != '' " /> - <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> - <PropertyGroup> - <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> - </PropertyGroup> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Name>RelyingPartyDatabase</Name> - <SchemaVersion>2.0</SchemaVersion> - <ProjectVersion>4.0</ProjectVersion> - <DSP>Microsoft.Data.Tools.Schema.Sql.Sql90DatabaseSchemaProvider</DSP> - <AppDesignerFolder>Properties</AppDesignerFolder> - <ShowWizard>True</ShowWizard> - <OutputType>Database</OutputType> - <RootPath> - </RootPath> - <IncludeSchemaNameInFileName>False</IncludeSchemaNameInFileName> - <ModelCollation>1033,CI</ModelCollation> - <DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure> - <RootNamespace>RelyingPartyDatabase</RootNamespace> - <DefaultSchema>dbo</DefaultSchema> - <PreviousProjectVersion>4.0</PreviousProjectVersion> - <ValidateCasingOnIdentifiers>False</ValidateCasingOnIdentifiers> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProjectGuid>{08a938b6-ebbd-4036-880e-ce7ba2d14510}</ProjectGuid> - <GenerateDatabaseFile>False</GenerateDatabaseFile> - <GenerateCreateScript>True</GenerateCreateScript> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> - <SqlServerVerification>False</SqlServerVerification> - <TargetLanguage>CS</TargetLanguage> - <AllowSnapshotIsolation>False</AllowSnapshotIsolation> - <AnsiNullDefault>False</AnsiNullDefault> - <AnsiNulls>False</AnsiNulls> - <AnsiPadding>False</AnsiPadding> - <AnsiWarnings>False</AnsiWarnings> - <ArithAbort>False</ArithAbort> - <AutoClose>True</AutoClose> - <AutoCreateStatistics>True</AutoCreateStatistics> - <AutoShrink>False</AutoShrink> - <AutoUpdateStatistics>True</AutoUpdateStatistics> - <AutoUpdateStatisticsAsynchronously>False</AutoUpdateStatisticsAsynchronously> - <ChangeTrackingRetentionPeriod>2</ChangeTrackingRetentionPeriod> - <ChangeTrackingRetentionUnit>Days</ChangeTrackingRetentionUnit> - <CloseCursorOnCommitEnabled>False</CloseCursorOnCommitEnabled> - <CompatibilityMode>90</CompatibilityMode> - <ConcatNullYieldsNull>False</ConcatNullYieldsNull> - <DatabaseAccess>MULTI_USER</DatabaseAccess> - <DatabaseChaining>False</DatabaseChaining> - <DatabaseState>ONLINE</DatabaseState> - <DateCorrelationOptimizationOn>False</DateCorrelationOptimizationOn> - <DefaultCollation>SQL_Latin1_General_CP1_CI_AS</DefaultCollation> - <DefaultCursor>GLOBAL</DefaultCursor> - <DefaultFilegroup>PRIMARY</DefaultFilegroup> - <EnableFullTextSearch>True</EnableFullTextSearch> - <IsBrokerPriorityHonored>False</IsBrokerPriorityHonored> - <IsChangeTrackingAutoCleanupOn>True</IsChangeTrackingAutoCleanupOn> - <IsChangeTrackingOn>False</IsChangeTrackingOn> - <IsEncryptionOn>False</IsEncryptionOn> - <NumericRoundAbort>False</NumericRoundAbort> - <PageVerify>CHECKSUM</PageVerify> - <Parameterization>SIMPLE</Parameterization> - <QuotedIdentifier>False</QuotedIdentifier> - <ReadCommittedSnapshot>False</ReadCommittedSnapshot> - <Recovery>SIMPLE</Recovery> - <RecursiveTriggersEnabled>False</RecursiveTriggersEnabled> - <ServiceBrokerOption>DisableBroker</ServiceBrokerOption> - <SupplementalLoggingOn>False</SupplementalLoggingOn> - <TornPageDetection>False</TornPageDetection> - <Trustworthy>False</Trustworthy> - <UpdateOptions>READ_WRITE</UpdateOptions> - <VardecimalStorageFormatOn>True</VardecimalStorageFormatOn> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <OutputPath>.\sql\release\</OutputPath> - <BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName> - <TargetDatabase>RelyingPartyDatabase</TargetDatabase> - <TreatTSqlWarningsAsErrors>False</TreatTSqlWarningsAsErrors> - <SuppressTSqlWarnings /> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <OutputPath>.\sql\debug\</OutputPath> - <BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName> - <TargetDatabase>RelyingPartyDatabase</TargetDatabase> - <TreatTSqlWarningsAsErrors>False</TreatTSqlWarningsAsErrors> - <SuppressTSqlWarnings /> - </PropertyGroup> - <!--Import the settings--> - <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" /> - <ItemGroup> - <Folder Include="Properties\" /> - <Folder Include="Schema Objects\" /> - <Folder Include="Schema Objects\Database Level Objects\" /> - <Folder Include="Schema Objects\Database Level Objects\Assemblies\" /> - <Folder Include="Schema Objects\Database Level Objects\Database Triggers\" /> - <Folder Include="Schema Objects\Database Level Objects\Security\" /> - <Folder Include="Schema Objects\Database Level Objects\Security\Asymmetric Keys\" /> - <Folder Include="Schema Objects\Database Level Objects\Security\Certificates\" /> - <Folder Include="Schema Objects\Database Level Objects\Security\Database Audit Specification\" /> - <Folder Include="Schema Objects\Database Level Objects\Security\Database Encryption Keys\" /> - <Folder Include="Schema Objects\Database Level Objects\Security\Master Keys\" /> - <Folder Include="Schema Objects\Database Level Objects\Security\Roles\" /> - <Folder Include="Schema Objects\Database Level Objects\Security\Roles\Application Roles\" /> - <Folder Include="Schema Objects\Database Level Objects\Security\Roles\Database Roles\" /> - <Folder Include="Schema Objects\Database Level Objects\Security\Schemas\" /> - <Folder Include="Schema Objects\Database Level Objects\Security\Signatures\" /> - <Folder Include="Schema Objects\Database Level Objects\Security\Symmetric Keys\" /> - <Folder Include="Schema Objects\Database Level Objects\Security\Users\" /> - <Folder Include="Schema Objects\Database Level Objects\Service Broker\" /> - <Folder Include="Schema Objects\Database Level Objects\Service Broker\Broker Priorities\" /> - <Folder Include="Schema Objects\Database Level Objects\Service Broker\Contracts\" /> - <Folder Include="Schema Objects\Database Level Objects\Service Broker\Event Notifications\" /> - <Folder Include="Schema Objects\Database Level Objects\Service Broker\Message Types\" /> - <Folder Include="Schema Objects\Database Level Objects\Service Broker\Queues\" /> - <Folder Include="Schema Objects\Database Level Objects\Service Broker\Remote Service Binding\" /> - <Folder Include="Schema Objects\Database Level Objects\Service Broker\Routes\" /> - <Folder Include="Schema Objects\Database Level Objects\Service Broker\Services\" /> - <Folder Include="Schema Objects\Database Level Objects\Storage\" /> - <Folder Include="Schema Objects\Database Level Objects\Storage\Filegroups\" /> - <Folder Include="Schema Objects\Database Level Objects\Storage\Files\" /> - <Folder Include="Schema Objects\Database Level Objects\Storage\Full Text Catalogs\" /> - <Folder Include="Schema Objects\Database Level Objects\Storage\Full Text Stoplists\" /> - <Folder Include="Schema Objects\Database Level Objects\Storage\Partition Functions\" /> - <Folder Include="Schema Objects\Database Level Objects\Storage\Partition Schemes\" /> - <Folder Include="Schema Objects\Schemas\" /> - <Folder Include="Schema Objects\Schemas\dbo\" /> - <Folder Include="Schema Objects\Schemas\dbo\Programmability\" /> - <Folder Include="Schema Objects\Schemas\dbo\Programmability\Defaults\" /> - <Folder Include="Schema Objects\Schemas\dbo\Programmability\Functions\" /> - <Folder Include="Schema Objects\Schemas\dbo\Programmability\Rules\" /> - <Folder Include="Schema Objects\Schemas\dbo\Programmability\Stored Procedures\" /> - <Folder Include="Schema Objects\Schemas\dbo\Programmability\Types\" /> - <Folder Include="Schema Objects\Schemas\dbo\Programmability\Types\User Defined Data Types\" /> - <Folder Include="Schema Objects\Schemas\dbo\Programmability\Types\User Defined Table Types\" /> - <Folder Include="Schema Objects\Schemas\dbo\Programmability\Types\User Defined Types CLR\" /> - <Folder Include="Schema Objects\Schemas\dbo\Programmability\Types\XML Schema Collections\" /> - <Folder Include="Schema Objects\Schemas\dbo\Synonyms\" /> - <Folder Include="Schema Objects\Schemas\dbo\Tables\" /> - <Folder Include="Schema Objects\Schemas\dbo\Tables\Constraints\" /> - <Folder Include="Schema Objects\Schemas\dbo\Tables\Indexes\" /> - <Folder Include="Schema Objects\Schemas\dbo\Tables\Keys\" /> - <Folder Include="Schema Objects\Schemas\dbo\Tables\Statistics\" /> - <Folder Include="Schema Objects\Schemas\dbo\Tables\Triggers\" /> - <Folder Include="Schema Objects\Schemas\dbo\Views\" /> - <Folder Include="Schema Objects\Schemas\dbo\Views\Indexes\" /> - <Folder Include="Schema Objects\Schemas\dbo\Views\Statistics\" /> - <Folder Include="Schema Objects\Schemas\dbo\Views\Triggers\" /> - <Folder Include="Scripts" /> - <Folder Include="Scripts\Pre-Deployment" /> - <Folder Include="Scripts\Post-Deployment" /> - <Folder Include="Data Generation Plans" /> - <Folder Include="Schema Comparisons" /> - </ItemGroup> - <ItemGroup> - <Build Include="Permissions.sql" /> - <Build Include="Schema Objects\Database Level Objects\Service Broker\Routes\AutoCreatedLocal.route.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Programmability\Stored Procedures\AddUser.proc.sql"> - <SubType>Code</SubType> - <AnsiNulls>On</AnsiNulls> - <QuotedIdentifier>On</QuotedIdentifier> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Programmability\Stored Procedures\ClearExpiredCryptoKeys.proc.sql"> - <SubType>Code</SubType> - <AnsiNulls>On</AnsiNulls> - <QuotedIdentifier>On</QuotedIdentifier> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Programmability\Stored Procedures\ClearExpiredNonces.proc.sql"> - <SubType>Code</SubType> - <AnsiNulls>On</AnsiNulls> - <QuotedIdentifier>On</QuotedIdentifier> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\AuthenticationToken.table.sql"> - <SubType>Code</SubType> - <AnsiNulls>On</AnsiNulls> - <QuotedIdentifier>On</QuotedIdentifier> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Constraints\DF_AuthenticationToken_CreatedOn.defconst.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Constraints\DF_AuthenticationToken_LastUsed.defconst.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Constraints\DF_AuthenticationToken_UsageCount.defconst.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Constraints\DF_Nonce_Issued.defconst.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Constraints\DF_User_CreatedOn.defconst.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Constraints\DF_User_EmailAddressVerified.defconst.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Indexes\IX_Nonce_Code.index.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Indexes\IX_Nonce_Expires.index.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Keys\FK_AuthenticationToken_User.fkey.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Keys\FK_UserRole_Role.fkey.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Keys\FK_UserRole_User.fkey.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Keys\PK_AuthenticationToken.pkey.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Keys\PK_Nonce.pkey.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Keys\PK_Role.pkey.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Keys\PK_User.pkey.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Keys\PK_UserRole.pkey.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Log.table.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Nonce.table.sql"> - <SubType>Code</SubType> - <AnsiNulls>On</AnsiNulls> - <QuotedIdentifier>On</QuotedIdentifier> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Role.table.sql"> - <SubType>Code</SubType> - <AnsiNulls>On</AnsiNulls> - <QuotedIdentifier>On</QuotedIdentifier> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\User.table.sql"> - <SubType>Code</SubType> - <AnsiNulls>On</AnsiNulls> - <QuotedIdentifier>On</QuotedIdentifier> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\UserRole.table.sql"> - <SubType>Code</SubType> - <AnsiNulls>On</AnsiNulls> - <QuotedIdentifier>On</QuotedIdentifier> - </Build> - </ItemGroup> - <ItemGroup> - <BuildContributorArgument Include="OutDir=$(OutDir)" /> - </ItemGroup> - <ItemGroup> - <None Include="Schema Comparisons\SchemaComparison1.scmp"> - <SubType>NotInBuild</SubType> - </None> - </ItemGroup> - <ItemGroup> - <Build Include="Schema Objects\Schemas\dbo\Tables\Constraints\DF_IssuedToken_CreatedOn_1.defconst.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Keys\FK_IssuedToken_Consumer_1.fkey.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Keys\FK_IssuedToken_User_1.fkey.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Indexes\IX_Consumer_1.index.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Keys\PK_IssuedToken_1.pkey.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Keys\PK_Consumer_1.pkey.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\ClientAuthorization.table.sql"> - <SubType>Code</SubType> - <AnsiNulls>On</AnsiNulls> - <QuotedIdentifier>On</QuotedIdentifier> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Client.table.sql"> - <SubType>Code</SubType> - <AnsiNulls>On</AnsiNulls> - <QuotedIdentifier>On</QuotedIdentifier> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Indexes\IX_CryptoKeys.index.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\Keys\PK_CryptoKeys.pkey.sql"> - <SubType>Code</SubType> - </Build> - <Build Include="Schema Objects\Schemas\dbo\Tables\CryptoKey.table.sql"> - <SubType>Code</SubType> - <AnsiNulls>On</AnsiNulls> - <QuotedIdentifier>On</QuotedIdentifier> - </Build> - </ItemGroup> - <ItemGroup> - </ItemGroup> - <ItemGroup> - <None Include="Debug.publish.xml" /> - <None Include="Release.publish.xml" /> - </ItemGroup> - <ItemGroup> - <PreDeploy Include="Scripts\Pre-Deployment\Script.PreDeployment.sql" /> - </ItemGroup> - <ItemGroup> - <PostDeploy Include="Scripts\Post-Deployment\Script.PostDeployment.sql" /> - </ItemGroup> - <Target Name="GetDeployScriptPath" - DependsOnTargets="Build" - Outputs="$(MSBuildProjectDirectory)$(OutDir)$(MSBuildProjectName)_Create.sql" /> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " /> -</Project>
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyDatabase/Schema Comparisons/SchemaComparison1.scmp b/projecttemplates/RelyingPartyDatabase/Schema Comparisons/SchemaComparison1.scmp deleted file mode 100644 index b80761f..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Comparisons/SchemaComparison1.scmp +++ /dev/null @@ -1,329 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<SchemaComparison> - <Version>10</Version> - <SourceModelProvider> - <ConnectionBasedModelProvider> - <ConnectionString>Data Source=.\sqlexpress;Initial Catalog=RelyingPartyDatabase;Integrated Security=True;Password=</ConnectionString> - <DatabaseName>RelyingPartyDatabase</DatabaseName> - <DspFamilyName>sql</DspFamilyName> - <Name>[THINKAGAIN\sqlexpress.RelyingPartyDatabase]</Name> - </ConnectionBasedModelProvider> - </SourceModelProvider> - <TargetModelProvider> - <ProjectBasedModelProvider> - <ProjectGuid>{2b4261ac-25ac-4b8d-b459-1c42b6b1401d}</ProjectGuid> - <Name>RelyingPartyDatabase</Name> - </ProjectBasedModelProvider> - </TargetModelProvider> - <SchemaCompareSettingsService> - <SchemaCompareSettingsService> - <PropertyElementName> - <Name>Version</Name> - <Value>1</Value> - </PropertyElementName> - </SchemaCompareSettingsService> - <ConfigurationOptionsElement> - <PropertyElementName> - <Name>PlanGenerationType</Name> - <Value>SqlDeploymentOptions</Value> - </PropertyElementName> - <PropertyElementName> - <Name>DoNotUseAlterAssemblyStatementsToUpdateCLRTypes</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>DisableAndReenableDdlTriggers</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreDdlTriggerOrder</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreDdlTriggerState</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreObjectPlacementOnPartitionScheme</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreAuthorizer</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreDefaultSchema</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreRouteLifetime</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>OnlyCompareElementsInSource</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreStatisticsSample</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>CommentOutSetVarDeclarations</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>GenerateDeployStateChecks</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>DeployDatabaseProperties</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreComments</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreWhitespace</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreKeywordCasing</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreSemicolonBetweenStatements</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>BlockIncrementalDeploymentIfDataLoss</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>PerformDatabaseBackup</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SingleUserMode</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IncludeTransactionalScripts</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>EnforceMinimalDependencies</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>DeploymentCollationPreference</Name> - <Value>UseSourceModelCollation</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnorePartitionSchemes</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreWithNocheckOnCheckConstraints</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreWithNocheckOnForeignKeys</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreIdentitySeed</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreIncrement</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreFillFactor</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreIndexPadding</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreColumnCollation</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreLockHintsOnIndexes</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreTableOptions</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreIndexOptions</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreDmlTriggerOrder</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>ScriptDatabaseCollation</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreDmlTriggerState</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreAnsiNulls</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreQuotedIdentifiers</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreUserSettingsObjects</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>AbortOnFirstError</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreFilegroupPlacement</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreFullTextCatalogFilePath</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreFileAndLogFilePath</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreLoginSids</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreNotForReplication</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreFileSize</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>OverrideSevenSetOptions</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SetAnsiNulls</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SetAnsiPadding</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SetAnsiWarnings</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SetArithAbort</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SetConcatNullYieldsNull</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SetQuotedIdentifier</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SetNumericRoundAbort</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>UnmodifiableObjectWarnings</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>DropIndexesNotInSource</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>DropConstraintsNotInSource</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>CheckNewConstraints</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreColumnOrder</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnorePasswords</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreBodyDependencies</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SourceSqlCmdVariablesFile</Name> - <Value>C:\Users\andarno\git\dotnetopenid\projecttemplates\RelyingPartyDatabase\Properties\Database.sqlcmdvars</Value> - </PropertyElementName> - <PropertyElementName> - <Name>AlwaysCreateNewDatabase</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>GenerateDropsIfNotInProject</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>TargetDatabaseName</Name> - <Value>RelyingPartyDatabase</Value> - </PropertyElementName> - <PropertyElementName> - <Name>TargetConnectionString</Name> - <Value>Data Source=.\sqlexpress;Initial Catalog=RelyingPartyDatabase;Integrated Security=True;Pooling=False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>VerifyDeployment</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>TreatVerificationErrorsAsWarnings</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>BuildtimeContributorsMustExist</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlPermissionStatement</Name> - <Value>ExcludedType</Value> - </PropertyElementName> - <PropertyElementName> - <Name>Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlFilegroup</Name> - <Value>ExcludedType</Value> - </PropertyElementName> - <PropertyElementName> - <Name>Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlFile</Name> - <Value>ExcludedType</Value> - </PropertyElementName> - <PropertyElementName> - <Name>Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlExtendedProperty</Name> - <Value>ExcludedType</Value> - </PropertyElementName> - </ConfigurationOptionsElement> - </SchemaCompareSettingsService> - <SchemaCompareViewSettings /> -</SchemaComparison>
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyDatabase/Schema Comparisons/SchemaComparison1_20120225042555.scmp b/projecttemplates/RelyingPartyDatabase/Schema Comparisons/SchemaComparison1_20120225042555.scmp deleted file mode 100644 index b3160a4..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Comparisons/SchemaComparison1_20120225042555.scmp +++ /dev/null @@ -1,328 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<SchemaComparison> - <Version>1</Version> - <SourceModelProvider> - <ConnectionBasedModelProvider> - <ConnectionString>Data Source=.\sqlexpress;Initial Catalog=RelyingPartyDatabase;Integrated Security=True;Password=</ConnectionString> - <DatabaseName>RelyingPartyDatabase</DatabaseName> - <DspFamilyName>sql</DspFamilyName> - <Name>[THINKAGAIN\sqlexpress.RelyingPartyDatabase]</Name> - </ConnectionBasedModelProvider> - </SourceModelProvider> - <TargetModelProvider> - <ProjectBasedModelProvider> - <ProjectGuid>{2b4261ac-25ac-4b8d-b459-1c42b6b1401d}</ProjectGuid> - <Name>RelyingPartyDatabase</Name> - </ProjectBasedModelProvider> - </TargetModelProvider> - <SchemaCompareSettingsService> - <SchemaCompareSettingsService> - <PropertyElementName> - <Name>Version</Name> - <Value>1</Value> - </PropertyElementName> - </SchemaCompareSettingsService> - <ConfigurationOptionsElement> - <PropertyElementName> - <Name>PlanGenerationType</Name> - <Value>Sql90SchemaDeploymentOptions</Value> - </PropertyElementName> - <PropertyElementName> - <Name>DoNotUseAlterAssemblyStatementsToUpdateCLRTypes</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>DisableAndReenableDdlTriggers</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreDdlTriggerOrder</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreDdlTriggerState</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreObjectPlacementOnPartitionScheme</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreAuthorizer</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreDefaultSchema</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreRouteLifetime</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>OnlyCompareElementsInSource</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreStatisticsSample</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>CommentOutSetVarDeclarations</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>GenerateDeployStateChecks</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>DeployDatabaseProperties</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreComments</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreWhitespace</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreKeywordCasing</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreSemicolonBetweenStatements</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>BlockIncrementalDeploymentIfDataLoss</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>PerformDatabaseBackup</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SingleUserMode</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IncludeTransactionalScripts</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>EnforceMinimalDependencies</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>DeploymentCollationPreference</Name> - <Value>UseSourceModelCollation</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnorePartitionSchemes</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreWithNocheckOnCheckConstraints</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreWithNocheckOnForeignKeys</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreIdentitySeed</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreIncrement</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreFillFactor</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreIndexPadding</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreColumnCollation</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreLockHintsOnIndexes</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreTableOptions</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreIndexOptions</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreDmlTriggerOrder</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>ScriptDatabaseCollation</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreDmlTriggerState</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreAnsiNulls</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreQuotedIdentifiers</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreUserSettingsObjects</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>AbortOnFirstError</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreFilegroupPlacement</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreFullTextCatalogFilePath</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreFileAndLogFilePath</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreLoginSids</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreNotForReplication</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreFileSize</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>OverrideSevenSetOptions</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SetAnsiNulls</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SetAnsiPadding</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SetAnsiWarnings</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SetArithAbort</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SetConcatNullYieldsNull</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SetQuotedIdentifier</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SetNumericRoundAbort</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>UnmodifiableObjectWarnings</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>DropIndexesNotInSource</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>DropConstraintsNotInSource</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>CheckNewConstraints</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreColumnOrder</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnorePasswords</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>IgnoreBodyDependencies</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>SourceSqlCmdVariablesFile</Name> - <Value>C:\Users\andarno\git\dotnetopenid\projecttemplates\RelyingPartyDatabase\Properties\Database.sqlcmdvars</Value> - </PropertyElementName> - <PropertyElementName> - <Name>AlwaysCreateNewDatabase</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>GenerateDropsIfNotInProject</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>TargetDatabaseName</Name> - <Value>RelyingPartyDatabase</Value> - </PropertyElementName> - <PropertyElementName> - <Name>TargetConnectionString</Name> - <Value>Data Source=.\sqlexpress;Initial Catalog=RelyingPartyDatabase;Integrated Security=True;Pooling=False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>VerifyDeployment</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>TreatVerificationErrorsAsWarnings</Name> - <Value>False</Value> - </PropertyElementName> - <PropertyElementName> - <Name>BuildtimeContributorsMustExist</Name> - <Value>True</Value> - </PropertyElementName> - <PropertyElementName> - <Name>Microsoft.Data.Schema.Sql.SchemaModel.ISqlPermissionStatement</Name> - <Value>ExcludedType</Value> - </PropertyElementName> - <PropertyElementName> - <Name>Microsoft.Data.Schema.Sql.SchemaModel.ISqlFilegroup</Name> - <Value>ExcludedType</Value> - </PropertyElementName> - <PropertyElementName> - <Name>Microsoft.Data.Schema.Sql.SchemaModel.ISqlFile</Name> - <Value>ExcludedType</Value> - </PropertyElementName> - <PropertyElementName> - <Name>Microsoft.Data.Schema.Sql.SchemaModel.ISqlExtendedProperty</Name> - <Value>ExcludedType</Value> - </PropertyElementName> - </ConfigurationOptionsElement> - </SchemaCompareSettingsService> -</SchemaComparison>
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Database Level Objects/Service Broker/Routes/AutoCreatedLocal.route.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Database Level Objects/Service Broker/Routes/AutoCreatedLocal.route.sql deleted file mode 100644 index 4d731a7..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Database Level Objects/Service Broker/Routes/AutoCreatedLocal.route.sql +++ /dev/null @@ -1,4 +0,0 @@ -CREATE ROUTE [AutoCreatedLocal] - AUTHORIZATION [dbo] - WITH ADDRESS = N'LOCAL'; - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Programmability/Stored Procedures/AddUser.proc.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Programmability/Stored Procedures/AddUser.proc.sql deleted file mode 100644 index b22b231..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Programmability/Stored Procedures/AddUser.proc.sql +++ /dev/null @@ -1,37 +0,0 @@ -CREATE PROCEDURE [dbo].[AddUser] - ( - @firstName nvarchar(50), - @lastName nvarchar(50), - @openid nvarchar(255), - @role nvarchar(255) - ) -AS - DECLARE - @roleid int, - @userid int - - BEGIN TRANSACTION - - INSERT INTO [dbo].[User] (FirstName, LastName) VALUES (@firstName, @lastName) - SET @userid = (SELECT @@IDENTITY) - - IF (SELECT COUNT(*) FROM dbo.Role WHERE [Name] = @role) = 0 - BEGIN - INSERT INTO dbo.Role (Name) VALUES (@role) - SET @roleid = (SELECT @@IDENTITY) - END - ELSE - BEGIN - SET @roleid = (SELECT RoleId FROM dbo.Role WHERE [Name] = @role) - END - - INSERT INTO dbo.UserRole (UserId, RoleId) VALUES (@userId, @roleid) - - INSERT INTO dbo.AuthenticationToken - (UserId, OpenIdClaimedIdentifier, OpenIdFriendlyIdentifier) - VALUES - (@userid, @openid, @openid) - - COMMIT TRANSACTION - - RETURN @userid diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Programmability/Stored Procedures/ClearExpiredCryptoKeys.proc.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Programmability/Stored Procedures/ClearExpiredCryptoKeys.proc.sql deleted file mode 100644 index 777ba9b..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Programmability/Stored Procedures/ClearExpiredCryptoKeys.proc.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE PROCEDURE dbo.ClearExpiredCryptoKeys -AS - -DELETE FROM dbo.CryptoKey -WHERE [Expiration] < getutcdate() diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Programmability/Stored Procedures/ClearExpiredNonces.proc.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Programmability/Stored Procedures/ClearExpiredNonces.proc.sql deleted file mode 100644 index 3299c6c..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Programmability/Stored Procedures/ClearExpiredNonces.proc.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE PROCEDURE dbo.ClearExpiredNonces -AS - -DELETE FROM dbo.[Nonce] -WHERE [Expires] < getutcdate() diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/AuthenticationToken.table.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/AuthenticationToken.table.sql deleted file mode 100644 index 920e36e..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/AuthenticationToken.table.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE [dbo].[AuthenticationToken] ( - [AuthenticationTokenId] INT IDENTITY (1, 1) NOT NULL, - [UserId] INT NOT NULL, - [OpenIdClaimedIdentifier] NVARCHAR (250) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL, - [OpenIdFriendlyIdentifier] NVARCHAR (250) NULL, - [CreatedOn] DATETIME NOT NULL, - [LastUsed] DATETIME NOT NULL, - [UsageCount] INT NOT NULL -); - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Client.table.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Client.table.sql deleted file mode 100644 index 49f6c3f..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Client.table.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE [dbo].[Client] ( - [ClientId] INT IDENTITY (1, 1) NOT NULL, - [ClientIdentifier] VARCHAR (255) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL, - [ClientSecret] VARCHAR (255) COLLATE SQL_Latin1_General_CP1_CS_AS NULL, - [Callback] VARCHAR (2048) NULL, - [ClientType] INT, - [Name] NVARCHAR (50) NOT NULL -); - - - - - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/ClientAuthorization.table.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/ClientAuthorization.table.sql deleted file mode 100644 index 3a31062..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/ClientAuthorization.table.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE [dbo].[ClientAuthorization] ( - [AuthorizationId] INT IDENTITY (1, 1) NOT NULL, - [ClientId] INT NOT NULL, - [UserId] INT NOT NULL, - [CreatedOn] DATETIME NOT NULL, - [ExpirationDate] DATETIME NULL, - [Scope] VARCHAR (2048) NULL -); - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_AuthenticationToken_CreatedOn.defconst.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_AuthenticationToken_CreatedOn.defconst.sql deleted file mode 100644 index df7c22e..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_AuthenticationToken_CreatedOn.defconst.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[AuthenticationToken] - ADD CONSTRAINT [DF_AuthenticationToken_CreatedOn] DEFAULT (getutcdate()) FOR [CreatedOn]; - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_AuthenticationToken_LastUsed.defconst.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_AuthenticationToken_LastUsed.defconst.sql deleted file mode 100644 index 95f5490..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_AuthenticationToken_LastUsed.defconst.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[AuthenticationToken] - ADD CONSTRAINT [DF_AuthenticationToken_LastUsed] DEFAULT (getutcdate()) FOR [LastUsed]; - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_AuthenticationToken_UsageCount.defconst.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_AuthenticationToken_UsageCount.defconst.sql deleted file mode 100644 index f7a65df..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_AuthenticationToken_UsageCount.defconst.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[AuthenticationToken] - ADD CONSTRAINT [DF_AuthenticationToken_UsageCount] DEFAULT ((0)) FOR [UsageCount]; - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_IssuedToken_CreatedOn_1.defconst.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_IssuedToken_CreatedOn_1.defconst.sql deleted file mode 100644 index 3ba2b0b..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_IssuedToken_CreatedOn_1.defconst.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[ClientAuthorization] - ADD CONSTRAINT [DF_IssuedToken_CreatedOn] DEFAULT (getutcdate()) FOR [CreatedOn]; - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_Nonce_Issued.defconst.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_Nonce_Issued.defconst.sql deleted file mode 100644 index 84b5e52..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_Nonce_Issued.defconst.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[Nonce] - ADD CONSTRAINT [DF_Nonce_Issued] DEFAULT (getutcdate()) FOR [Issued]; - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_User_CreatedOn.defconst.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_User_CreatedOn.defconst.sql deleted file mode 100644 index 101d2c2..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_User_CreatedOn.defconst.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[User] - ADD CONSTRAINT [DF_User_CreatedOn] DEFAULT (getutcdate()) FOR [CreatedOn]; - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_User_EmailAddressVerified.defconst.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_User_EmailAddressVerified.defconst.sql deleted file mode 100644 index 04779be..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Constraints/DF_User_EmailAddressVerified.defconst.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[User] - ADD CONSTRAINT [DF_User_EmailAddressVerified] DEFAULT ((0)) FOR [EmailAddressVerified]; - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/CryptoKey.table.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/CryptoKey.table.sql deleted file mode 100644 index a5af46c..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/CryptoKey.table.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE [dbo].[CryptoKey] ( - [CryptoKeyId] INT IDENTITY (1, 1) NOT NULL, - [Bucket] VARCHAR (255) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL, - [Handle] VARCHAR (255) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL, - [Expiration] DATETIME NOT NULL, - [Secret] VARBINARY (4096) NOT NULL -); - - - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Indexes/IX_Consumer_1.index.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Indexes/IX_Consumer_1.index.sql deleted file mode 100644 index e5ad21b..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Indexes/IX_Consumer_1.index.sql +++ /dev/null @@ -1,4 +0,0 @@ -CREATE UNIQUE NONCLUSTERED INDEX [IX_Consumer] - ON [dbo].[Client]([ClientIdentifier] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF, ONLINE = OFF, MAXDOP = 0) - ON [PRIMARY]; - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Indexes/IX_CryptoKeys.index.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Indexes/IX_CryptoKeys.index.sql deleted file mode 100644 index bd8876e..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Indexes/IX_CryptoKeys.index.sql +++ /dev/null @@ -1,4 +0,0 @@ -CREATE UNIQUE NONCLUSTERED INDEX [IX_CryptoKeys] - ON [dbo].[CryptoKey]([Bucket] ASC, [Handle] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF, ONLINE = OFF, MAXDOP = 0) - ON [PRIMARY]; - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Indexes/IX_Nonce_Code.index.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Indexes/IX_Nonce_Code.index.sql deleted file mode 100644 index 5539512..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Indexes/IX_Nonce_Code.index.sql +++ /dev/null @@ -1,3 +0,0 @@ -CREATE UNIQUE NONCLUSTERED INDEX [IX_Nonce_Code] - ON [dbo].[Nonce]([Context] ASC, [Code] ASC, [Issued] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF, ONLINE = OFF, MAXDOP = 0); - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Indexes/IX_Nonce_Expires.index.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Indexes/IX_Nonce_Expires.index.sql deleted file mode 100644 index 23b7cc1..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Indexes/IX_Nonce_Expires.index.sql +++ /dev/null @@ -1,3 +0,0 @@ -CREATE NONCLUSTERED INDEX [IX_Nonce_Expires] - ON [dbo].[Nonce]([Expires] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF, ONLINE = OFF, MAXDOP = 0); - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/FK_AuthenticationToken_User.fkey.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/FK_AuthenticationToken_User.fkey.sql deleted file mode 100644 index 4428616..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/FK_AuthenticationToken_User.fkey.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[AuthenticationToken] - ADD CONSTRAINT [FK_AuthenticationToken_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([UserId]) ON DELETE CASCADE ON UPDATE CASCADE; - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/FK_IssuedToken_Consumer_1.fkey.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/FK_IssuedToken_Consumer_1.fkey.sql deleted file mode 100644 index 062b9d7..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/FK_IssuedToken_Consumer_1.fkey.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[ClientAuthorization] - ADD CONSTRAINT [FK_IssuedToken_Consumer] FOREIGN KEY ([ClientId]) REFERENCES [dbo].[Client] ([ClientId]) ON DELETE CASCADE ON UPDATE CASCADE; - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/FK_IssuedToken_User_1.fkey.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/FK_IssuedToken_User_1.fkey.sql deleted file mode 100644 index e32b291..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/FK_IssuedToken_User_1.fkey.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[ClientAuthorization] - ADD CONSTRAINT [FK_IssuedToken_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([UserId]) ON DELETE CASCADE ON UPDATE CASCADE; - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/FK_UserRole_Role.fkey.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/FK_UserRole_Role.fkey.sql deleted file mode 100644 index 859b6f6..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/FK_UserRole_Role.fkey.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[UserRole] - ADD CONSTRAINT [FK_UserRole_Role] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[Role] ([RoleId]) ON DELETE CASCADE ON UPDATE CASCADE; - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/FK_UserRole_User.fkey.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/FK_UserRole_User.fkey.sql deleted file mode 100644 index bd0a303..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/FK_UserRole_User.fkey.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[UserRole] - ADD CONSTRAINT [FK_UserRole_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([UserId]) ON DELETE CASCADE ON UPDATE CASCADE; - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_AuthenticationToken.pkey.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_AuthenticationToken.pkey.sql deleted file mode 100644 index 21ed5f9..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_AuthenticationToken.pkey.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[AuthenticationToken] - ADD CONSTRAINT [PK_AuthenticationToken] PRIMARY KEY CLUSTERED ([AuthenticationTokenId] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF); - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_Consumer_1.pkey.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_Consumer_1.pkey.sql deleted file mode 100644 index 04c039f..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_Consumer_1.pkey.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[Client] - ADD CONSTRAINT [PK_Consumer] PRIMARY KEY CLUSTERED ([ClientId] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF); - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_CryptoKeys.pkey.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_CryptoKeys.pkey.sql deleted file mode 100644 index ebe7f67..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_CryptoKeys.pkey.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[CryptoKey] - ADD CONSTRAINT [PK_CryptoKeys] PRIMARY KEY CLUSTERED ([CryptoKeyId] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF); - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_IssuedToken_1.pkey.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_IssuedToken_1.pkey.sql deleted file mode 100644 index dcd7edc..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_IssuedToken_1.pkey.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[ClientAuthorization] - ADD CONSTRAINT [PK_IssuedToken] PRIMARY KEY CLUSTERED ([AuthorizationId] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF); - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_Nonce.pkey.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_Nonce.pkey.sql deleted file mode 100644 index d6faf9e..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_Nonce.pkey.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[Nonce] - ADD CONSTRAINT [PK_Nonce] PRIMARY KEY CLUSTERED ([NonceId] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF); - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_Role.pkey.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_Role.pkey.sql deleted file mode 100644 index 62b87cd..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_Role.pkey.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[Role] - ADD CONSTRAINT [PK_Role] PRIMARY KEY CLUSTERED ([RoleId] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF); - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_User.pkey.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_User.pkey.sql deleted file mode 100644 index d44081d..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_User.pkey.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[User] - ADD CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED ([UserId] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF); - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_UserRole.pkey.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_UserRole.pkey.sql deleted file mode 100644 index 77579c0..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Keys/PK_UserRole.pkey.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE [dbo].[UserRole] - ADD CONSTRAINT [PK_UserRole] PRIMARY KEY CLUSTERED ([UserId] ASC, [RoleId] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF); - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Log.table.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Log.table.sql deleted file mode 100644 index 84fd97a..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Log.table.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE [dbo].[Log] ( - [Id] INT IDENTITY (1, 1) NOT NULL, - [Date] DATETIME NOT NULL, - [Thread] VARCHAR (255) NOT NULL, - [Level] VARCHAR (50) NOT NULL, - [Logger] VARCHAR (255) NOT NULL, - [Message] VARCHAR (4000) NOT NULL, - [Exception] VARCHAR (2000) NULL -) diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Nonce.table.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Nonce.table.sql deleted file mode 100644 index bd52d69..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Nonce.table.sql +++ /dev/null @@ -1,8 +0,0 @@ -CREATE TABLE [dbo].[Nonce] ( - [NonceId] INT IDENTITY (1, 1) NOT NULL, - [Context] VARCHAR (255) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL, - [Code] VARCHAR (255) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL, - [Issued] DATETIME NOT NULL, - [Expires] DATETIME NOT NULL -); - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Role.table.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Role.table.sql deleted file mode 100644 index eb7a33c..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/Role.table.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE TABLE [dbo].[Role] ( - [RoleId] INT IDENTITY (1, 1) NOT NULL, - [Name] NVARCHAR (50) NOT NULL -); - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/User.table.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/User.table.sql deleted file mode 100644 index 2df39d6..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/User.table.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE [dbo].[User] ( - [UserId] INT IDENTITY (1, 1) NOT NULL, - [FirstName] NVARCHAR (50) NULL, - [LastName] NVARCHAR (50) NULL, - [EmailAddress] NVARCHAR (100) NULL, - [EmailAddressVerified] BIT NOT NULL, - [CreatedOn] DATETIME NOT NULL -); - diff --git a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/UserRole.table.sql b/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/UserRole.table.sql deleted file mode 100644 index fc69e2e..0000000 --- a/projecttemplates/RelyingPartyDatabase/Schema Objects/Schemas/dbo/Tables/UserRole.table.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE TABLE [dbo].[UserRole] ( - [UserId] INT NOT NULL, - [RoleId] INT NOT NULL -); - diff --git a/projecttemplates/RelyingPartyDatabase/Scripts/Post-Deployment/Script.PostDeployment.sql b/projecttemplates/RelyingPartyDatabase/Scripts/Post-Deployment/Script.PostDeployment.sql deleted file mode 100644 index 37db4f5..0000000 --- a/projecttemplates/RelyingPartyDatabase/Scripts/Post-Deployment/Script.PostDeployment.sql +++ /dev/null @@ -1,11 +0,0 @@ -/* -Post-Deployment Script Template --------------------------------------------------------------------------------------- - This file contains SQL statements that will be appended to the build script. - Use SQLCMD syntax to include a file in the post-deployment script. - Example: :r .\myfile.sql - Use SQLCMD syntax to reference a variable in the post-deployment script. - Example: :setvar TableName MyTable - SELECT * FROM [$(TableName)] --------------------------------------------------------------------------------------- -*/
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyDatabase/Scripts/Pre-Deployment/Script.PreDeployment.sql b/projecttemplates/RelyingPartyDatabase/Scripts/Pre-Deployment/Script.PreDeployment.sql deleted file mode 100644 index 0c9f8d6..0000000 --- a/projecttemplates/RelyingPartyDatabase/Scripts/Pre-Deployment/Script.PreDeployment.sql +++ /dev/null @@ -1,11 +0,0 @@ -/* - Pre-Deployment Script Template --------------------------------------------------------------------------------------- - This file contains SQL statements that will be executed before the build script. - Use SQLCMD syntax to include a file in the pre-deployment script. - Example: :r .\myfile.sql - Use SQLCMD syntax to reference a variable in the pre-deployment script. - Example: :setvar TableName MyTable - SELECT * FROM [$(TableName)] --------------------------------------------------------------------------------------- -*/
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyLogic/.gitignore b/projecttemplates/RelyingPartyLogic/.gitignore deleted file mode 100644 index 673a3d9..0000000 --- a/projecttemplates/RelyingPartyLogic/.gitignore +++ /dev/null @@ -1 +0,0 @@ -CreateDatabase.sql diff --git a/projecttemplates/RelyingPartyLogic/DataRoleProvider.cs b/projecttemplates/RelyingPartyLogic/DataRoleProvider.cs deleted file mode 100644 index cefc270..0000000 --- a/projecttemplates/RelyingPartyLogic/DataRoleProvider.cs +++ /dev/null @@ -1,123 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="DataRoleProvider.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - using System.Web.Security; - - public class DataRoleProvider : RoleProvider { - public override string ApplicationName { - get { throw new NotImplementedException(); } - set { throw new NotImplementedException(); } - } - - public override void AddUsersToRoles(string[] usernames, string[] roleNames) { - var users = from token in Database.DataContext.AuthenticationTokens - where usernames.Contains(token.ClaimedIdentifier) - select token.User; - var roles = from role in Database.DataContext.Roles - where roleNames.Contains(role.Name, StringComparer.OrdinalIgnoreCase) - select role; - foreach (User user in users) { - foreach (Role role in roles) { - user.Roles.Add(role); - } - } - } - - public override void RemoveUsersFromRoles(string[] usernames, string[] roleNames) { - var users = from token in Database.DataContext.AuthenticationTokens - where usernames.Contains(token.ClaimedIdentifier) - select token.User; - var roles = from role in Database.DataContext.Roles - where roleNames.Contains(role.Name, StringComparer.OrdinalIgnoreCase) - select role; - foreach (User user in users) { - foreach (Role role in roles) { - user.Roles.Remove(role); - } - } - } - - public override void CreateRole(string roleName) { - Database.DataContext.AddToRoles(new Role { Name = roleName }); - } - - /// <summary> - /// Removes a role from the data source for the configured applicationName. - /// </summary> - /// <param name="roleName">The name of the role to delete.</param> - /// <param name="throwOnPopulatedRole">If true, throw an exception if <paramref name="roleName"/> has one or more members and do not delete <paramref name="roleName"/>.</param> - /// <returns> - /// true if the role was successfully deleted; otherwise, false. - /// </returns> - public override bool DeleteRole(string roleName, bool throwOnPopulatedRole) { - Role role = Database.DataContext.Roles.SingleOrDefault(r => r.Name == roleName); - if (role == null) { - return false; - } - - if (throwOnPopulatedRole && role.Users.Count > 0) { - throw new InvalidOperationException(); - } - - Database.DataContext.DeleteObject(roleName); - return true; - } - - /// <summary> - /// Gets an array of user names in a role where the user name contains the specified user name to match. - /// </summary> - /// <param name="roleName">The role to search in.</param> - /// <param name="usernameToMatch">The user name to search for.</param> - /// <returns> - /// A string array containing the names of all the users where the user name matches <paramref name="usernameToMatch"/> and the user is a member of the specified role. - /// </returns> - public override string[] FindUsersInRole(string roleName, string usernameToMatch) { - return (from role in Database.DataContext.Roles - where role.Name == roleName - from user in role.Users - from authTokens in user.AuthenticationTokens - where authTokens.ClaimedIdentifier == usernameToMatch - select authTokens.ClaimedIdentifier).ToArray(); - } - - public override string[] GetAllRoles() { - return Database.DataContext.Roles.Select(role => role.Name).ToArray(); - } - - public override string[] GetRolesForUser(string username) { - return (from authToken in Database.DataContext.AuthenticationTokens - where authToken.ClaimedIdentifier == username - from role in authToken.User.Roles - select role.Name).ToArray(); - } - - public override string[] GetUsersInRole(string roleName) { - return (from role in Database.DataContext.Roles - where string.Equals(role.Name, roleName, StringComparison.OrdinalIgnoreCase) - from user in role.Users - from token in user.AuthenticationTokens - select token.ClaimedIdentifier).ToArray(); - } - - public override bool IsUserInRole(string username, string roleName) { - Role role = Database.DataContext.Roles.SingleOrDefault(r => string.Equals(r.Name, roleName, StringComparison.OrdinalIgnoreCase)); - if (role != null) { - return role.Users.Any(user => user.AuthenticationTokens.Any(token => token.ClaimedIdentifier == username)); - } - - return false; - } - - public override bool RoleExists(string roleName) { - return Database.DataContext.Roles.Any(role => string.Equals(role.Name, roleName, StringComparison.OrdinalIgnoreCase)); - } - } -} diff --git a/projecttemplates/RelyingPartyLogic/Database.cs b/projecttemplates/RelyingPartyLogic/Database.cs deleted file mode 100644 index 58f372f..0000000 --- a/projecttemplates/RelyingPartyLogic/Database.cs +++ /dev/null @@ -1,145 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="Database.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.Data; - using System.Data.EntityClient; - using System.Data.SqlClient; - using System.Linq; - using System.ServiceModel; - using System.Text; - using System.Web; - - public class Database : IHttpModule, IDisposable { - private const string DataContextKey = "DataContext"; - - private const string DataContextTransactionKey = "DataContextTransaction"; - - /// <summary> - /// Initializes a new instance of the <see cref="Database"/> class. - /// </summary> - public Database() { - } - - public static User LoggedInUser { - get { return DataContext.AuthenticationTokens.Where(token => token.ClaimedIdentifier == HttpContext.Current.User.Identity.Name).Select(token => token.User).FirstOrDefault(); } - } - - /// <summary> - /// Gets the transaction-protected database connection for the current request. - /// </summary> - public static DatabaseEntities DataContext { - get { - DatabaseEntities dataContext = DataContextSimple; - if (dataContext == null) { - dataContext = new DatabaseEntities(); - dataContext.Connection.Open(); - DataContextTransaction = (EntityTransaction)dataContext.Connection.BeginTransaction(); - DataContextSimple = dataContext; - } - - return dataContext; - } - } - - /// <summary> - /// Gets a value indicating whether the data context is already initialized. - /// </summary> - internal static bool IsDataContextInitialized { - get { return DataContextSimple != null; } - } - - internal static EntityTransaction DataContextTransaction { - get { - if (HttpContext.Current != null) { - return HttpContext.Current.Items[DataContextTransactionKey] as EntityTransaction; - } else if (OperationContext.Current != null) { - object data; - if (OperationContext.Current.IncomingMessageProperties.TryGetValue(DataContextTransactionKey, out data)) { - return data as EntityTransaction; - } else { - return null; - } - } else { - throw new InvalidOperationException(); - } - } - - private set { - if (HttpContext.Current != null) { - HttpContext.Current.Items[DataContextTransactionKey] = value; - } else if (OperationContext.Current != null) { - OperationContext.Current.IncomingMessageProperties[DataContextTransactionKey] = value; - } else { - throw new InvalidOperationException(); - } - } - } - - private static DatabaseEntities DataContextSimple { - get { - if (HttpContext.Current != null) { - return HttpContext.Current.Items[DataContextKey] as DatabaseEntities; - } else if (OperationContext.Current != null) { - object data; - if (OperationContext.Current.IncomingMessageProperties.TryGetValue(DataContextKey, out data)) { - return data as DatabaseEntities; - } else { - return null; - } - } else { - throw new InvalidOperationException(); - } - } - - set { - if (HttpContext.Current != null) { - HttpContext.Current.Items[DataContextKey] = value; - } else if (OperationContext.Current != null) { - OperationContext.Current.IncomingMessageProperties[DataContextKey] = value; - } else { - throw new InvalidOperationException(); - } - } - } - - public void Dispose() { - } - - void IHttpModule.Init(HttpApplication context) { - context.EndRequest += this.Application_EndRequest; - context.Error += this.Application_Error; - } - - protected void Application_EndRequest(object sender, EventArgs e) { - CommitAndCloseDatabaseIfNecessary(); - } - - protected void Application_Error(object sender, EventArgs e) { - if (DataContextTransaction != null) { - DataContextTransaction.Rollback(); - DataContextTransaction.Dispose(); - DataContextTransaction = null; - } - } - - private static void CommitAndCloseDatabaseIfNecessary() { - var dataContext = DataContextSimple; - if (dataContext != null) { - dataContext.SaveChanges(); - if (DataContextTransaction != null) { - DataContextTransaction.Commit(); - DataContextTransaction.Dispose(); - } - - dataContext.Dispose(); - DataContextSimple = null; - } - } - } -} diff --git a/projecttemplates/RelyingPartyLogic/Model.AuthenticationToken.cs b/projecttemplates/RelyingPartyLogic/Model.AuthenticationToken.cs deleted file mode 100644 index d6564da..0000000 --- a/projecttemplates/RelyingPartyLogic/Model.AuthenticationToken.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - - public partial class AuthenticationToken { - /// <summary> - /// Initializes a new instance of the <see cref="AuthenticationToken"/> class. - /// </summary> - public AuthenticationToken() { - this.CreatedOnUtc = DateTime.UtcNow; - this.LastUsedUtc = DateTime.UtcNow; - this.UsageCount = 1; - } - - public bool IsInfoCard { - get { return this.ClaimedIdentifier.StartsWith(UriPrefixForInfoCard); } - } - - private static string UriPrefixForInfoCard { - get { return new Uri(Utilities.ApplicationRoot, "infocard/").AbsoluteUri; } - } - - public static string SynthesizeClaimedIdentifierFromInfoCard(string uniqueId) { - string synthesizedClaimedId = UriPrefixForInfoCard + Uri.EscapeDataString(uniqueId); - return synthesizedClaimedId; - } - - partial void OnLastUsedUtcChanging(DateTime value) { - Utilities.VerifyThrowNotLocalTime(value); - } - - partial void OnCreatedOnUtcChanging(DateTime value) { - Utilities.VerifyThrowNotLocalTime(value); - } - } -} diff --git a/projecttemplates/RelyingPartyLogic/Model.Client.cs b/projecttemplates/RelyingPartyLogic/Model.Client.cs deleted file mode 100644 index 2b06958..0000000 --- a/projecttemplates/RelyingPartyLogic/Model.Client.cs +++ /dev/null @@ -1,68 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="Model.Client.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using DotNetOpenAuth.Messaging; - using DotNetOpenAuth.OAuth2; - - public partial class Client : IClientDescription { - #region IConsumerDescription Members - - /// <summary> - /// Gets the callback to use when an individual authorization request - /// does not include an explicit callback URI. - /// </summary> - /// <value> - /// An absolute URL; or <c>null</c> if none is registered. - /// </value> - Uri IClientDescription.DefaultCallback { - get { return string.IsNullOrEmpty(this.CallbackAsString) ? null : new Uri(this.CallbackAsString); } - } - - /// <summary> - /// Gets the type of the client. - /// </summary> - ClientType IClientDescription.ClientType { - get { return (ClientType)this.ClientType; } - } - - /// <summary> - /// Gets a value indicating whether a non-empty secret is registered for this client. - /// </summary> - bool IClientDescription.HasNonEmptySecret { - get { return !string.IsNullOrEmpty(this.ClientSecret); } - } - - /// <summary> - /// Checks whether the specified client secret is correct. - /// </summary> - /// <param name="secret">The secret obtained from the client.</param> - /// <returns><c>true</c> if the secret matches the one in the authorization server's record for the client; <c>false</c> otherwise.</returns> - /// <remarks> - /// All string equality checks, whether checking secrets or their hashes, - /// should be done using <see cref="MessagingUtilities.EqualsConstantTime"/> to mitigate timing attacks. - /// </remarks> - bool IClientDescription.IsValidClientSecret(string secret) { - return MessagingUtilities.EqualsConstantTime(secret, this.ClientSecret); - } - - /// <summary> - /// Determines whether a callback URI included in a client's authorization request - /// is among those allowed callbacks for the registered client. - /// </summary> - /// <param name="callback">The absolute URI the client has requested the authorization result be received at.</param> - /// <returns> - /// <c>true</c> if the callback URL is allowable for this client; otherwise, <c>false</c>. - /// </returns> - bool IClientDescription.IsCallbackAllowed(Uri callback) { - return string.IsNullOrEmpty(this.CallbackAsString) || callback == new Uri(this.CallbackAsString); - } - - #endregion - } -} diff --git a/projecttemplates/RelyingPartyLogic/Model.ClientAuthorization.cs b/projecttemplates/RelyingPartyLogic/Model.ClientAuthorization.cs deleted file mode 100644 index 4b1b8b1..0000000 --- a/projecttemplates/RelyingPartyLogic/Model.ClientAuthorization.cs +++ /dev/null @@ -1,26 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="Model.ClientAuthorization.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - using DotNetOpenAuth.OAuth.ChannelElements; - - public partial class ClientAuthorization { - /// <summary> - /// Initializes a new instance of the <see cref="ClientAuthorization"/> class. - /// </summary> - public ClientAuthorization() { - this.CreatedOnUtc = DateTime.UtcNow; - } - - partial void OnCreatedOnUtcChanging(DateTime value) { - Utilities.VerifyThrowNotLocalTime(value); - } - } -} diff --git a/projecttemplates/RelyingPartyLogic/Model.Designer.cs b/projecttemplates/RelyingPartyLogic/Model.Designer.cs deleted file mode 100644 index df854b4..0000000 --- a/projecttemplates/RelyingPartyLogic/Model.Designer.cs +++ /dev/null @@ -1,1598 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -using System; -using System.ComponentModel; -using System.Data.EntityClient; -using System.Data.Objects; -using System.Data.Objects.DataClasses; -using System.Linq; -using System.Runtime.Serialization; -using System.Xml.Serialization; - -[assembly: EdmSchemaAttribute()] -#region EDM Relationship Metadata - -[assembly: EdmRelationshipAttribute("DatabaseModel", "UserRole", "Role", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(RelyingPartyLogic.Role), "User", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(RelyingPartyLogic.User))] -[assembly: EdmRelationshipAttribute("DatabaseModel", "FK_AuthenticationToken_User", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(RelyingPartyLogic.User), "AuthenticationToken", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(RelyingPartyLogic.AuthenticationToken))] -[assembly: EdmRelationshipAttribute("DatabaseModel", "FK_IssuedToken_Consumer", "Client", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(RelyingPartyLogic.Client), "ClientAuthorization", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(RelyingPartyLogic.ClientAuthorization))] -[assembly: EdmRelationshipAttribute("DatabaseModel", "FK_IssuedToken_User", "User", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(RelyingPartyLogic.User), "ClientAuthorization", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(RelyingPartyLogic.ClientAuthorization))] - -#endregion - -namespace RelyingPartyLogic -{ - #region Contexts - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - public partial class DatabaseEntities : ObjectContext - { - #region Constructors - - /// <summary> - /// Initializes a new DatabaseEntities object using the connection string found in the 'DatabaseEntities' section of the application configuration file. - /// </summary> - public DatabaseEntities() : base("name=DatabaseEntities", "DatabaseEntities") - { - OnContextCreated(); - } - - /// <summary> - /// Initialize a new DatabaseEntities object. - /// </summary> - public DatabaseEntities(string connectionString) : base(connectionString, "DatabaseEntities") - { - OnContextCreated(); - } - - /// <summary> - /// Initialize a new DatabaseEntities object. - /// </summary> - public DatabaseEntities(EntityConnection connection) : base(connection, "DatabaseEntities") - { - OnContextCreated(); - } - - #endregion - - #region Partial Methods - - partial void OnContextCreated(); - - #endregion - - #region ObjectSet Properties - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - public ObjectSet<Role> Roles - { - get - { - if ((_Roles == null)) - { - _Roles = base.CreateObjectSet<Role>("Roles"); - } - return _Roles; - } - } - private ObjectSet<Role> _Roles; - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - public ObjectSet<User> Users - { - get - { - if ((_Users == null)) - { - _Users = base.CreateObjectSet<User>("Users"); - } - return _Users; - } - } - private ObjectSet<User> _Users; - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - public ObjectSet<AuthenticationToken> AuthenticationTokens - { - get - { - if ((_AuthenticationTokens == null)) - { - _AuthenticationTokens = base.CreateObjectSet<AuthenticationToken>("AuthenticationTokens"); - } - return _AuthenticationTokens; - } - } - private ObjectSet<AuthenticationToken> _AuthenticationTokens; - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - public ObjectSet<Nonce> Nonces - { - get - { - if ((_Nonces == null)) - { - _Nonces = base.CreateObjectSet<Nonce>("Nonces"); - } - return _Nonces; - } - } - private ObjectSet<Nonce> _Nonces; - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - public ObjectSet<Client> Clients - { - get - { - if ((_Clients == null)) - { - _Clients = base.CreateObjectSet<Client>("Clients"); - } - return _Clients; - } - } - private ObjectSet<Client> _Clients; - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - public ObjectSet<ClientAuthorization> ClientAuthorizations - { - get - { - if ((_ClientAuthorizations == null)) - { - _ClientAuthorizations = base.CreateObjectSet<ClientAuthorization>("ClientAuthorizations"); - } - return _ClientAuthorizations; - } - } - private ObjectSet<ClientAuthorization> _ClientAuthorizations; - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - public ObjectSet<SymmetricCryptoKey> SymmetricCryptoKeys - { - get - { - if ((_SymmetricCryptoKeys == null)) - { - _SymmetricCryptoKeys = base.CreateObjectSet<SymmetricCryptoKey>("SymmetricCryptoKeys"); - } - return _SymmetricCryptoKeys; - } - } - private ObjectSet<SymmetricCryptoKey> _SymmetricCryptoKeys; - - #endregion - - #region AddTo Methods - - /// <summary> - /// Deprecated Method for adding a new object to the Roles EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. - /// </summary> - public void AddToRoles(Role role) - { - base.AddObject("Roles", role); - } - - /// <summary> - /// Deprecated Method for adding a new object to the Users EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. - /// </summary> - public void AddToUsers(User user) - { - base.AddObject("Users", user); - } - - /// <summary> - /// Deprecated Method for adding a new object to the AuthenticationTokens EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. - /// </summary> - public void AddToAuthenticationTokens(AuthenticationToken authenticationToken) - { - base.AddObject("AuthenticationTokens", authenticationToken); - } - - /// <summary> - /// Deprecated Method for adding a new object to the Nonces EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. - /// </summary> - public void AddToNonces(Nonce nonce) - { - base.AddObject("Nonces", nonce); - } - - /// <summary> - /// Deprecated Method for adding a new object to the Clients EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. - /// </summary> - public void AddToClients(Client client) - { - base.AddObject("Clients", client); - } - - /// <summary> - /// Deprecated Method for adding a new object to the ClientAuthorizations EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. - /// </summary> - public void AddToClientAuthorizations(ClientAuthorization clientAuthorization) - { - base.AddObject("ClientAuthorizations", clientAuthorization); - } - - /// <summary> - /// Deprecated Method for adding a new object to the SymmetricCryptoKeys EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. - /// </summary> - public void AddToSymmetricCryptoKeys(SymmetricCryptoKey symmetricCryptoKey) - { - base.AddObject("SymmetricCryptoKeys", symmetricCryptoKey); - } - - #endregion - - #region Function Imports - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - public int ClearExpiredNonces() - { - return base.ExecuteFunction("ClearExpiredNonces"); - } - - #endregion - - } - - #endregion - - #region Entities - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmEntityTypeAttribute(NamespaceName="DatabaseModel", Name="AuthenticationToken")] - [Serializable()] - [DataContractAttribute(IsReference=true)] - public partial class AuthenticationToken : EntityObject - { - #region Factory Method - - /// <summary> - /// Create a new AuthenticationToken object. - /// </summary> - /// <param name="claimedIdentifier">Initial value of the ClaimedIdentifier property.</param> - /// <param name="createdOnUtc">Initial value of the CreatedOnUtc property.</param> - /// <param name="lastUsedUtc">Initial value of the LastUsedUtc property.</param> - /// <param name="usageCount">Initial value of the UsageCount property.</param> - /// <param name="authenticationTokenId">Initial value of the AuthenticationTokenId property.</param> - public static AuthenticationToken CreateAuthenticationToken(global::System.String claimedIdentifier, global::System.DateTime createdOnUtc, global::System.DateTime lastUsedUtc, global::System.Int32 usageCount, global::System.Int32 authenticationTokenId) - { - AuthenticationToken authenticationToken = new AuthenticationToken(); - authenticationToken.ClaimedIdentifier = claimedIdentifier; - authenticationToken.CreatedOnUtc = createdOnUtc; - authenticationToken.LastUsedUtc = lastUsedUtc; - authenticationToken.UsageCount = usageCount; - authenticationToken.AuthenticationTokenId = authenticationTokenId; - return authenticationToken; - } - - #endregion - - #region Primitive Properties - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.String ClaimedIdentifier - { - get - { - return _ClaimedIdentifier; - } - set - { - OnClaimedIdentifierChanging(value); - ReportPropertyChanging("ClaimedIdentifier"); - _ClaimedIdentifier = StructuralObject.SetValidValue(value, false); - ReportPropertyChanged("ClaimedIdentifier"); - OnClaimedIdentifierChanged(); - } - } - private global::System.String _ClaimedIdentifier; - partial void OnClaimedIdentifierChanging(global::System.String value); - partial void OnClaimedIdentifierChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] - [DataMemberAttribute()] - public global::System.String FriendlyIdentifier - { - get - { - return _FriendlyIdentifier; - } - set - { - OnFriendlyIdentifierChanging(value); - ReportPropertyChanging("FriendlyIdentifier"); - _FriendlyIdentifier = StructuralObject.SetValidValue(value, true); - ReportPropertyChanged("FriendlyIdentifier"); - OnFriendlyIdentifierChanged(); - } - } - private global::System.String _FriendlyIdentifier; - partial void OnFriendlyIdentifierChanging(global::System.String value); - partial void OnFriendlyIdentifierChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.DateTime CreatedOnUtc - { - get - { - return _CreatedOnUtc; - } - private set - { - OnCreatedOnUtcChanging(value); - ReportPropertyChanging("CreatedOnUtc"); - _CreatedOnUtc = StructuralObject.SetValidValue(value); - ReportPropertyChanged("CreatedOnUtc"); - OnCreatedOnUtcChanged(); - } - } - private global::System.DateTime _CreatedOnUtc; - partial void OnCreatedOnUtcChanging(global::System.DateTime value); - partial void OnCreatedOnUtcChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.DateTime LastUsedUtc - { - get - { - return _LastUsedUtc; - } - set - { - OnLastUsedUtcChanging(value); - ReportPropertyChanging("LastUsedUtc"); - _LastUsedUtc = StructuralObject.SetValidValue(value); - ReportPropertyChanged("LastUsedUtc"); - OnLastUsedUtcChanged(); - } - } - private global::System.DateTime _LastUsedUtc; - partial void OnLastUsedUtcChanging(global::System.DateTime value); - partial void OnLastUsedUtcChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.Int32 UsageCount - { - get - { - return _UsageCount; - } - set - { - OnUsageCountChanging(value); - ReportPropertyChanging("UsageCount"); - _UsageCount = StructuralObject.SetValidValue(value); - ReportPropertyChanged("UsageCount"); - OnUsageCountChanged(); - } - } - private global::System.Int32 _UsageCount; - partial void OnUsageCountChanging(global::System.Int32 value); - partial void OnUsageCountChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)] - [DataMemberAttribute()] - public global::System.Int32 AuthenticationTokenId - { - get - { - return _AuthenticationTokenId; - } - private set - { - if (_AuthenticationTokenId != value) - { - OnAuthenticationTokenIdChanging(value); - ReportPropertyChanging("AuthenticationTokenId"); - _AuthenticationTokenId = StructuralObject.SetValidValue(value); - ReportPropertyChanged("AuthenticationTokenId"); - OnAuthenticationTokenIdChanged(); - } - } - } - private global::System.Int32 _AuthenticationTokenId; - partial void OnAuthenticationTokenIdChanging(global::System.Int32 value); - partial void OnAuthenticationTokenIdChanged(); - - #endregion - - - #region Navigation Properties - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - [EdmRelationshipNavigationPropertyAttribute("DatabaseModel", "FK_AuthenticationToken_User", "User")] - public User User - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<User>("DatabaseModel.FK_AuthenticationToken_User", "User").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<User>("DatabaseModel.FK_AuthenticationToken_User", "User").Value = value; - } - } - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference<User> UserReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<User>("DatabaseModel.FK_AuthenticationToken_User", "User"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<User>("DatabaseModel.FK_AuthenticationToken_User", "User", value); - } - } - } - - #endregion - - } - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmEntityTypeAttribute(NamespaceName="DatabaseModel", Name="Client")] - [Serializable()] - [DataContractAttribute(IsReference=true)] - public partial class Client : EntityObject - { - #region Factory Method - - /// <summary> - /// Create a new Client object. - /// </summary> - /// <param name="clientId">Initial value of the ClientId property.</param> - /// <param name="clientIdentifier">Initial value of the ClientIdentifier property.</param> - /// <param name="name">Initial value of the Name property.</param> - /// <param name="clientType">Initial value of the ClientType property.</param> - public static Client CreateClient(global::System.Int32 clientId, global::System.String clientIdentifier, global::System.String name, global::System.Int32 clientType) - { - Client client = new Client(); - client.ClientId = clientId; - client.ClientIdentifier = clientIdentifier; - client.Name = name; - client.ClientType = clientType; - return client; - } - - #endregion - - #region Primitive Properties - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)] - [DataMemberAttribute()] - public global::System.Int32 ClientId - { - get - { - return _ClientId; - } - set - { - if (_ClientId != value) - { - OnClientIdChanging(value); - ReportPropertyChanging("ClientId"); - _ClientId = StructuralObject.SetValidValue(value); - ReportPropertyChanged("ClientId"); - OnClientIdChanged(); - } - } - } - private global::System.Int32 _ClientId; - partial void OnClientIdChanging(global::System.Int32 value); - partial void OnClientIdChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.String ClientIdentifier - { - get - { - return _ClientIdentifier; - } - set - { - OnClientIdentifierChanging(value); - ReportPropertyChanging("ClientIdentifier"); - _ClientIdentifier = StructuralObject.SetValidValue(value, false); - ReportPropertyChanged("ClientIdentifier"); - OnClientIdentifierChanged(); - } - } - private global::System.String _ClientIdentifier; - partial void OnClientIdentifierChanging(global::System.String value); - partial void OnClientIdentifierChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] - [DataMemberAttribute()] - public global::System.String ClientSecret - { - get - { - return _ClientSecret; - } - set - { - OnClientSecretChanging(value); - ReportPropertyChanging("ClientSecret"); - _ClientSecret = StructuralObject.SetValidValue(value, true); - ReportPropertyChanged("ClientSecret"); - OnClientSecretChanged(); - } - } - private global::System.String _ClientSecret; - partial void OnClientSecretChanging(global::System.String value); - partial void OnClientSecretChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] - [DataMemberAttribute()] - public global::System.String CallbackAsString - { - get - { - return _CallbackAsString; - } - set - { - OnCallbackAsStringChanging(value); - ReportPropertyChanging("CallbackAsString"); - _CallbackAsString = StructuralObject.SetValidValue(value, true); - ReportPropertyChanged("CallbackAsString"); - OnCallbackAsStringChanged(); - } - } - private global::System.String _CallbackAsString; - partial void OnCallbackAsStringChanging(global::System.String value); - partial void OnCallbackAsStringChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - ReportPropertyChanging("Name"); - _Name = StructuralObject.SetValidValue(value, false); - ReportPropertyChanged("Name"); - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.Int32 ClientType - { - get - { - return _ClientType; - } - set - { - OnClientTypeChanging(value); - ReportPropertyChanging("ClientType"); - _ClientType = StructuralObject.SetValidValue(value); - ReportPropertyChanged("ClientType"); - OnClientTypeChanged(); - } - } - private global::System.Int32 _ClientType; - partial void OnClientTypeChanging(global::System.Int32 value); - partial void OnClientTypeChanged(); - - #endregion - - - #region Navigation Properties - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - [EdmRelationshipNavigationPropertyAttribute("DatabaseModel", "FK_IssuedToken_Consumer", "ClientAuthorization")] - public EntityCollection<ClientAuthorization> ClientAuthorizations - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ClientAuthorization>("DatabaseModel.FK_IssuedToken_Consumer", "ClientAuthorization"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ClientAuthorization>("DatabaseModel.FK_IssuedToken_Consumer", "ClientAuthorization", value); - } - } - } - - #endregion - - } - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmEntityTypeAttribute(NamespaceName="DatabaseModel", Name="ClientAuthorization")] - [Serializable()] - [DataContractAttribute(IsReference=true)] - public partial class ClientAuthorization : EntityObject - { - #region Factory Method - - /// <summary> - /// Create a new ClientAuthorization object. - /// </summary> - /// <param name="authorizationId">Initial value of the AuthorizationId property.</param> - /// <param name="createdOnUtc">Initial value of the CreatedOnUtc property.</param> - public static ClientAuthorization CreateClientAuthorization(global::System.Int32 authorizationId, global::System.DateTime createdOnUtc) - { - ClientAuthorization clientAuthorization = new ClientAuthorization(); - clientAuthorization.AuthorizationId = authorizationId; - clientAuthorization.CreatedOnUtc = createdOnUtc; - return clientAuthorization; - } - - #endregion - - #region Primitive Properties - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)] - [DataMemberAttribute()] - public global::System.Int32 AuthorizationId - { - get - { - return _AuthorizationId; - } - set - { - if (_AuthorizationId != value) - { - OnAuthorizationIdChanging(value); - ReportPropertyChanging("AuthorizationId"); - _AuthorizationId = StructuralObject.SetValidValue(value); - ReportPropertyChanged("AuthorizationId"); - OnAuthorizationIdChanged(); - } - } - } - private global::System.Int32 _AuthorizationId; - partial void OnAuthorizationIdChanging(global::System.Int32 value); - partial void OnAuthorizationIdChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.DateTime CreatedOnUtc - { - get - { - return _CreatedOnUtc; - } - set - { - OnCreatedOnUtcChanging(value); - ReportPropertyChanging("CreatedOnUtc"); - _CreatedOnUtc = StructuralObject.SetValidValue(value); - ReportPropertyChanged("CreatedOnUtc"); - OnCreatedOnUtcChanged(); - } - } - private global::System.DateTime _CreatedOnUtc; - partial void OnCreatedOnUtcChanging(global::System.DateTime value); - partial void OnCreatedOnUtcChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] - [DataMemberAttribute()] - public Nullable<global::System.DateTime> ExpirationDateUtc - { - get - { - return _ExpirationDateUtc; - } - set - { - OnExpirationDateUtcChanging(value); - ReportPropertyChanging("ExpirationDateUtc"); - _ExpirationDateUtc = StructuralObject.SetValidValue(value); - ReportPropertyChanged("ExpirationDateUtc"); - OnExpirationDateUtcChanged(); - } - } - private Nullable<global::System.DateTime> _ExpirationDateUtc; - partial void OnExpirationDateUtcChanging(Nullable<global::System.DateTime> value); - partial void OnExpirationDateUtcChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] - [DataMemberAttribute()] - public global::System.String Scope - { - get - { - return _Scope; - } - set - { - OnScopeChanging(value); - ReportPropertyChanging("Scope"); - _Scope = StructuralObject.SetValidValue(value, true); - ReportPropertyChanged("Scope"); - OnScopeChanged(); - } - } - private global::System.String _Scope; - partial void OnScopeChanging(global::System.String value); - partial void OnScopeChanged(); - - #endregion - - - #region Navigation Properties - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - [EdmRelationshipNavigationPropertyAttribute("DatabaseModel", "FK_IssuedToken_Consumer", "Client")] - public Client Client - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Client>("DatabaseModel.FK_IssuedToken_Consumer", "Client").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Client>("DatabaseModel.FK_IssuedToken_Consumer", "Client").Value = value; - } - } - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference<Client> ClientReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Client>("DatabaseModel.FK_IssuedToken_Consumer", "Client"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Client>("DatabaseModel.FK_IssuedToken_Consumer", "Client", value); - } - } - } - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - [EdmRelationshipNavigationPropertyAttribute("DatabaseModel", "FK_IssuedToken_User", "User")] - public User User - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<User>("DatabaseModel.FK_IssuedToken_User", "User").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<User>("DatabaseModel.FK_IssuedToken_User", "User").Value = value; - } - } - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference<User> UserReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<User>("DatabaseModel.FK_IssuedToken_User", "User"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<User>("DatabaseModel.FK_IssuedToken_User", "User", value); - } - } - } - - #endregion - - } - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmEntityTypeAttribute(NamespaceName="DatabaseModel", Name="Nonce")] - [Serializable()] - [DataContractAttribute(IsReference=true)] - public partial class Nonce : EntityObject - { - #region Factory Method - - /// <summary> - /// Create a new Nonce object. - /// </summary> - /// <param name="nonceId">Initial value of the NonceId property.</param> - /// <param name="context">Initial value of the Context property.</param> - /// <param name="code">Initial value of the Code property.</param> - /// <param name="issuedUtc">Initial value of the IssuedUtc property.</param> - /// <param name="expiresUtc">Initial value of the ExpiresUtc property.</param> - public static Nonce CreateNonce(global::System.Int32 nonceId, global::System.String context, global::System.String code, global::System.DateTime issuedUtc, global::System.DateTime expiresUtc) - { - Nonce nonce = new Nonce(); - nonce.NonceId = nonceId; - nonce.Context = context; - nonce.Code = code; - nonce.IssuedUtc = issuedUtc; - nonce.ExpiresUtc = expiresUtc; - return nonce; - } - - #endregion - - #region Primitive Properties - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)] - [DataMemberAttribute()] - public global::System.Int32 NonceId - { - get - { - return _NonceId; - } - set - { - if (_NonceId != value) - { - OnNonceIdChanging(value); - ReportPropertyChanging("NonceId"); - _NonceId = StructuralObject.SetValidValue(value); - ReportPropertyChanged("NonceId"); - OnNonceIdChanged(); - } - } - } - private global::System.Int32 _NonceId; - partial void OnNonceIdChanging(global::System.Int32 value); - partial void OnNonceIdChanged(); - - /// <summary> - /// Gets or sets the Provider Endpoint URL the nonce came from. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.String Context - { - get - { - return _Context; - } - set - { - OnContextChanging(value); - ReportPropertyChanging("Context"); - _Context = StructuralObject.SetValidValue(value, false); - ReportPropertyChanged("Context"); - OnContextChanged(); - } - } - private global::System.String _Context; - partial void OnContextChanging(global::System.String value); - partial void OnContextChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.String Code - { - get - { - return _Code; - } - set - { - OnCodeChanging(value); - ReportPropertyChanging("Code"); - _Code = StructuralObject.SetValidValue(value, false); - ReportPropertyChanged("Code"); - OnCodeChanged(); - } - } - private global::System.String _Code; - partial void OnCodeChanging(global::System.String value); - partial void OnCodeChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.DateTime IssuedUtc - { - get - { - return _IssuedUtc; - } - set - { - OnIssuedUtcChanging(value); - ReportPropertyChanging("IssuedUtc"); - _IssuedUtc = StructuralObject.SetValidValue(value); - ReportPropertyChanged("IssuedUtc"); - OnIssuedUtcChanged(); - } - } - private global::System.DateTime _IssuedUtc; - partial void OnIssuedUtcChanging(global::System.DateTime value); - partial void OnIssuedUtcChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.DateTime ExpiresUtc - { - get - { - return _ExpiresUtc; - } - set - { - OnExpiresUtcChanging(value); - ReportPropertyChanging("ExpiresUtc"); - _ExpiresUtc = StructuralObject.SetValidValue(value); - ReportPropertyChanged("ExpiresUtc"); - OnExpiresUtcChanged(); - } - } - private global::System.DateTime _ExpiresUtc; - partial void OnExpiresUtcChanging(global::System.DateTime value); - partial void OnExpiresUtcChanged(); - - #endregion - - - } - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmEntityTypeAttribute(NamespaceName="DatabaseModel", Name="Role")] - [Serializable()] - [DataContractAttribute(IsReference=true)] - public partial class Role : EntityObject - { - #region Factory Method - - /// <summary> - /// Create a new Role object. - /// </summary> - /// <param name="name">Initial value of the Name property.</param> - /// <param name="roleId">Initial value of the RoleId property.</param> - public static Role CreateRole(global::System.String name, global::System.Int32 roleId) - { - Role role = new Role(); - role.Name = name; - role.RoleId = roleId; - return role; - } - - #endregion - - #region Primitive Properties - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - ReportPropertyChanging("Name"); - _Name = StructuralObject.SetValidValue(value, false); - ReportPropertyChanged("Name"); - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)] - [DataMemberAttribute()] - public global::System.Int32 RoleId - { - get - { - return _RoleId; - } - private set - { - if (_RoleId != value) - { - OnRoleIdChanging(value); - ReportPropertyChanging("RoleId"); - _RoleId = StructuralObject.SetValidValue(value); - ReportPropertyChanged("RoleId"); - OnRoleIdChanged(); - } - } - } - private global::System.Int32 _RoleId; - partial void OnRoleIdChanging(global::System.Int32 value); - partial void OnRoleIdChanged(); - - #endregion - - - #region Navigation Properties - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - [EdmRelationshipNavigationPropertyAttribute("DatabaseModel", "UserRole", "User")] - public EntityCollection<User> Users - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<User>("DatabaseModel.UserRole", "User"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<User>("DatabaseModel.UserRole", "User", value); - } - } - } - - #endregion - - } - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmEntityTypeAttribute(NamespaceName="DatabaseModel", Name="SymmetricCryptoKey")] - [Serializable()] - [DataContractAttribute(IsReference=true)] - public partial class SymmetricCryptoKey : EntityObject - { - #region Factory Method - - /// <summary> - /// Create a new SymmetricCryptoKey object. - /// </summary> - /// <param name="cryptoKeyId">Initial value of the CryptoKeyId property.</param> - /// <param name="bucket">Initial value of the Bucket property.</param> - /// <param name="handle">Initial value of the Handle property.</param> - /// <param name="expirationUtc">Initial value of the ExpirationUtc property.</param> - /// <param name="secret">Initial value of the Secret property.</param> - public static SymmetricCryptoKey CreateSymmetricCryptoKey(global::System.Int32 cryptoKeyId, global::System.String bucket, global::System.String handle, global::System.DateTime expirationUtc, global::System.Byte[] secret) - { - SymmetricCryptoKey symmetricCryptoKey = new SymmetricCryptoKey(); - symmetricCryptoKey.CryptoKeyId = cryptoKeyId; - symmetricCryptoKey.Bucket = bucket; - symmetricCryptoKey.Handle = handle; - symmetricCryptoKey.ExpirationUtc = expirationUtc; - symmetricCryptoKey.Secret = secret; - return symmetricCryptoKey; - } - - #endregion - - #region Primitive Properties - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)] - [DataMemberAttribute()] - public global::System.Int32 CryptoKeyId - { - get - { - return _CryptoKeyId; - } - set - { - if (_CryptoKeyId != value) - { - OnCryptoKeyIdChanging(value); - ReportPropertyChanging("CryptoKeyId"); - _CryptoKeyId = StructuralObject.SetValidValue(value); - ReportPropertyChanged("CryptoKeyId"); - OnCryptoKeyIdChanged(); - } - } - } - private global::System.Int32 _CryptoKeyId; - partial void OnCryptoKeyIdChanging(global::System.Int32 value); - partial void OnCryptoKeyIdChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.String Bucket - { - get - { - return _Bucket; - } - set - { - OnBucketChanging(value); - ReportPropertyChanging("Bucket"); - _Bucket = StructuralObject.SetValidValue(value, false); - ReportPropertyChanged("Bucket"); - OnBucketChanged(); - } - } - private global::System.String _Bucket; - partial void OnBucketChanging(global::System.String value); - partial void OnBucketChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.String Handle - { - get - { - return _Handle; - } - set - { - OnHandleChanging(value); - ReportPropertyChanging("Handle"); - _Handle = StructuralObject.SetValidValue(value, false); - ReportPropertyChanged("Handle"); - OnHandleChanged(); - } - } - private global::System.String _Handle; - partial void OnHandleChanging(global::System.String value); - partial void OnHandleChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.DateTime ExpirationUtc - { - get - { - return _ExpirationUtc; - } - set - { - OnExpirationUtcChanging(value); - ReportPropertyChanging("ExpirationUtc"); - _ExpirationUtc = StructuralObject.SetValidValue(value); - ReportPropertyChanged("ExpirationUtc"); - OnExpirationUtcChanged(); - } - } - private global::System.DateTime _ExpirationUtc; - partial void OnExpirationUtcChanging(global::System.DateTime value); - partial void OnExpirationUtcChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.Byte[] Secret - { - get - { - return StructuralObject.GetValidValue(_Secret); - } - set - { - OnSecretChanging(value); - ReportPropertyChanging("Secret"); - _Secret = StructuralObject.SetValidValue(value, false); - ReportPropertyChanged("Secret"); - OnSecretChanged(); - } - } - private global::System.Byte[] _Secret; - partial void OnSecretChanging(global::System.Byte[] value); - partial void OnSecretChanged(); - - #endregion - - - } - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmEntityTypeAttribute(NamespaceName="DatabaseModel", Name="User")] - [Serializable()] - [DataContractAttribute(IsReference=true)] - public partial class User : EntityObject - { - #region Factory Method - - /// <summary> - /// Create a new User object. - /// </summary> - /// <param name="emailAddressVerified">Initial value of the EmailAddressVerified property.</param> - /// <param name="createdOnUtc">Initial value of the CreatedOnUtc property.</param> - /// <param name="userId">Initial value of the UserId property.</param> - public static User CreateUser(global::System.Boolean emailAddressVerified, global::System.DateTime createdOnUtc, global::System.Int32 userId) - { - User user = new User(); - user.EmailAddressVerified = emailAddressVerified; - user.CreatedOnUtc = createdOnUtc; - user.UserId = userId; - return user; - } - - #endregion - - #region Primitive Properties - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] - [DataMemberAttribute()] - public global::System.String FirstName - { - get - { - return _FirstName; - } - set - { - OnFirstNameChanging(value); - ReportPropertyChanging("FirstName"); - _FirstName = StructuralObject.SetValidValue(value, true); - ReportPropertyChanged("FirstName"); - OnFirstNameChanged(); - } - } - private global::System.String _FirstName; - partial void OnFirstNameChanging(global::System.String value); - partial void OnFirstNameChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] - [DataMemberAttribute()] - public global::System.String LastName - { - get - { - return _LastName; - } - set - { - OnLastNameChanging(value); - ReportPropertyChanging("LastName"); - _LastName = StructuralObject.SetValidValue(value, true); - ReportPropertyChanged("LastName"); - OnLastNameChanged(); - } - } - private global::System.String _LastName; - partial void OnLastNameChanging(global::System.String value); - partial void OnLastNameChanged(); - - /// <summary> - /// The email address claimed to be controlled by the user. Whether it is actually owned by the user is indicated by the EmailAddressVerified property. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] - [DataMemberAttribute()] - public global::System.String EmailAddress - { - get - { - return _EmailAddress; - } - set - { - OnEmailAddressChanging(value); - ReportPropertyChanging("EmailAddress"); - _EmailAddress = StructuralObject.SetValidValue(value, true); - ReportPropertyChanged("EmailAddress"); - OnEmailAddressChanged(); - } - } - private global::System.String _EmailAddress; - partial void OnEmailAddressChanging(global::System.String value); - partial void OnEmailAddressChanged(); - - /// <summary> - /// A value indicating whether the email address has been verified as actually owned by this user. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.Boolean EmailAddressVerified - { - get - { - return _EmailAddressVerified; - } - set - { - OnEmailAddressVerifiedChanging(value); - ReportPropertyChanging("EmailAddressVerified"); - _EmailAddressVerified = StructuralObject.SetValidValue(value); - ReportPropertyChanged("EmailAddressVerified"); - OnEmailAddressVerifiedChanged(); - } - } - private global::System.Boolean _EmailAddressVerified; - partial void OnEmailAddressVerifiedChanging(global::System.Boolean value); - partial void OnEmailAddressVerifiedChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] - [DataMemberAttribute()] - public global::System.DateTime CreatedOnUtc - { - get - { - return _CreatedOnUtc; - } - private set - { - OnCreatedOnUtcChanging(value); - ReportPropertyChanging("CreatedOnUtc"); - _CreatedOnUtc = StructuralObject.SetValidValue(value); - ReportPropertyChanged("CreatedOnUtc"); - OnCreatedOnUtcChanged(); - } - } - private global::System.DateTime _CreatedOnUtc; - partial void OnCreatedOnUtcChanging(global::System.DateTime value); - partial void OnCreatedOnUtcChanged(); - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)] - [DataMemberAttribute()] - public global::System.Int32 UserId - { - get - { - return _UserId; - } - private set - { - if (_UserId != value) - { - OnUserIdChanging(value); - ReportPropertyChanging("UserId"); - _UserId = StructuralObject.SetValidValue(value); - ReportPropertyChanged("UserId"); - OnUserIdChanged(); - } - } - } - private global::System.Int32 _UserId; - partial void OnUserIdChanging(global::System.Int32 value); - partial void OnUserIdChanged(); - - #endregion - - - #region Navigation Properties - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - [EdmRelationshipNavigationPropertyAttribute("DatabaseModel", "UserRole", "Role")] - public EntityCollection<Role> Roles - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Role>("DatabaseModel.UserRole", "Role"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Role>("DatabaseModel.UserRole", "Role", value); - } - } - } - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - [EdmRelationshipNavigationPropertyAttribute("DatabaseModel", "FK_AuthenticationToken_User", "AuthenticationToken")] - public EntityCollection<AuthenticationToken> AuthenticationTokens - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<AuthenticationToken>("DatabaseModel.FK_AuthenticationToken_User", "AuthenticationToken"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<AuthenticationToken>("DatabaseModel.FK_AuthenticationToken_User", "AuthenticationToken", value); - } - } - } - - /// <summary> - /// No Metadata Documentation available. - /// </summary> - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - [EdmRelationshipNavigationPropertyAttribute("DatabaseModel", "FK_IssuedToken_User", "ClientAuthorization")] - public EntityCollection<ClientAuthorization> ClientAuthorizations - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ClientAuthorization>("DatabaseModel.FK_IssuedToken_User", "ClientAuthorization"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ClientAuthorization>("DatabaseModel.FK_IssuedToken_User", "ClientAuthorization", value); - } - } - } - - #endregion - - } - - #endregion - - -} diff --git a/projecttemplates/RelyingPartyLogic/Model.User.cs b/projecttemplates/RelyingPartyLogic/Model.User.cs deleted file mode 100644 index b92fa31..0000000 --- a/projecttemplates/RelyingPartyLogic/Model.User.cs +++ /dev/null @@ -1,98 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="Model.User.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.IdentityModel.Claims; - using System.Linq; - using System.Web; - using DotNetOpenAuth.InfoCard; - using DotNetOpenAuth.OpenId; - using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration; - using DotNetOpenAuth.OpenId.RelyingParty; - - public partial class User { - /// <summary> - /// Initializes a new instance of the <see cref="User"/> class. - /// </summary> - public User() { - this.CreatedOnUtc = DateTime.UtcNow; - } - - public static AuthenticationToken ProcessUserLogin(IAuthenticationResponse openIdResponse) { - bool trustedEmail = Policies.ProviderEndpointsProvidingTrustedEmails.Contains(openIdResponse.Provider.Uri); - return ProcessUserLogin(openIdResponse.ClaimedIdentifier, openIdResponse.FriendlyIdentifierForDisplay, openIdResponse.GetExtension<ClaimsResponse>(), null, trustedEmail); - } - - public static AuthenticationToken ProcessUserLogin(Token samlToken) { - bool trustedEmail = false; // we don't trust InfoCard email addresses, since these can be self-issued. - return ProcessUserLogin( - AuthenticationToken.SynthesizeClaimedIdentifierFromInfoCard(samlToken.UniqueId), - samlToken.SiteSpecificId, - null, - samlToken, - trustedEmail); - } - - private static AuthenticationToken ProcessUserLogin(string claimedIdentifier, string friendlyIdentifier, ClaimsResponse claims, Token samlToken, bool trustedEmail) { - // Create an account for this user if we don't already have one. - AuthenticationToken openidToken = Database.DataContext.AuthenticationTokens.FirstOrDefault(token => token.ClaimedIdentifier == claimedIdentifier); - if (openidToken == null) { - // this is a user we haven't seen before. - User user = new User(); - openidToken = new AuthenticationToken { - ClaimedIdentifier = claimedIdentifier, - FriendlyIdentifier = friendlyIdentifier, - }; - user.AuthenticationTokens.Add(openidToken); - - // Gather information about the user if it's available. - if (claims != null) { - if (!string.IsNullOrEmpty(claims.Email)) { - user.EmailAddress = claims.Email; - user.EmailAddressVerified = trustedEmail; - } - if (!string.IsNullOrEmpty(claims.FullName)) { - if (claims.FullName.IndexOf(' ') > 0) { - user.FirstName = claims.FullName.Substring(0, claims.FullName.IndexOf(' ')).Trim(); - user.LastName = claims.FullName.Substring(claims.FullName.IndexOf(' ')).Trim(); - } else { - user.FirstName = claims.FullName; - } - } - } else if (samlToken != null) { - string email, givenName, surname; - if (samlToken.Claims.TryGetValue(ClaimTypes.Email, out email)) { - user.EmailAddress = email; - user.EmailAddressVerified = trustedEmail; - } - if (samlToken.Claims.TryGetValue(ClaimTypes.GivenName, out givenName)) { - user.FirstName = givenName; - } - if (samlToken.Claims.TryGetValue(ClaimTypes.Surname, out surname)) { - user.LastName = surname; - } - } - - Database.DataContext.AddToUsers(user); - } else { - openidToken.UsageCount++; - openidToken.LastUsedUtc = DateTime.UtcNow; - } - return openidToken; - } - - partial void OnCreatedOnUtcChanging(DateTime value) { - Utilities.VerifyThrowNotLocalTime(value); - } - - partial void OnEmailAddressChanged() { - // Whenever the email address is changed, we must reset its verified status. - this.EmailAddressVerified = false; - } - } -} diff --git a/projecttemplates/RelyingPartyLogic/Model.cs b/projecttemplates/RelyingPartyLogic/Model.cs deleted file mode 100644 index c3b297d..0000000 --- a/projecttemplates/RelyingPartyLogic/Model.cs +++ /dev/null @@ -1,34 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="Model.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.Data; - using System.Data.Common; - using System.Data.EntityClient; - using System.Data.Objects; - using System.Linq; - using System.Text; - - public partial class DatabaseEntities { - /// <summary> - /// Clears the expired nonces. - /// </summary> - /// <param name="transaction">The transaction to use, if any.</param> - internal void ClearExpiredNonces(EntityTransaction transaction) { - this.ExecuteCommand(transaction, "DatabaseEntities.ClearExpiredNonces"); - } - - /// <summary> - /// Clears the expired associations. - /// </summary> - /// <param name="transaction">The transaction to use, if any.</param> - internal void ClearExpiredCryptoKeys(EntityTransaction transaction) { - this.ExecuteCommand(transaction, "DatabaseEntities.ClearExpiredCryptoKeys"); - } - } -} diff --git a/projecttemplates/RelyingPartyLogic/Model.edmx b/projecttemplates/RelyingPartyLogic/Model.edmx deleted file mode 100644 index 1845e1c..0000000 --- a/projecttemplates/RelyingPartyLogic/Model.edmx +++ /dev/null @@ -1,459 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<edmx:Edmx Version="2.0" xmlns:edmx="http://schemas.microsoft.com/ado/2008/10/edmx"> - <!-- EF Runtime content --> - <edmx:Runtime> - <!-- SSDL content --> - <edmx:StorageModels> - <Schema Namespace="DatabaseModel.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl"> - <EntityContainer Name="DatabaseModelStoreContainer"> - <EntitySet Name="AuthenticationToken" EntityType="DatabaseModel.Store.AuthenticationToken" store:Type="Tables" Schema="dbo" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" /> - <EntitySet Name="Client" EntityType="DatabaseModel.Store.Client" store:Type="Tables" Schema="dbo" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" /> - <EntitySet Name="ClientAuthorization" EntityType="DatabaseModel.Store.ClientAuthorization" store:Type="Tables" Schema="dbo" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" /> - <EntitySet Name="CryptoKey" EntityType="DatabaseModel.Store.CryptoKey" store:Type="Tables" Schema="dbo" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" /> - <EntitySet Name="Nonce" EntityType="DatabaseModel.Store.Nonce" store:Type="Tables" Schema="dbo" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" /> - <EntitySet Name="Role" EntityType="DatabaseModel.Store.Role" store:Type="Tables" Schema="dbo" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" /> - <EntitySet Name="User" EntityType="DatabaseModel.Store.User" store:Type="Tables" Schema="dbo" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" /> - <EntitySet Name="UserRole" EntityType="DatabaseModel.Store.UserRole" store:Type="Tables" Schema="dbo" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" /> - <AssociationSet Name="FK_AuthenticationToken_User" Association="DatabaseModel.Store.FK_AuthenticationToken_User"> - <End Role="User" EntitySet="User" /> - <End Role="AuthenticationToken" EntitySet="AuthenticationToken" /> - </AssociationSet> - <AssociationSet Name="FK_IssuedToken_Consumer" Association="DatabaseModel.Store.FK_IssuedToken_Consumer"> - <End Role="Client" EntitySet="Client" /> - <End Role="ClientAuthorization" EntitySet="ClientAuthorization" /> - </AssociationSet> - <AssociationSet Name="FK_IssuedToken_User" Association="DatabaseModel.Store.FK_IssuedToken_User"> - <End Role="User" EntitySet="User" /> - <End Role="ClientAuthorization" EntitySet="ClientAuthorization" /> - </AssociationSet> - <AssociationSet Name="FK_UserRole_Role" Association="DatabaseModel.Store.FK_UserRole_Role"> - <End Role="Role" EntitySet="Role" /> - <End Role="UserRole" EntitySet="UserRole" /> - </AssociationSet> - <AssociationSet Name="FK_UserRole_User" Association="DatabaseModel.Store.FK_UserRole_User"> - <End Role="User" EntitySet="User" /> - <End Role="UserRole" EntitySet="UserRole" /> - </AssociationSet> - </EntityContainer> - <EntityType Name="AuthenticationToken"> - <Key> - <PropertyRef Name="AuthenticationTokenId" /> - </Key> - <Property Name="AuthenticationTokenId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" /> - <Property Name="UserId" Type="int" Nullable="false" /> - <Property Name="OpenIdClaimedIdentifier" Type="nvarchar" Nullable="false" MaxLength="250" /> - <Property Name="OpenIdFriendlyIdentifier" Type="nvarchar" MaxLength="250" /> - <Property Name="CreatedOn" Type="datetime" Nullable="false" /> - <Property Name="LastUsed" Type="datetime" Nullable="false" /> - <Property Name="UsageCount" Type="int" Nullable="false" /> - </EntityType> - <EntityType Name="Client"> - <Key> - <PropertyRef Name="ClientId" /> - </Key> - <Property Name="ClientId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" /> - <Property Name="ClientIdentifier" Type="varchar" Nullable="false" MaxLength="255" /> - <Property Name="ClientSecret" Type="varchar" MaxLength="255" /> - <Property Name="Callback" Type="varchar" MaxLength="2048" /> - <Property Name="ClientType" Type="int" Nullable="false" /> - <Property Name="Name" Type="nvarchar" Nullable="false" MaxLength="50" /> - </EntityType> - <EntityType Name="ClientAuthorization"> - <Key> - <PropertyRef Name="AuthorizationId" /> - </Key> - <Property Name="AuthorizationId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" /> - <Property Name="ClientId" Type="int" Nullable="false" /> - <Property Name="UserId" Type="int" Nullable="false" /> - <Property Name="CreatedOn" Type="datetime" Nullable="false" /> - <Property Name="ExpirationDate" Type="datetime" /> - <Property Name="Scope" Type="varchar" MaxLength="2048" /> - </EntityType> - <EntityType Name="CryptoKey"> - <Key> - <PropertyRef Name="CryptoKeyId" /> - </Key> - <Property Name="CryptoKeyId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" /> - <Property Name="Bucket" Type="varchar" Nullable="false" MaxLength="255" /> - <Property Name="Handle" Type="varchar" Nullable="false" MaxLength="255" /> - <Property Name="Expiration" Type="datetime" Nullable="false" /> - <Property Name="Secret" Type="varbinary" Nullable="false" MaxLength="4096" /> - </EntityType> - <EntityType Name="Nonce"> - <Key> - <PropertyRef Name="NonceId" /> - </Key> - <Property Name="NonceId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" /> - <Property Name="Context" Type="varchar" Nullable="false" MaxLength="255" /> - <Property Name="Code" Type="varchar" Nullable="false" MaxLength="255" /> - <Property Name="Issued" Type="datetime" Nullable="false" /> - <Property Name="Expires" Type="datetime" Nullable="false" /> - </EntityType> - <EntityType Name="Role"> - <Key> - <PropertyRef Name="RoleId" /> - </Key> - <Property Name="RoleId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" /> - <Property Name="Name" Type="nvarchar" Nullable="false" MaxLength="50" /> - </EntityType> - <EntityType Name="User"> - <Key> - <PropertyRef Name="UserId" /> - </Key> - <Property Name="UserId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" /> - <Property Name="FirstName" Type="nvarchar" MaxLength="50" /> - <Property Name="LastName" Type="nvarchar" MaxLength="50" /> - <Property Name="EmailAddress" Type="nvarchar" MaxLength="100" /> - <Property Name="EmailAddressVerified" Type="bit" Nullable="false" /> - <Property Name="CreatedOn" Type="datetime" Nullable="false" /> - </EntityType> - <EntityType Name="UserRole"> - <Key> - <PropertyRef Name="UserId" /> - <PropertyRef Name="RoleId" /> - </Key> - <Property Name="UserId" Type="int" Nullable="false" /> - <Property Name="RoleId" Type="int" Nullable="false" /> - </EntityType> - <Association Name="FK_AuthenticationToken_User"> - <End Role="User" Type="DatabaseModel.Store.User" Multiplicity="1"> - <OnDelete Action="Cascade" /> - </End> - <End Role="AuthenticationToken" Type="DatabaseModel.Store.AuthenticationToken" Multiplicity="*" /> - <ReferentialConstraint> - <Principal Role="User"> - <PropertyRef Name="UserId" /> - </Principal> - <Dependent Role="AuthenticationToken"> - <PropertyRef Name="UserId" /> - </Dependent> - </ReferentialConstraint> - </Association> - <Association Name="FK_IssuedToken_Consumer"> - <End Role="Client" Type="DatabaseModel.Store.Client" Multiplicity="1"> - <OnDelete Action="Cascade" /> - </End> - <End Role="ClientAuthorization" Type="DatabaseModel.Store.ClientAuthorization" Multiplicity="*" /> - <ReferentialConstraint> - <Principal Role="Client"> - <PropertyRef Name="ClientId" /> - </Principal> - <Dependent Role="ClientAuthorization"> - <PropertyRef Name="ClientId" /> - </Dependent> - </ReferentialConstraint> - </Association> - <Association Name="FK_IssuedToken_User"> - <End Role="User" Type="DatabaseModel.Store.User" Multiplicity="1"> - <OnDelete Action="Cascade" /> - </End> - <End Role="ClientAuthorization" Type="DatabaseModel.Store.ClientAuthorization" Multiplicity="*" /> - <ReferentialConstraint> - <Principal Role="User"> - <PropertyRef Name="UserId" /> - </Principal> - <Dependent Role="ClientAuthorization"> - <PropertyRef Name="UserId" /> - </Dependent> - </ReferentialConstraint> - </Association> - <Association Name="FK_UserRole_Role"> - <End Role="Role" Type="DatabaseModel.Store.Role" Multiplicity="1"> - <OnDelete Action="Cascade" /> - </End> - <End Role="UserRole" Type="DatabaseModel.Store.UserRole" Multiplicity="*" /> - <ReferentialConstraint> - <Principal Role="Role"> - <PropertyRef Name="RoleId" /> - </Principal> - <Dependent Role="UserRole"> - <PropertyRef Name="RoleId" /> - </Dependent> - </ReferentialConstraint> - </Association> - <Association Name="FK_UserRole_User"> - <End Role="User" Type="DatabaseModel.Store.User" Multiplicity="1"> - <OnDelete Action="Cascade" /> - </End> - <End Role="UserRole" Type="DatabaseModel.Store.UserRole" Multiplicity="*" /> - <ReferentialConstraint> - <Principal Role="User"> - <PropertyRef Name="UserId" /> - </Principal> - <Dependent Role="UserRole"> - <PropertyRef Name="UserId" /> - </Dependent> - </ReferentialConstraint> - </Association> - <Function Name="ClearExpiredCryptoKeys" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" /> - <Function Name="ClearExpiredNonces" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" /> - </Schema></edmx:StorageModels> - <!-- CSDL content --> - <edmx:ConceptualModels> - <Schema Namespace="DatabaseModel" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2008/09/edm"> - <EntityContainer Name="DatabaseEntities"> - <EntitySet Name="Roles" EntityType="DatabaseModel.Role" /> - <EntitySet Name="Users" EntityType="DatabaseModel.User" /> - <AssociationSet Name="UserRole" Association="DatabaseModel.UserRole"> - <End Role="Role" EntitySet="Roles" /> - <End Role="User" EntitySet="Users" /> - </AssociationSet> - <EntitySet Name="AuthenticationTokens" EntityType="DatabaseModel.AuthenticationToken" /> - <AssociationSet Name="FK_AuthenticationToken_User" Association="DatabaseModel.FK_AuthenticationToken_User"> - <End Role="User" EntitySet="Users" /> - <End Role="AuthenticationToken" EntitySet="AuthenticationTokens" /></AssociationSet> - <EntitySet Name="Nonces" EntityType="DatabaseModel.Nonce" /> - <FunctionImport Name="ClearExpiredNonces" /> - <EntitySet Name="Clients" EntityType="DatabaseModel.Client" /> - <EntitySet Name="ClientAuthorizations" EntityType="DatabaseModel.ClientAuthorization" /> - <AssociationSet Name="FK_IssuedToken_Consumer" Association="DatabaseModel.FK_IssuedToken_Consumer"> - <End Role="Client" EntitySet="Clients" /> - <End Role="ClientAuthorization" EntitySet="ClientAuthorizations" /> - </AssociationSet> - <AssociationSet Name="FK_IssuedToken_User" Association="DatabaseModel.FK_IssuedToken_User"> - <End Role="User" EntitySet="Users" /> - <End Role="ClientAuthorization" EntitySet="ClientAuthorizations" /> - </AssociationSet> - <EntitySet Name="SymmetricCryptoKeys" EntityType="DatabaseModel.SymmetricCryptoKey" /> - </EntityContainer> - <EntityType Name="AuthenticationToken" Abstract="false"> - <Key> - <PropertyRef Name="AuthenticationTokenId" /></Key> - <Property Name="ClaimedIdentifier" Type="String" Nullable="false" /> - <Property Name="FriendlyIdentifier" Type="String" Nullable="true" /> - <Property Name="CreatedOnUtc" Type="DateTime" Nullable="false" a:SetterAccess="Private" xmlns:a="http://schemas.microsoft.com/ado/2006/04/codegeneration" /> - <Property Name="LastUsedUtc" Type="DateTime" Nullable="false" /> - <Property Name="UsageCount" Type="Int32" Nullable="false" /> - <Property Name="AuthenticationTokenId" Type="Int32" Nullable="false" a:SetterAccess="Private" xmlns:a="http://schemas.microsoft.com/ado/2006/04/codegeneration" /> - <NavigationProperty Name="User" Relationship="DatabaseModel.FK_AuthenticationToken_User" FromRole="AuthenticationToken" ToRole="User" /></EntityType> - <EntityType Name="Role"> - <Key> - <PropertyRef Name="RoleId" /></Key> - <Property Name="Name" Type="String" Nullable="false" MaxLength="50" Unicode="true" FixedLength="false" /> - <NavigationProperty Name="Users" Relationship="DatabaseModel.UserRole" FromRole="Role" ToRole="User" /> - <Property Name="RoleId" Type="Int32" Nullable="false" a:SetterAccess="Private" xmlns:a="http://schemas.microsoft.com/ado/2006/04/codegeneration" /></EntityType> - <EntityType Name="User"> - <Key> - <PropertyRef Name="UserId" /></Key> - <Property Name="FirstName" Type="String" MaxLength="50" Unicode="true" FixedLength="false" /> - <Property Name="LastName" Type="String" MaxLength="50" Unicode="true" FixedLength="false" /> - <Property Name="EmailAddress" Type="String" MaxLength="100" Unicode="true" FixedLength="false"> - <Documentation> - <Summary>The email address claimed to be controlled by the user. Whether it is actually owned by the user is indicated by the EmailAddressVerified property.</Summary></Documentation></Property> - <NavigationProperty Name="Roles" Relationship="DatabaseModel.UserRole" FromRole="User" ToRole="Role" /> - <Property Name="EmailAddressVerified" Type="Boolean" Nullable="false"> - <Documentation> - <Summary>A value indicating whether the email address has been verified as actually owned by this user.</Summary></Documentation></Property> - <Property Name="CreatedOnUtc" Type="DateTime" Nullable="false" a:SetterAccess="Private" xmlns:a="http://schemas.microsoft.com/ado/2006/04/codegeneration" /> - <Property Name="UserId" Type="Int32" Nullable="false" a:SetterAccess="Private" xmlns:a="http://schemas.microsoft.com/ado/2006/04/codegeneration" /> - <NavigationProperty Name="AuthenticationTokens" Relationship="DatabaseModel.FK_AuthenticationToken_User" FromRole="User" ToRole="AuthenticationToken" /> - <NavigationProperty Name="ClientAuthorizations" Relationship="DatabaseModel.FK_IssuedToken_User" FromRole="User" ToRole="ClientAuthorization" /></EntityType> - <Association Name="UserRole"> - <End Role="Role" Type="DatabaseModel.Role" Multiplicity="*" /> - <End Role="User" Type="DatabaseModel.User" Multiplicity="*" /> - </Association> - <Association Name="FK_AuthenticationToken_User"> - <End Type="DatabaseModel.User" Role="User" Multiplicity="1" /> - <End Type="DatabaseModel.AuthenticationToken" Role="AuthenticationToken" Multiplicity="*" /></Association> - <EntityType Name="Nonce" a:TypeAccess="Public" xmlns:a="http://schemas.microsoft.com/ado/2006/04/codegeneration"> - <Key> - <PropertyRef Name="NonceId" /></Key> - <Property Name="NonceId" Type="Int32" Nullable="false" /> - <Property Name="Context" Type="String" Nullable="false"> - <Documentation> - <Summary>Gets or sets the Provider Endpoint URL the nonce came from.</Summary></Documentation></Property> - <Property Name="Code" Type="String" Nullable="false" /> - <Property Name="IssuedUtc" Type="DateTime" Nullable="false" /> - <Property Name="ExpiresUtc" Type="DateTime" Nullable="false" /></EntityType> - <EntityType Name="Client"> - <Key> - <PropertyRef Name="ClientId" /> - </Key> - <Property Type="Int32" Name="ClientId" Nullable="false" a:StoreGeneratedPattern="Identity" xmlns:a="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /> - <Property Type="String" Name="ClientIdentifier" Nullable="false" MaxLength="255" FixedLength="false" Unicode="true" /> - <Property Type="String" Name="ClientSecret" MaxLength="255" FixedLength="false" Unicode="true" /> - <Property Type="String" Name="CallbackAsString" MaxLength="2048" FixedLength="false" Unicode="true" /> - <Property Type="String" Name="Name" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" /> - <NavigationProperty Name="ClientAuthorizations" Relationship="DatabaseModel.FK_IssuedToken_Consumer" FromRole="Client" ToRole="ClientAuthorization" /> - <Property Type="Int32" Name="ClientType" Nullable="false" /> - </EntityType> - <EntityType Name="ClientAuthorization"> - <Key> - <PropertyRef Name="AuthorizationId" /> - </Key> - <Property Type="Int32" Name="AuthorizationId" Nullable="false" a:StoreGeneratedPattern="Identity" xmlns:a="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /> - <Property Type="DateTime" Name="CreatedOnUtc" Nullable="false" /> - <Property Type="DateTime" Name="ExpirationDateUtc" Nullable="true" /> - <Property Type="String" Name="Scope" MaxLength="2048" FixedLength="false" Unicode="false" /> - <NavigationProperty Name="Client" Relationship="DatabaseModel.FK_IssuedToken_Consumer" FromRole="ClientAuthorization" ToRole="Client" /> - <NavigationProperty Name="User" Relationship="DatabaseModel.FK_IssuedToken_User" FromRole="ClientAuthorization" ToRole="User" /> - </EntityType> - <Association Name="FK_IssuedToken_Consumer"> - <End Type="DatabaseModel.Client" Role="Client" Multiplicity="1" /> - <End Type="DatabaseModel.ClientAuthorization" Role="ClientAuthorization" Multiplicity="*" /> - </Association> - <Association Name="FK_IssuedToken_User"> - <End Type="DatabaseModel.User" Role="User" Multiplicity="1" /> - <End Type="DatabaseModel.ClientAuthorization" Role="ClientAuthorization" Multiplicity="*" /> - </Association> - <EntityType Name="SymmetricCryptoKey"> - <Key> - <PropertyRef Name="CryptoKeyId" /> - </Key> - <Property Type="Int32" Name="CryptoKeyId" Nullable="false" a:StoreGeneratedPattern="Identity" xmlns:a="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /> - <Property Type="String" Name="Bucket" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" /> - <Property Type="String" Name="Handle" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" /> - <Property Type="DateTime" Name="ExpirationUtc" Nullable="false" /> - <Property Type="Binary" Name="Secret" Nullable="false" MaxLength="4096" FixedLength="false" /> - </EntityType></Schema> - </edmx:ConceptualModels> - <!-- C-S mapping content --> - <edmx:Mappings> - <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2008/09/mapping/cs"> - <EntityContainerMapping StorageEntityContainer="DatabaseModelStoreContainer" CdmEntityContainer="DatabaseEntities"> - <EntitySetMapping Name="Roles"> - <EntityTypeMapping TypeName="IsTypeOf(DatabaseModel.Role)"> - <MappingFragment StoreEntitySet="Role"> - <ScalarProperty Name="RoleId" ColumnName="RoleId" /> - <ScalarProperty Name="Name" ColumnName="Name" /> - </MappingFragment> - </EntityTypeMapping> - </EntitySetMapping> - <EntitySetMapping Name="Users"> - <EntityTypeMapping TypeName="IsTypeOf(DatabaseModel.User)"> - <MappingFragment StoreEntitySet="User"> - <ScalarProperty Name="UserId" ColumnName="UserId" /> - <ScalarProperty Name="CreatedOnUtc" ColumnName="CreatedOn" /> - <ScalarProperty Name="EmailAddressVerified" ColumnName="EmailAddressVerified" /> - <ScalarProperty Name="FirstName" ColumnName="FirstName" /> - <ScalarProperty Name="LastName" ColumnName="LastName" /> - <ScalarProperty Name="EmailAddress" ColumnName="EmailAddress" /> - </MappingFragment> - </EntityTypeMapping> - </EntitySetMapping> - <AssociationSetMapping Name="UserRole" TypeName="DatabaseModel.UserRole" StoreEntitySet="UserRole"> - <EndProperty Name="User"> - <ScalarProperty Name="UserId" ColumnName="UserId" /></EndProperty> - <EndProperty Name="Role"> - <ScalarProperty Name="RoleId" ColumnName="RoleId" /></EndProperty> - </AssociationSetMapping> - <EntitySetMapping Name="AuthenticationTokens"><EntityTypeMapping TypeName="IsTypeOf(DatabaseModel.AuthenticationToken)"> - <MappingFragment StoreEntitySet="AuthenticationToken"> - <ScalarProperty Name="AuthenticationTokenId" ColumnName="AuthenticationTokenId" /> - <ScalarProperty Name="UsageCount" ColumnName="UsageCount" /> - <ScalarProperty Name="LastUsedUtc" ColumnName="LastUsed" /> - <ScalarProperty Name="CreatedOnUtc" ColumnName="CreatedOn" /> - <ScalarProperty Name="FriendlyIdentifier" ColumnName="OpenIdFriendlyIdentifier" /> - <ScalarProperty Name="ClaimedIdentifier" ColumnName="OpenIdClaimedIdentifier" /> - </MappingFragment> - </EntityTypeMapping> - </EntitySetMapping> - <AssociationSetMapping Name="FK_AuthenticationToken_User" TypeName="DatabaseModel.FK_AuthenticationToken_User" StoreEntitySet="AuthenticationToken"> - <EndProperty Name="AuthenticationToken"> - <ScalarProperty Name="AuthenticationTokenId" ColumnName="AuthenticationTokenId" /></EndProperty> - <EndProperty Name="User"> - <ScalarProperty Name="UserId" ColumnName="UserId" /></EndProperty></AssociationSetMapping> - <EntitySetMapping Name="Nonces"> - <EntityTypeMapping TypeName="IsTypeOf(DatabaseModel.Nonce)"> - <MappingFragment StoreEntitySet="Nonce"> - <ScalarProperty Name="ExpiresUtc" ColumnName="Expires" /> - <ScalarProperty Name="IssuedUtc" ColumnName="Issued" /> - <ScalarProperty Name="Code" ColumnName="Code" /> - <ScalarProperty Name="Context" ColumnName="Context" /> - <ScalarProperty Name="NonceId" ColumnName="NonceId" /></MappingFragment></EntityTypeMapping></EntitySetMapping> - <FunctionImportMapping FunctionImportName="ClearExpiredNonces" FunctionName="DatabaseModel.Store.ClearExpiredNonces" /> - <EntitySetMapping Name="Clients"> - <EntityTypeMapping TypeName="DatabaseModel.Client"> - <MappingFragment StoreEntitySet="Client"> - <ScalarProperty Name="ClientType" ColumnName="ClientType" /> - <ScalarProperty Name="Name" ColumnName="Name" /> - <ScalarProperty Name="CallbackAsString" ColumnName="Callback" /> - <ScalarProperty Name="ClientSecret" ColumnName="ClientSecret" /> - <ScalarProperty Name="ClientIdentifier" ColumnName="ClientIdentifier" /> - <ScalarProperty Name="ClientId" ColumnName="ClientId" /> - </MappingFragment> - </EntityTypeMapping> - </EntitySetMapping> - <EntitySetMapping Name="ClientAuthorizations"> - <EntityTypeMapping TypeName="DatabaseModel.ClientAuthorization"> - <MappingFragment StoreEntitySet="ClientAuthorization"> - <ScalarProperty Name="Scope" ColumnName="Scope" /> - <ScalarProperty Name="ExpirationDateUtc" ColumnName="ExpirationDate" /> - <ScalarProperty Name="CreatedOnUtc" ColumnName="CreatedOn" /> - <ScalarProperty Name="AuthorizationId" ColumnName="AuthorizationId" /> - </MappingFragment> - </EntityTypeMapping> - </EntitySetMapping> - <AssociationSetMapping Name="FK_IssuedToken_Consumer" TypeName="DatabaseModel.FK_IssuedToken_Consumer" StoreEntitySet="ClientAuthorization"> - <EndProperty Name="ClientAuthorization"> - <ScalarProperty Name="AuthorizationId" ColumnName="AuthorizationId" /> - </EndProperty> - <EndProperty Name="Client"> - <ScalarProperty Name="ClientId" ColumnName="ClientId" /> - </EndProperty> - </AssociationSetMapping> - <AssociationSetMapping Name="FK_IssuedToken_User" TypeName="DatabaseModel.FK_IssuedToken_User" StoreEntitySet="ClientAuthorization"> - <EndProperty Name="ClientAuthorization"> - <ScalarProperty Name="AuthorizationId" ColumnName="AuthorizationId" /> - </EndProperty> - <EndProperty Name="User"> - <ScalarProperty Name="UserId" ColumnName="UserId" /> - </EndProperty> - </AssociationSetMapping> - <EntitySetMapping Name="SymmetricCryptoKeys"> - <EntityTypeMapping TypeName="DatabaseModel.SymmetricCryptoKey"> - <MappingFragment StoreEntitySet="CryptoKey"> - <ScalarProperty Name="Secret" ColumnName="Secret" /> - <ScalarProperty Name="ExpirationUtc" ColumnName="Expiration" /> - <ScalarProperty Name="Handle" ColumnName="Handle" /> - <ScalarProperty Name="Bucket" ColumnName="Bucket" /> - <ScalarProperty Name="CryptoKeyId" ColumnName="CryptoKeyId" /> - </MappingFragment> - </EntityTypeMapping> - </EntitySetMapping></EntityContainerMapping> - </Mapping> - </edmx:Mappings> - </edmx:Runtime> - <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) --> - <edmx:Designer> - <edmx:Connection> - <DesignerInfoPropertySet xmlns="http://schemas.microsoft.com/ado/2008/10/edmx"> - <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" /> - </DesignerInfoPropertySet> - </edmx:Connection> - <edmx:Options> - <DesignerInfoPropertySet xmlns="http://schemas.microsoft.com/ado/2008/10/edmx"> - <DesignerProperty Name="ValidateOnBuild" Value="true" /> - <DesignerProperty Name="EnablePluralization" Value="True" /> - <DesignerProperty Name="IncludeForeignKeysInModel" Value="False" /> - </DesignerInfoPropertySet> - </edmx:Options> - <!-- Diagram content (shape and connector positions) --> - <edmx:Diagrams> - <Diagram Name="Model" ZoomLevel="101" xmlns="http://schemas.microsoft.com/ado/2008/10/edmx"> - <EntityTypeShape EntityType="DatabaseModel.AuthenticationToken" Width="1.875" PointX="5.25" PointY="0.75" Height="2.5571907552083339" IsExpanded="true" /> - <EntityTypeShape EntityType="DatabaseModel.Role" Width="1.5" PointX="0.75" PointY="1.25" Height="1.59568359375" IsExpanded="true" /> - <EntityTypeShape EntityType="DatabaseModel.User" Width="1.75" PointX="2.875" PointY="0.5" Height="3.1340950520833339" IsExpanded="true" /> - <AssociationConnector Association="DatabaseModel.UserRole" ManuallyRouted="false"> - <ConnectorPoint PointX="2.25" PointY="2.047841796875" /> - <ConnectorPoint PointX="2.875" PointY="2.047841796875" /></AssociationConnector> - <InheritanceConnector EntityType="DatabaseModel.AuthenticationToken"> - <ConnectorPoint PointX="6.5625" PointY="3.375" /> - <ConnectorPoint PointX="6.5625" PointY="2.9129850260416665" /></InheritanceConnector> - <AssociationConnector Association="DatabaseModel.FK_AuthenticationToken_User"> - <ConnectorPoint PointX="4.625" PointY="1.9324446614583337" /> - <ConnectorPoint PointX="5.25" PointY="1.9324446614583337" /></AssociationConnector> - <EntityTypeShape EntityType="DatabaseModel.Nonce" Width="1.5" PointX="9.625" PointY="0.75" Height="1.9802864583333326" /> - <EntityTypeShape EntityType="DatabaseModel.Client" Width="1.625" PointX="5.25" PointY="3.75" Height="2.3648893229166665" /> - <EntityTypeShape EntityType="DatabaseModel.ClientAuthorization" Width="1.75" PointX="2.875" PointY="3.75" Height="2.1725878906250031" /> - <AssociationConnector Association="DatabaseModel.FK_IssuedToken_Consumer"> - <ConnectorPoint PointX="5.25" PointY="4.8362939453125016" /> - <ConnectorPoint PointX="4.625" PointY="4.8362939453125016" /> - </AssociationConnector> - <AssociationConnector Association="DatabaseModel.FK_IssuedToken_User"> - <ConnectorPoint PointX="3.75" PointY="3.2494921875" /> - <ConnectorPoint PointX="3.75" PointY="3.75" /> - </AssociationConnector> - <EntityTypeShape EntityType="DatabaseModel.SymmetricCryptoKey" Width="1.875" PointX="7.5" PointY="0.75" Height="1.9802864583333317" /></Diagram></edmx:Diagrams> - </edmx:Designer> -</edmx:Edmx>
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyLogic/NonceDbStore.cs b/projecttemplates/RelyingPartyLogic/NonceDbStore.cs deleted file mode 100644 index 3de2371..0000000 --- a/projecttemplates/RelyingPartyLogic/NonceDbStore.cs +++ /dev/null @@ -1,133 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="NonceDbStore.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.Data; - using System.Data.Common; - using System.Data.EntityClient; - using System.Linq; - using System.Text; - using DotNetOpenAuth.Configuration; - using DotNetOpenAuth.Messaging.Bindings; - - /// <summary> - /// A database-backed nonce store for OpenID and OAuth services. - /// </summary> - public class NonceDbStore : INonceStore { - private const int NonceClearingInterval = 5; - - /// <summary> - /// A counter that tracks how many nonce stores have been done. - /// </summary> - private static int nonceClearingCounter; - - /// <summary> - /// Initializes a new instance of the <see cref="NonceDbStore"/> class. - /// </summary> - public NonceDbStore() { - } - - #region INonceStore Members - - /// <summary> - /// Stores a given nonce and timestamp. - /// </summary> - /// <param name="context">The context, or namespace, within which the - /// <paramref name="nonce"/> must be unique. - /// The context SHOULD be treated as case-sensitive. - /// The value will never be <c>null</c> but may be the empty string.</param> - /// <param name="nonce">A series of random characters.</param> - /// <param name="timestampUtc">The UTC timestamp that together with the nonce string make it unique - /// within the given <paramref name="context"/>. - /// The timestamp may also be used by the data store to clear out old nonces.</param> - /// <returns> - /// True if the context+nonce+timestamp (combination) was not previously in the database. - /// False if the nonce was stored previously with the same timestamp and context. - /// </returns> - /// <remarks> - /// The nonce must be stored for no less than the maximum time window a message may - /// be processed within before being discarded as an expired message. - /// This maximum message age can be looked up via the - /// <see cref="DotNetOpenAuth.Configuration.MessagingElement.MaximumMessageLifetime"/> - /// property, accessible via the <see cref="DotNetOpenAuth.Configuration.MessagingElement.Configuration"/> - /// property. - /// </remarks> - public bool StoreNonce(string context, string nonce, DateTime timestampUtc) { - try { - using (var dataContext = new TransactedDatabaseEntities(IsolationLevel.ReadCommitted)) { - Nonce nonceEntity = new Nonce { - Context = context, - Code = nonce, - IssuedUtc = timestampUtc, - ExpiresUtc = timestampUtc + DotNetOpenAuthSection.Messaging.MaximumMessageLifetime, - }; - - // The database columns [context] and [code] MUST be using - // a case sensitive collation for this to be secure. - dataContext.AddToNonces(nonceEntity); - } - } catch (UpdateException) { - // A nonce collision - return false; - } - - // Only clear nonces after successfully storing a nonce. - // This mitigates cheap DoS attacks that take up a lot of - // database cycles. - ClearNoncesIfAppropriate(); - return true; - } - - #endregion - - /// <summary> - /// Clears the nonces if appropriate. - /// </summary> - private static void ClearNoncesIfAppropriate() { - if (++nonceClearingCounter % NonceClearingInterval == 0) { - using (var dataContext = new TransactedDatabaseEntities(IsolationLevel.ReadCommitted)) { - dataContext.ClearExpiredNonces(dataContext.Transaction); - } - } - } - - /// <summary> - /// A transacted data context. - /// </summary> - protected class TransactedDatabaseEntities : DatabaseEntities { - /// <summary> - /// Initializes a new instance of the <see cref="TransactedDatabaseEntities"/> class. - /// </summary> - /// <param name="isolationLevel">The isolation level.</param> - public TransactedDatabaseEntities(IsolationLevel isolationLevel) { - this.Connection.Open(); - this.Transaction = (EntityTransaction)this.Connection.BeginTransaction(isolationLevel); - } - - /// <summary> - /// Gets the transaction for this data context. - /// </summary> - public EntityTransaction Transaction { get; private set; } - - /// <summary> - /// Releases the resources used by the object context. - /// </summary> - /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param> - protected override void Dispose(bool disposing) { - try { - this.SaveChanges(); - this.Transaction.Commit(); - } finally { - this.Connection.Close(); - } - - base.Dispose(disposing); - } - } - } -} diff --git a/projecttemplates/RelyingPartyLogic/OAuthAuthenticationModule.cs b/projecttemplates/RelyingPartyLogic/OAuthAuthenticationModule.cs deleted file mode 100644 index 3d37e1f..0000000 --- a/projecttemplates/RelyingPartyLogic/OAuthAuthenticationModule.cs +++ /dev/null @@ -1,93 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="OAuthAuthenticationModule.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Security.Claims; - using System.Security.Principal; - using System.Threading; - using System.Threading.Tasks; - using System.Web; - using System.Web.Security; - using DotNetOpenAuth.Messaging; - using DotNetOpenAuth.OAuth2; - - public class OAuthAuthenticationModule : IHttpModule { - private HttpApplication application; - - #region IHttpModule Members - - /// <summary> - /// Initializes a module and prepares it to handle requests. - /// </summary> - /// <param name="context">An <see cref="T:System.Web.HttpApplication"/> that provides access to the methods, properties, and events common to all application objects within an ASP.NET application</param> - public void Init(HttpApplication context) { - this.application = context; - this.application.AuthenticateRequest += this.context_AuthenticateRequest; - - // Register an event that allows us to override roles for OAuth requests. - var roleManager = (RoleManagerModule)this.application.Modules["RoleManager"]; - roleManager.GetRoles += this.roleManager_GetRoles; - } - - /// <summary> - /// Disposes of the resources (other than memory) used by the module that implements <see cref="T:System.Web.IHttpModule"/>. - /// </summary> - public void Dispose() { - } - - /// <summary> - /// Handles the AuthenticateRequest event of the HttpApplication. - /// </summary> - /// <param name="sender">The source of the event.</param> - /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> - private void context_AuthenticateRequest(object sender, EventArgs e) { - // Don't read OAuth messages directed at the OAuth controller or else we'll fail nonce checks. - if (this.IsOAuthControllerRequest()) { - return; - } - - using (var crypto = OAuthResourceServer.CreateRSA()) { - var tokenAnalyzer = new SpecialAccessTokenAnalyzer(crypto, crypto); - var resourceServer = new ResourceServer(tokenAnalyzer); - var context = this.application.Context; - Task.Run( - async delegate { - ProtocolFaultResponseException exception = null; - try { - IPrincipal principal = await resourceServer.GetPrincipalAsync(new HttpRequestWrapper(context.Request)); - context.User = principal; - return; - } catch (ProtocolFaultResponseException ex) { - exception = ex; - } - - var errorResponse = await exception.CreateErrorResponseAsync(CancellationToken.None); - await errorResponse.SendAsync(); - }).Wait(); - } - } - - #endregion - - private bool IsOAuthControllerRequest() { - return string.Equals(this.application.Context.Request.Url.AbsolutePath, "/OAuth.ashx", StringComparison.OrdinalIgnoreCase); - } - - /// <summary> - /// Handles the GetRoles event of the roleManager control. - /// </summary> - /// <param name="sender">The source of the event.</param> - /// <param name="e">The <see cref="System.Web.Security.RoleManagerEventArgs"/> instance containing the event data.</param> - private void roleManager_GetRoles(object sender, RoleManagerEventArgs e) { - if (this.application.User is ClaimsPrincipal) { - e.RolesPopulated = true; - } - } - } -} diff --git a/projecttemplates/RelyingPartyLogic/OAuthAuthorizationManager.cs b/projecttemplates/RelyingPartyLogic/OAuthAuthorizationManager.cs deleted file mode 100644 index f40cf36..0000000 --- a/projecttemplates/RelyingPartyLogic/OAuthAuthorizationManager.cs +++ /dev/null @@ -1,77 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="OAuthAuthorizationManager.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.IdentityModel.Policy; - using System.Linq; - using System.Security.Principal; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.ServiceModel.Security; - using System.Threading; - using System.Threading.Tasks; - using DotNetOpenAuth; - using DotNetOpenAuth.Messaging; - using DotNetOpenAuth.OAuth; - using DotNetOpenAuth.OAuth2; - - /// <summary> - /// A WCF extension to authenticate incoming messages using OAuth. - /// </summary> - public class OAuthAuthorizationManager : ServiceAuthorizationManager { - public OAuthAuthorizationManager() { - } - - protected override bool CheckAccessCore(OperationContext operationContext) { - if (!base.CheckAccessCore(operationContext)) { - return false; - } - - var httpDetails = operationContext.RequestContext.RequestMessage.Properties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty; - var requestUri = operationContext.RequestContext.RequestMessage.Properties.Via; - - return Task.Run( - async delegate { - using (var crypto = OAuthResourceServer.CreateRSA()) { - var tokenAnalyzer = new SpecialAccessTokenAnalyzer(crypto, crypto); - var resourceServer = new ResourceServer(tokenAnalyzer); - ProtocolFaultResponseException exception = null; - try { - IPrincipal principal = - await resourceServer.GetPrincipalAsync(httpDetails, requestUri, CancellationToken.None, operationContext.IncomingMessageHeaders.Action); - var policy = new OAuthPrincipalAuthorizationPolicy(principal); - var policies = new List<IAuthorizationPolicy> { policy, }; - - var securityContext = new ServiceSecurityContext(policies.AsReadOnly()); - if (operationContext.IncomingMessageProperties.Security != null) { - operationContext.IncomingMessageProperties.Security.ServiceSecurityContext = securityContext; - } else { - operationContext.IncomingMessageProperties.Security = new SecurityMessageProperty { - ServiceSecurityContext = securityContext, - }; - } - - securityContext.AuthorizationContext.Properties["Identities"] = new List<IIdentity> { principal.Identity, }; - - return true; - } catch (ProtocolFaultResponseException ex) { - // Return the appropriate unauthorized response to the client. - exception = ex; - } catch (DotNetOpenAuth.Messaging.ProtocolException /* ex*/) { - ////Logger.Error("Error processing OAuth messages.", ex); - } - - var errorResponse = await exception.CreateErrorResponseAsync(CancellationToken.None); - await errorResponse.SendAsync(); - } - - return false; - }).Result; - } - } -} diff --git a/projecttemplates/RelyingPartyLogic/OAuthAuthorizationServer.cs b/projecttemplates/RelyingPartyLogic/OAuthAuthorizationServer.cs deleted file mode 100644 index f5b1186..0000000 --- a/projecttemplates/RelyingPartyLogic/OAuthAuthorizationServer.cs +++ /dev/null @@ -1,203 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="OAuthAuthorizationServer.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Security.Cryptography; - using System.Security.Cryptography.X509Certificates; - using System.Text; - using System.Web; - using DotNetOpenAuth.Messaging.Bindings; - using DotNetOpenAuth.OAuth2; - using DotNetOpenAuth.OAuth2.ChannelElements; - using DotNetOpenAuth.OAuth2.Messages; - - /// <summary> - /// Provides OAuth 2.0 authorization server information to DotNetOpenAuth. - /// </summary> - public class OAuthAuthorizationServer : IAuthorizationServerHost { - private static readonly RSACryptoServiceProvider SigningKey = new RSACryptoServiceProvider(); - - private readonly INonceStore nonceStore = new NonceDbStore(); - - /// <summary> - /// Initializes a new instance of the <see cref="OAuthAuthorizationServer"/> class. - /// </summary> - public OAuthAuthorizationServer() { - this.CryptoKeyStore = new RelyingPartyApplicationDbStore(); - } - - #region IAuthorizationServerHost Members - - public ICryptoKeyStore CryptoKeyStore { get; private set; } - - /// <summary> - /// Gets the authorization code nonce store to use to ensure that authorization codes can only be used once. - /// </summary> - /// <value>The authorization code nonce store.</value> - public INonceStore NonceStore { - get { return this.nonceStore; } - } - - /// <summary> - /// Gets the crypto service provider with the asymmetric private key to use for signing access tokens. - /// </summary> - /// <value> - /// Must not be null, and must contain the private key. - /// </value> - /// <returns>A crypto service provider instance that contains the private key.</returns> - public RSACryptoServiceProvider AccessTokenSigningKey { - get { return SigningKey; } - } - - /// <summary> - /// Obtains parameters to go into the formulation of an access token. - /// </summary> - /// <param name="accessTokenRequestMessage">Details regarding the resources that the access token will grant access to, and the identity of the client - /// that will receive that access. - /// Based on this information the receiving resource server can be determined and the lifetime of the access - /// token can be set based on the sensitivity of the resources.</param> - /// <returns> - /// A non-null parameters instance that DotNetOpenAuth will dispose after it has been used. - /// </returns> - public AccessTokenResult CreateAccessToken(IAccessTokenRequest accessTokenRequestMessage) { - var accessToken = new AuthorizationServerAccessToken() { - // For this sample, we assume just one resource server. - // If this authorization server needs to mint access tokens for more than one resource server, - // we'd look at the request message passed to us and decide which public key to return. - ResourceServerEncryptionKey = OAuthResourceServer.CreateRSA(), - }; - - var result = new AccessTokenResult(accessToken); - return result; - } - - /// <summary> - /// Gets the client with a given identifier. - /// </summary> - /// <param name="clientIdentifier">The client identifier.</param> - /// <returns>The client registration. Never null.</returns> - /// <exception cref="ArgumentException">Thrown when no client with the given identifier is registered with this authorization server.</exception> - public IClientDescription GetClient(string clientIdentifier) { - try { - return Database.DataContext.Clients.First(c => c.ClientIdentifier == clientIdentifier); - } catch (InvalidOperationException ex) { - throw new ArgumentOutOfRangeException("No client by that identifier.", ex); - } - } - - /// <summary> - /// Determines whether a described authorization is (still) valid. - /// </summary> - /// <param name="authorization">The authorization.</param> - /// <returns> - /// <c>true</c> if the original authorization is still valid; otherwise, <c>false</c>. - /// </returns> - /// <remarks> - /// <para>When establishing that an authorization is still valid, - /// it's very important to only match on recorded authorizations that - /// meet these criteria:</para> - /// 1) The client identifier matches. - /// 2) The user account matches. - /// 3) The scope on the recorded authorization must include all scopes in the given authorization. - /// 4) The date the recorded authorization was issued must be <em>no later</em> that the date the given authorization was issued. - /// <para>One possible scenario is where the user authorized a client, later revoked authorization, - /// and even later reinstated authorization. This subsequent recorded authorization - /// would not satisfy requirement #4 in the above list. This is important because the revocation - /// the user went through should invalidate all previously issued tokens as a matter of - /// security in the event the user was revoking access in order to sever authorization on a stolen - /// account or piece of hardware in which the tokens were stored. </para> - /// </remarks> - public bool IsAuthorizationValid(IAuthorizationDescription authorization) { - return this.IsAuthorizationValid(authorization.Scope, authorization.ClientIdentifier, authorization.UtcIssued, authorization.User); - } - - /// <summary> - /// Determines whether a given set of resource owner credentials is valid based on the authorization server's user database - /// and if so records an authorization entry such that subsequent calls to <see cref="IsAuthorizationValid" /> would - /// return <c>true</c>. - /// </summary> - /// <param name="userName">Username on the account.</param> - /// <param name="password">The user's password.</param> - /// <param name="accessRequest">The access request the credentials came with. - /// This may be useful if the authorization server wishes to apply some policy based on the client that is making the request.</param> - /// <returns> - /// A value that describes the result of the authorization check. - /// </returns> - public AutomatedUserAuthorizationCheckResponse CheckAuthorizeResourceOwnerCredentialGrant(string userName, string password, IAccessTokenRequest accessRequest) { - // This web site delegates user authentication to OpenID Providers, and as such no users have local passwords with this server. - throw new NotSupportedException(); - } - - /// <summary> - /// Determines whether an access token request given a client credential grant should be authorized - /// and if so records an authorization entry such that subsequent calls to <see cref="IsAuthorizationValid" /> would - /// return <c>true</c>. - /// </summary> - /// <param name="accessRequest">The access request the credentials came with. - /// This may be useful if the authorization server wishes to apply some policy based on the client that is making the request.</param> - /// <returns> - /// A value that describes the result of the authorization check. - /// </returns> - public AutomatedAuthorizationCheckResponse CheckAuthorizeClientCredentialsGrant(IAccessTokenRequest accessRequest) { - throw new NotImplementedException(); - } - - #endregion - - public bool CanBeAutoApproved(EndUserAuthorizationRequest authorizationRequest) { - if (authorizationRequest == null) { - throw new ArgumentNullException("authorizationRequest"); - } - - // NEVER issue an auto-approval to a client that would end up getting an access token immediately - // (without a client secret), as that would allow ANY client to spoof an approved client's identity - // and obtain unauthorized access to user data. - if (authorizationRequest.ResponseType == EndUserAuthorizationResponseType.AuthorizationCode) { - // Never issue auto-approval if the client secret is blank, since that too makes it easy to spoof - // a client's identity and obtain unauthorized access. - var requestingClient = Database.DataContext.Clients.First(c => c.ClientIdentifier == authorizationRequest.ClientIdentifier); - if (!string.IsNullOrEmpty(requestingClient.ClientSecret)) { - return this.IsAuthorizationValid( - authorizationRequest.Scope, - authorizationRequest.ClientIdentifier, - DateTime.UtcNow, - HttpContext.Current.User.Identity.Name); - } - } - - // Default to not auto-approving. - return false; - } - - private bool IsAuthorizationValid(HashSet<string> requestedScopes, string clientIdentifier, DateTime issuedUtc, string username) { - var grantedScopeStrings = from auth in Database.DataContext.ClientAuthorizations - where - auth.Client.ClientIdentifier == clientIdentifier && - auth.CreatedOnUtc <= issuedUtc && - (!auth.ExpirationDateUtc.HasValue || auth.ExpirationDateUtc.Value >= DateTime.UtcNow) && - auth.User.AuthenticationTokens.Any(token => token.ClaimedIdentifier == username) - select auth.Scope; - - if (!grantedScopeStrings.Any()) { - // No granted authorizations prior to the issuance of this token, so it must have been revoked. - // Even if later authorizations restore this client's ability to call in, we can't allow - // access tokens issued before the re-authorization because the revoked authorization should - // effectively and permanently revoke all access and refresh tokens. - return false; - } - - var grantedScopes = new HashSet<string>(OAuthUtilities.ScopeStringComparer); - foreach (string scope in grantedScopeStrings) { - grantedScopes.UnionWith(OAuthUtilities.SplitScopes(scope)); - } - - return requestedScopes.IsSubsetOf(grantedScopes); - } - } -} diff --git a/projecttemplates/RelyingPartyLogic/OAuthPrincipalAuthorizationPolicy.cs b/projecttemplates/RelyingPartyLogic/OAuthPrincipalAuthorizationPolicy.cs deleted file mode 100644 index d53bf9e..0000000 --- a/projecttemplates/RelyingPartyLogic/OAuthPrincipalAuthorizationPolicy.cs +++ /dev/null @@ -1,54 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="OAuthPrincipalAuthorizationPolicy.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.IdentityModel.Claims; - using System.IdentityModel.Policy; - using System.Linq; - using System.Security.Principal; - using System.Web; - using DotNetOpenAuth.OAuth.ChannelElements; - - public class OAuthPrincipalAuthorizationPolicy : IAuthorizationPolicy { - private readonly Guid uniqueId = Guid.NewGuid(); - private readonly IPrincipal principal; - - /// <summary> - /// Initializes a new instance of the <see cref="OAuthPrincipalAuthorizationPolicy"/> class. - /// </summary> - /// <param name="principal">The principal.</param> - public OAuthPrincipalAuthorizationPolicy(IPrincipal principal) { - this.principal = principal; - } - - #region IAuthorizationComponent Members - - /// <summary> - /// Gets a unique ID for this instance. - /// </summary> - public string Id { - get { return this.uniqueId.ToString(); } - } - - #endregion - - #region IAuthorizationPolicy Members - - public ClaimSet Issuer { - get { return ClaimSet.System; } - } - - public bool Evaluate(EvaluationContext evaluationContext, ref object state) { - evaluationContext.AddClaimSet(this, new DefaultClaimSet(Claim.CreateNameClaim(this.principal.Identity.Name))); - evaluationContext.Properties["Principal"] = this.principal; - return true; - } - - #endregion - } -}
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyLogic/OAuthResourceServer.cs b/projecttemplates/RelyingPartyLogic/OAuthResourceServer.cs deleted file mode 100644 index fe55f8b..0000000 --- a/projecttemplates/RelyingPartyLogic/OAuthResourceServer.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Security.Cryptography; - using System.Text; - - public static class OAuthResourceServer { - private static readonly RSAParameters ResourceServerKeyPair = CreateRSAKey(); - - internal static RSACryptoServiceProvider CreateRSA() { - var rsa = new RSACryptoServiceProvider(); - rsa.ImportParameters(ResourceServerKeyPair); - return rsa; - } - - /// <summary> - /// Creates the RSA key used by all the crypto service provider instances we create. - /// </summary> - /// <returns>RSA data that includes the private key.</returns> - private static RSAParameters CreateRSAKey() { - // As we generate a new random key, we need to set the UseMachineKeyStore flag so that this doesn't - // crash on IIS. For more information: - // http://social.msdn.microsoft.com/Forums/en-US/clr/thread/7ea48fd0-8d6b-43ed-b272-1a0249ae490f?prof=required - var cspParameters = new CspParameters(); - cspParameters.Flags = CspProviderFlags.UseArchivableKey | CspProviderFlags.UseMachineKeyStore; - var asymmetricKey = new RSACryptoServiceProvider(cspParameters); - return asymmetricKey.ExportParameters(true); - } - } -} diff --git a/projecttemplates/RelyingPartyLogic/OAuthServiceProvider.cs b/projecttemplates/RelyingPartyLogic/OAuthServiceProvider.cs deleted file mode 100644 index b6ba45e..0000000 --- a/projecttemplates/RelyingPartyLogic/OAuthServiceProvider.cs +++ /dev/null @@ -1,77 +0,0 @@ -//-----------------------------------------------------------------------
-// <copyright file="OAuthServiceProvider.cs" company="Outercurve Foundation">
-// Copyright (c) Outercurve Foundation. All rights reserved.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace RelyingPartyLogic {
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using DotNetOpenAuth.Messaging;
- using DotNetOpenAuth.OAuth2;
- using DotNetOpenAuth.OAuth2.ChannelElements;
- using DotNetOpenAuth.OAuth2.Messages;
-
- public class OAuthServiceProvider {
- private const string PendingAuthorizationRequestSessionKey = "PendingAuthorizationRequest";
-
- /// <summary>
- /// The lock to synchronize initialization of the <see cref="authorizationServer"/> field.
- /// </summary>
- private static readonly object InitializerLock = new object();
-
- /// <summary>
- /// The shared service description for this web site.
- /// </summary>
- private static AuthorizationServerDescription authorizationServerDescription;
-
- /// <summary>
- /// The shared authorization server.
- /// </summary>
- private static AuthorizationServer authorizationServer;
-
- /// <summary>
- /// Gets the service provider.
- /// </summary>
- /// <value>The service provider.</value>
- public static AuthorizationServer AuthorizationServer {
- get {
- EnsureInitialized();
- return authorizationServer;
- }
- }
-
- /// <summary>
- /// Gets the service description.
- /// </summary>
- /// <value>The service description.</value>
- public static AuthorizationServerDescription AuthorizationServerDescription {
- get {
- EnsureInitialized();
- return authorizationServerDescription;
- }
- }
-
- /// <summary>
- /// Initializes the <see cref="authorizationServer"/> field if it has not yet been initialized.
- /// </summary>
- private static void EnsureInitialized() {
- if (authorizationServer == null) {
- lock (InitializerLock) {
- if (authorizationServerDescription == null) {
- authorizationServerDescription = new AuthorizationServerDescription {
- AuthorizationEndpoint = new Uri(Utilities.ApplicationRoot, "OAuth.ashx"),
- TokenEndpoint = new Uri(Utilities.ApplicationRoot, "OAuth.ashx"),
- };
- }
-
- if (authorizationServer == null) {
- authorizationServer = new AuthorizationServer(new OAuthAuthorizationServer());
- }
- }
- }
- }
- }
-}
diff --git a/projecttemplates/RelyingPartyLogic/Policies.cs b/projecttemplates/RelyingPartyLogic/Policies.cs deleted file mode 100644 index 93129a8..0000000 --- a/projecttemplates/RelyingPartyLogic/Policies.cs +++ /dev/null @@ -1,23 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="Policies.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - - public class Policies { - /// <summary> - /// The set of OP Endpoints that we trust pre-verify email addresses before sending them - /// with positive assertions. - /// </summary> - public static readonly Uri[] ProviderEndpointsProvidingTrustedEmails = new Uri[] { - new Uri("https://www.google.com/accounts/o8/ud"), - new Uri("https://open.login.yahooapis.com/openid/op/auth"), - }; - } -} diff --git a/projecttemplates/RelyingPartyLogic/Properties/AssemblyInfo.cs b/projecttemplates/RelyingPartyLogic/Properties/AssemblyInfo.cs deleted file mode 100644 index 8cb040c..0000000 --- a/projecttemplates/RelyingPartyLogic/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("RelyingPartyLogic")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft IT")] -[assembly: AssemblyProduct("RelyingPartyLogic")] -[assembly: AssemblyCopyright("Copyright © Microsoft IT 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("86d51499-3206-4eea-9bfe-b7950dac606b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/projecttemplates/RelyingPartyLogic/RelyingPartyApplicationDbStore.cs b/projecttemplates/RelyingPartyLogic/RelyingPartyApplicationDbStore.cs deleted file mode 100644 index 8afd3d4..0000000 --- a/projecttemplates/RelyingPartyLogic/RelyingPartyApplicationDbStore.cs +++ /dev/null @@ -1,94 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="RelyingPartyApplicationDbStore.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.Data; - using System.Linq; - using DotNetOpenAuth; - using DotNetOpenAuth.Messaging.Bindings; - using DotNetOpenAuth.OpenId; - - /// <summary> - /// A database-backed state store for OpenID relying parties. - /// </summary> - public class RelyingPartyApplicationDbStore : NonceDbStore, ICryptoKeyAndNonceStore { - /// <summary> - /// Initializes a new instance of the <see cref="RelyingPartyApplicationDbStore"/> class. - /// </summary> - public RelyingPartyApplicationDbStore() { - } - - #region ICryptoStore Members - - public CryptoKey GetKey(string bucket, string handle) { - using (var dataContext = new TransactedDatabaseEntities(System.Data.IsolationLevel.ReadCommitted)) { - var associations = from assoc in dataContext.SymmetricCryptoKeys - where assoc.Bucket == bucket - where assoc.Handle == handle - where assoc.ExpirationUtc > DateTime.UtcNow - select assoc; - return associations.AsEnumerable() - .Select(assoc => new CryptoKey(assoc.Secret, assoc.ExpirationUtc.AsUtc())) - .FirstOrDefault(); - } - } - - public IEnumerable<KeyValuePair<string, CryptoKey>> GetKeys(string bucket) { - using (var dataContext = new TransactedDatabaseEntities(System.Data.IsolationLevel.ReadCommitted)) { - var relevantAssociations = from assoc in dataContext.SymmetricCryptoKeys - where assoc.Bucket == bucket - where assoc.ExpirationUtc > DateTime.UtcNow - orderby assoc.ExpirationUtc descending - select assoc; - var qualifyingAssociations = relevantAssociations.AsEnumerable() - .Select(assoc => new KeyValuePair<string, CryptoKey>(assoc.Handle, new CryptoKey(assoc.Secret, assoc.ExpirationUtc.AsUtc()))); - return qualifyingAssociations.ToList(); // the data context is closing, so we must cache the result. - } - } - - public void StoreKey(string bucket, string handle, CryptoKey key) { - using (var dataContext = new TransactedDatabaseEntities(System.Data.IsolationLevel.ReadCommitted)) { - var sharedAssociation = new SymmetricCryptoKey { - Bucket = bucket, - Handle = handle, - ExpirationUtc = key.ExpiresUtc, - Secret = key.Key, - }; - - dataContext.AddToSymmetricCryptoKeys(sharedAssociation); - } - } - - public void RemoveKey(string bucket, string handle) { - using (var dataContext = new TransactedDatabaseEntities(System.Data.IsolationLevel.ReadCommitted)) { - var association = dataContext.SymmetricCryptoKeys.FirstOrDefault(a => a.Bucket == bucket && a.Handle == handle); - if (association != null) { - dataContext.DeleteObject(association); - } else { - } - } - } - - #endregion - - /// <summary> - /// Clears all expired associations from the store. - /// </summary> - /// <remarks> - /// If another algorithm is in place to periodically clear out expired associations, - /// this method call may be ignored. - /// This should be done frequently enough to avoid a memory leak, but sparingly enough - /// to not be a performance drain. - /// </remarks> - internal void ClearExpiredCryptoKeys() { - using (var dataContext = new TransactedDatabaseEntities(IsolationLevel.ReadCommitted)) { - dataContext.ClearExpiredCryptoKeys(dataContext.Transaction); - } - } - } -} diff --git a/projecttemplates/RelyingPartyLogic/RelyingPartyLogic.csproj b/projecttemplates/RelyingPartyLogic/RelyingPartyLogic.csproj deleted file mode 100644 index fed94c3..0000000 --- a/projecttemplates/RelyingPartyLogic/RelyingPartyLogic.csproj +++ /dev/null @@ -1,249 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))' != '' " /> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>9.0.30729</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{17932639-1F50-48AF-B0A5-E2BF832F82CC}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>RelyingPartyLogic</RootNamespace> - <AssemblyName>RelyingPartyLogic</AssemblyName> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> - <FileAlignment>512</FileAlignment> - <FileUpgradeFlags> - </FileUpgradeFlags> - <OldToolsVersion>3.5</OldToolsVersion> - <UpgradeBackupLocation /> - <IsWebBootstrapper>false</IsWebBootstrapper> - <TargetFrameworkProfile /> - <PublishUrl>publish\</PublishUrl> - <Install>true</Install> - <InstallFrom>Disk</InstallFrom> - <UpdateEnabled>false</UpdateEnabled> - <UpdateMode>Foreground</UpdateMode> - <UpdateInterval>7</UpdateInterval> - <UpdateIntervalUnits>Days</UpdateIntervalUnits> - <UpdatePeriodically>false</UpdatePeriodically> - <UpdateRequired>false</UpdateRequired> - <MapFileExtensions>true</MapFileExtensions> - <ApplicationRevision>0</ApplicationRevision> - <ApplicationVersion>1.0.0.%2a</ApplicationVersion> - <UseApplicationTrust>false</UseApplicationTrust> - <BootstrapperEnabled>true</BootstrapperEnabled> - <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\src\</SolutionDir> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> - </PropertyGroup> - <ItemGroup> - <Reference Include="Microsoft.SqlServer.ConnectionInfo" /> - <Reference Include="Microsoft.SqlServer.Smo" /> - <Reference Include="Microsoft.SqlServer.Management.Sdk.Sfc" /> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Core"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - </Reference> - <Reference Include="System.Data.DataSetExtensions"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - </Reference> - <Reference Include="System.Data.Entity"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - </Reference> - <Reference Include="System.Data.Linq"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - </Reference> - <Reference Include="System.IdentityModel"> - <RequiredTargetFramework>3.0</RequiredTargetFramework> - </Reference> - <Reference Include="System.Net.Http" /> - <Reference Include="System.Net.Http.WebRequest" /> - <Reference Include="System.Runtime.Serialization"> - <RequiredTargetFramework>3.0</RequiredTargetFramework> - </Reference> - <Reference Include="System.Security" /> - <Reference Include="System.ServiceModel"> - <RequiredTargetFramework>3.0</RequiredTargetFramework> - </Reference> - <Reference Include="System.Web.Abstractions" /> - <Reference Include="System.Web.Entity"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - </Reference> - <Reference Include="System.Web.Extensions"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - </Reference> - <Reference Include="System.Xml.Linq"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - </Reference> - <Reference Include="System.Drawing" /> - <Reference Include="System.Web" /> - <Reference Include="System.Xml" /> - <Reference Include="System.Configuration" /> - <Reference Include="System.Web.Services" /> - <Reference Include="System.EnterpriseServices" /> - <Reference Include="System.Web.Mobile" /> - <Reference Include="System.Web.ApplicationServices" Condition=" '$(TargetFrameworkVersion)' != 'v3.5' "> - <RequiredTargetFramework>v4.0</RequiredTargetFramework> - </Reference> - </ItemGroup> - <ItemGroup> - <Compile Include="Model.cs" /> - <Compile Include="Model.ClientAuthorization.cs" /> - <Compile Include="Database.cs" /> - <Compile Include="DataRoleProvider.cs" /> - <Compile Include="Model.AuthenticationToken.cs" /> - <Compile Include="Model.Client.cs" /> - <Compile Include="Model.Designer.cs"> - <DependentUpon>Model.edmx</DependentUpon> - <AutoGen>True</AutoGen> - <DesignTime>True</DesignTime> - </Compile> - <Compile Include="Model.User.cs" /> - <Compile Include="NonceDbStore.cs" /> - <Compile Include="OAuthAuthorizationServer.cs" /> - <Compile Include="OAuthAuthenticationModule.cs" /> - <Compile Include="OAuthAuthorizationManager.cs" /> - <Compile Include="OAuthPrincipalAuthorizationPolicy.cs" /> - <Compile Include="OAuthResourceServer.cs" /> - <Compile Include="OAuthServiceProvider.cs" /> - <Compile Include="Policies.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="RelyingPartyApplicationDbStore.cs" /> - <Compile Include="SpecialAccessTokenAnalyzer.cs" /> - <Compile Include="Utilities.cs" /> - </ItemGroup> - <ItemGroup> - <EntityDeploy Include="Model.edmx"> - <Generator>EntityModelCodeGenerator</Generator> - <LastGenOutput>Model.Designer.cs</LastGenOutput> - </EntityDeploy> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\..\src\DotNetOpenAuth.InfoCard\DotNetOpenAuth.InfoCard.csproj"> - <Project>{408D10B8-34BA-4CBD-B7AA-FEB1907ABA4C}</Project> - <Name>DotNetOpenAuth.InfoCard</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.Core\DotNetOpenAuth.Core.csproj"> - <Project>{60426312-6AE5-4835-8667-37EDEA670222}</Project> - <Name>DotNetOpenAuth.Core</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth.Common\DotNetOpenAuth.OAuth.Common.csproj"> - <Project>{115217C5-22CD-415C-A292-0DD0238CDD89}</Project> - <Name>DotNetOpenAuth.OAuth.Common</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth.ServiceProvider\DotNetOpenAuth.OAuth.ServiceProvider.csproj"> - <Project>{FED1923A-6D70-49B5-A37A-FB744FEC1C86}</Project> - <Name>DotNetOpenAuth.OAuth.ServiceProvider</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth2.AuthorizationServer\DotNetOpenAuth.OAuth2.AuthorizationServer.csproj"> - <Project>{99BB7543-EA16-43EE-A7BC-D7A25A3B22F6}</Project> - <Name>DotNetOpenAuth.OAuth2.AuthorizationServer</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth2.ClientAuthorization\DotNetOpenAuth.OAuth2.ClientAuthorization.csproj"> - <Project>{CCF3728A-B3D7-404A-9BC6-75197135F2D7}</Project> - <Name>DotNetOpenAuth.OAuth2.ClientAuthorization</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth2.Client\DotNetOpenAuth.OAuth2.Client.csproj"> - <Project>{CDEDD439-7F35-4E6E-8605-4E70BDC4CC99}</Project> - <Name>DotNetOpenAuth.OAuth2.Client</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth2.ResourceServer\DotNetOpenAuth.OAuth2.ResourceServer.csproj"> - <Project>{A1A3150A-7B0E-4A34-8E35-045296CD3C76}</Project> - <Name>DotNetOpenAuth.OAuth2.ResourceServer</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth2\DotNetOpenAuth.OAuth2.csproj"> - <Project>{56459A6C-6BA2-4BAC-A9C0-27E3BD961FA6}</Project> - <Name>DotNetOpenAuth.OAuth2</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth\DotNetOpenAuth.OAuth.csproj"> - <Project>{A288FCC8-6FCF-46DA-A45E-5F9281556361}</Project> - <Name>DotNetOpenAuth.OAuth</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OpenId.RelyingParty.UI\DotNetOpenAuth.OpenId.RelyingParty.UI.csproj"> - <Project>{1ED8D424-F8AB-4050-ACEB-F27F4F909484}</Project> - <Name>DotNetOpenAuth.OpenId.RelyingParty.UI</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OpenId.RelyingParty\DotNetOpenAuth.OpenId.RelyingParty.csproj"> - <Project>{F458AB60-BA1C-43D9-8CEF-EC01B50BE87B}</Project> - <Name>DotNetOpenAuth.OpenId.RelyingParty</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OpenId.UI\DotNetOpenAuth.OpenId.UI.csproj"> - <Project>{75E13AAE-7D51-4421-ABFD-3F3DC91F576E}</Project> - <Name>DotNetOpenAuth.OpenId.UI</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OpenId\DotNetOpenAuth.OpenId.csproj"> - <Project>{3896A32A-E876-4C23-B9B8-78E17D134CD3}</Project> - <Name>DotNetOpenAuth.OpenId</Name> - </ProjectReference> - <ProjectReference Include="..\RelyingPartyDatabase\RelyingPartyDatabase.sqlproj"> - <Name>RelyingPartyDatabase</Name> - <!-- Deploy the latest SQL script first, so that this project can embed the latest version. --> - <Targets>GetDeployScriptPath</Targets> - <ReferenceOutputAssembly>false</ReferenceOutputAssembly> - </ProjectReference> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="CreateDatabase.sql" /> - </ItemGroup> - <ItemGroup> - <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> - <Visible>False</Visible> - <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> - <Install>false</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> - <Visible>False</Visible> - <ProductName>.NET Framework 3.5 SP1</ProductName> - <Install>true</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> - <Visible>False</Visible> - <ProductName>Windows Installer 3.1</ProductName> - <Install>true</Install> - </BootstrapperPackage> - </ItemGroup> - <ItemGroup> - <None Include="packages.config" /> - </ItemGroup> - <Target Name="CopySqlDeployScript"> - <MSBuild Projects="..\RelyingPartyDatabase\RelyingPartyDatabase.sqlproj" Targets="GetDeployScriptPath"> - <Output TaskParameter="TargetOutputs" PropertyName="SqlDeployScriptPath" /> - </MSBuild> - <Copy SourceFiles="$(SqlDeployScriptPath)" DestinationFiles="CreateDatabase.sql" /> - </Target> - <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> - <PropertyGroup> - <PrepareResourceNamesDependsOn> - CopySqlDeployScript; - $(PrepareResourceNamesDependsOn) - </PrepareResourceNamesDependsOn> - </PropertyGroup> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " /> - <Import Project="$(SolutionDir)\.nuget\nuget.targets" /> -</Project>
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyLogic/RelyingPartyLogic.vstemplate b/projecttemplates/RelyingPartyLogic/RelyingPartyLogic.vstemplate deleted file mode 100644 index 243d820..0000000 --- a/projecttemplates/RelyingPartyLogic/RelyingPartyLogic.vstemplate +++ /dev/null @@ -1,11 +0,0 @@ -<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project"> - <TemplateData> - <Name>ASP.NET OpenID-InfoCard RP</Name> - <Description>An ASP.NET web forms web site that accepts OpenID and InfoCard logins</Description> - <ProjectType>CSharp</ProjectType> - <Icon>__TemplateIcon.ico</Icon> - </TemplateData> - <TemplateContent> - <Project File="RelyingPartyLogic.csproj" ReplaceParameters="true" /> - </TemplateContent> -</VSTemplate>
\ No newline at end of file diff --git a/projecttemplates/RelyingPartyLogic/SpecialAccessTokenAnalyzer.cs b/projecttemplates/RelyingPartyLogic/SpecialAccessTokenAnalyzer.cs deleted file mode 100644 index e8b00b5..0000000 --- a/projecttemplates/RelyingPartyLogic/SpecialAccessTokenAnalyzer.cs +++ /dev/null @@ -1,35 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="SpecialAccessTokenAnalyzer.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Security.Cryptography; - using System.Text; - - using DotNetOpenAuth.OAuth2; - - internal class SpecialAccessTokenAnalyzer : StandardAccessTokenAnalyzer { - /// <summary> - /// Initializes a new instance of the <see cref="SpecialAccessTokenAnalyzer"/> class. - /// </summary> - /// <param name="authorizationServerPublicSigningKey">The authorization server public signing key.</param> - /// <param name="resourceServerPrivateEncryptionKey">The resource server private encryption key.</param> - internal SpecialAccessTokenAnalyzer(RSACryptoServiceProvider authorizationServerPublicSigningKey, RSACryptoServiceProvider resourceServerPrivateEncryptionKey) - : base(authorizationServerPublicSigningKey, resourceServerPrivateEncryptionKey) { - } - - public override AccessToken DeserializeAccessToken(DotNetOpenAuth.Messaging.IDirectedProtocolMessage message, string accessToken) { - var token = base.DeserializeAccessToken(message, accessToken); - - // Ensure that clients coming in this way always belong to the oauth_client role. - token.Scope.Add("oauth_client"); - - return token; - } - } -} diff --git a/projecttemplates/RelyingPartyLogic/Utilities.cs b/projecttemplates/RelyingPartyLogic/Utilities.cs deleted file mode 100644 index 440dbe7..0000000 --- a/projecttemplates/RelyingPartyLogic/Utilities.cs +++ /dev/null @@ -1,159 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="Utilities.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace RelyingPartyLogic { - using System; - using System.Collections.Generic; - using System.Data; - using System.Data.Common; - using System.Data.EntityClient; - using System.Data.Objects; - using System.Data.SqlClient; - using System.Globalization; - using System.IO; - using System.Linq; - using System.Reflection; - using System.Text; - using System.Web; - using DotNetOpenAuth.OpenId; - using Microsoft.SqlServer.Management.Common; - using Microsoft.SqlServer.Management.Smo; - - public static class Utilities { - internal const string DefaultNamespace = "RelyingPartyLogic"; - - /// <summary> - /// Gets the full URI of the web application root. Guaranteed to end in a slash. - /// </summary> - public static Uri ApplicationRoot { - get { - string appRoot = HttpContext.Current.Request.ApplicationPath; - if (!appRoot.EndsWith("/", StringComparison.Ordinal)) { - appRoot += "/"; - } - - return new Uri(HttpContext.Current.Request.Url, appRoot); - } - } - - public static void CreateDatabase(Identifier claimedId, string friendlyId, string databaseName) { - const string SqlFormat = @" -{0} -GO -EXEC [dbo].[AddUser] 'admin', 'admin', '{1}', '{2}' -GO -"; - var removeSnippets = new string[] { @" -IF IS_SRVROLEMEMBER(N'sysadmin') = 1 - BEGIN - IF EXISTS (SELECT 1 - FROM [master].[dbo].[sysdatabases] - WHERE [name] = N'$(DatabaseName)') - BEGIN - EXECUTE sp_executesql N'ALTER DATABASE [$(DatabaseName)] - SET HONOR_BROKER_PRIORITY OFF - WITH ROLLBACK IMMEDIATE'; - END - END -ELSE - BEGIN - PRINT N'The database settings cannot be modified. You must be a SysAdmin to apply these settings.'; - END - - -GO" }; - string databasePath = HttpContext.Current.Server.MapPath("~/App_Data/" + databaseName + ".mdf"); - StringBuilder schemaSqlBuilder = new StringBuilder(); - using (var sr = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream(DefaultNamespace + ".CreateDatabase.sql"))) { - schemaSqlBuilder.Append(sr.ReadToEnd()); - } - foreach (string remove in removeSnippets) { - schemaSqlBuilder.Replace(remove, string.Empty); - } - schemaSqlBuilder.Replace("Path1_Placeholder", HttpContext.Current.Server.MapPath("~/App_Data/")); - schemaSqlBuilder.Replace("WEBROOT", databasePath); - schemaSqlBuilder.Replace("$(DatabaseName)", databaseName); - - string sql = string.Format(CultureInfo.InvariantCulture, SqlFormat, schemaSqlBuilder, claimedId, "Admin"); - - var serverConnection = new ServerConnection(".\\sqlexpress"); - try { - serverConnection.ExecuteNonQuery(sql); - } finally { - try { - var server = new Server(serverConnection); - server.DetachDatabase(databaseName, true); - } catch (FailedOperationException) { - } - serverConnection.Disconnect(); - } - } - - public static int ExecuteCommand(this ObjectContext objectContext, string command) { - // Try to automatically add the appropriate transaction if one is known. - EntityTransaction transaction = null; - if (Database.IsDataContextInitialized && Database.DataContext == objectContext) { - transaction = Database.DataContextTransaction; - } - return ExecuteCommand(objectContext, transaction, command); - } - - /// <summary> - /// Executes a SQL command against the SQL connection. - /// </summary> - /// <param name="objectContext">The object context.</param> - /// <param name="transaction">The transaction to use, if any.</param> - /// <param name="command">The command to execute.</param> - /// <returns>The result of executing the command.</returns> - public static int ExecuteCommand(this ObjectContext objectContext, EntityTransaction transaction, string command) { - if (objectContext == null) { - throw new ArgumentNullException("objectContext"); - } - if (string.IsNullOrEmpty(command)) { - throw new ArgumentNullException("command"); - } - - DbConnection connection = (EntityConnection)objectContext.Connection; - bool opening = connection.State == ConnectionState.Closed; - if (opening) { - connection.Open(); - } - - DbCommand cmd = connection.CreateCommand(); - cmd.Transaction = transaction; - cmd.CommandText = command; - cmd.CommandType = CommandType.StoredProcedure; - try { - return cmd.ExecuteNonQuery(); - } finally { - if (opening && connection.State == ConnectionState.Open) { - connection.Close(); - } - } - } - - internal static void VerifyThrowNotLocalTime(DateTime value) { - // When we want UTC time, we have to accept Unspecified kind - // because that's how it is set to us in the database. - if (value.Kind == DateTimeKind.Local) { - throw new ArgumentException("DateTime must be given in UTC time but was " + value.Kind.ToString()); - } - } - - /// <summary> - /// Ensures that local times are converted to UTC times. Unspecified kinds are recast to UTC with no conversion. - /// </summary> - /// <param name="value">The date-time to convert.</param> - /// <returns>The date-time in UTC time.</returns> - internal static DateTime AsUtc(this DateTime value) { - if (value.Kind == DateTimeKind.Unspecified) { - return new DateTime(value.Ticks, DateTimeKind.Utc); - } - - return value.ToUniversalTime(); - } - } -} diff --git a/projecttemplates/RelyingPartyLogic/packages.config b/projecttemplates/RelyingPartyLogic/packages.config deleted file mode 100644 index d8ffcb7..0000000 --- a/projecttemplates/RelyingPartyLogic/packages.config +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<packages> - <package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" /> -</packages>
\ No newline at end of file diff --git a/projecttemplates/Settings.StyleCop b/projecttemplates/Settings.StyleCop deleted file mode 100644 index 81a0c9b..0000000 --- a/projecttemplates/Settings.StyleCop +++ /dev/null @@ -1,44 +0,0 @@ -<StyleCopSettings Version="4.3"> - <Analyzers> - <Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules"> - <Rules> - <Rule Name="FileMustHaveHeader"> - <RuleSettings> - <BooleanProperty Name="Enabled">False</BooleanProperty> - </RuleSettings> - </Rule> - <Rule Name="ElementsMustBeDocumented"> - <RuleSettings> - <BooleanProperty Name="Enabled">False</BooleanProperty> - </RuleSettings> - </Rule> - <Rule Name="PartialElementsMustBeDocumented"> - <RuleSettings> - <BooleanProperty Name="Enabled">False</BooleanProperty> - </RuleSettings> - </Rule> - </Rules> - <AnalyzerSettings /> - </Analyzer> - <Analyzer AnalyzerId="StyleCop.CSharp.MaintainabilityRules"> - <Rules> - <Rule Name="FieldsMustBePrivate"> - <RuleSettings> - <BooleanProperty Name="Enabled">False</BooleanProperty> - </RuleSettings> - </Rule> - </Rules> - <AnalyzerSettings /> - </Analyzer> - <Analyzer AnalyzerId="StyleCop.CSharp.NamingRules"> - <Rules> - <Rule Name="ElementMustBeginWithUpperCaseLetter"> - <RuleSettings> - <BooleanProperty Name="Enabled">False</BooleanProperty> - </RuleSettings> - </Rule> - </Rules> - <AnalyzerSettings /> - </Analyzer> - </Analyzers> -</StyleCopSettings>
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty.vsixmanifest b/projecttemplates/WebFormsRelyingParty.vsixmanifest deleted file mode 100644 index 6d010c5..0000000 --- a/projecttemplates/WebFormsRelyingParty.vsixmanifest +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0"?> -<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010"> - <Identifier Id="DotNetOpenAuth.WebFormsRelyingParty.FB0AB0B2-B447-4F10-A03E-F488DDAF024A"> - <Name>ASP.NET OpenID web site (C#)</Name> - <Author>DotNetOpenAuth</Author> - <Version>$version$</Version> - <Description>Resources for developing applications that use OpenID, OAuth, and InfoCard.</Description> - <Locale>1033</Locale> - <License>LICENSE.txt</License> - <GettingStartedGuide>http://www.dotnetopenauth.net/ProjectTemplateGettingStarted</GettingStartedGuide> - <Icon>VSIXProject_small.png</Icon> - <PreviewImage>VSIXProject_large.png</PreviewImage> - <InstalledByMsi>false</InstalledByMsi> - <SupportedProducts> - <VisualStudio Version="10.0"> - <Edition>Pro</Edition> - <Edition>Premium</Edition> - <Edition>Ultimate</Edition> - </VisualStudio> - <VisualStudio Version="11.0"> - <Edition>Pro</Edition> - <Edition>Premium</Edition> - <Edition>Ultimate</Edition> - </VisualStudio> - </SupportedProducts> - <SupportedFrameworkRuntimeEdition MinVersion="3.5" MaxVersion="4.5" /> - </Identifier> - <References /> - <Content> - <ProjectTemplate>PT</ProjectTemplate> - </Content> -</Vsix> diff --git a/projecttemplates/WebFormsRelyingParty.vstemplate b/projecttemplates/WebFormsRelyingParty.vstemplate deleted file mode 100644 index 0773df2..0000000 --- a/projecttemplates/WebFormsRelyingParty.vstemplate +++ /dev/null @@ -1,22 +0,0 @@ -<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="ProjectGroup"> - <TemplateData> - <Name>ASP.NET OpenID-InfoCard RP</Name> - <RequiredFrameworkVersion>3.5</RequiredFrameworkVersion> - <Description>An ASP.NET web forms web site that accepts OpenID and InfoCard logins and acts as an OAuth service provider.</Description> - <ProjectType>CSharp</ProjectType> - <NumberOfParentCategoriesToRollUp>2</NumberOfParentCategoriesToRollUp> - <SortOrder>1000</SortOrder> - <CreateNewFolder>true</CreateNewFolder> - <DefaultName>WebRPApplication</DefaultName> - <ProvideDefaultName>true</ProvideDefaultName> - <LocationField>Enabled</LocationField> - <EnableLocationBrowseButton>true</EnableLocationBrowseButton> - <Icon>__TemplateIcon.ico</Icon> - </TemplateData> - <TemplateContent> - <ProjectCollection> - <ProjectTemplateLink ProjectName="$projectname$">WebFormsRelyingParty\WebFormsRelyingParty.vstemplate</ProjectTemplateLink> - <ProjectTemplateLink ProjectName="RelyingPartyLogic">RelyingPartyLogic\RelyingPartyLogic.vstemplate</ProjectTemplateLink> - </ProjectCollection> - </TemplateContent> -</VSTemplate>
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/Admin/Admin.Master b/projecttemplates/WebFormsRelyingParty/Admin/Admin.Master deleted file mode 100644 index c50b73c..0000000 --- a/projecttemplates/WebFormsRelyingParty/Admin/Admin.Master +++ /dev/null @@ -1,7 +0,0 @@ -<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Admin.master.cs" Inherits="WebFormsRelyingParty.Admin.Admin" - MasterPageFile="~/Site.Master" %> - -<asp:Content ContentPlaceHolderID="Body" runat="server"> - <asp:ContentPlaceHolder ID="Body" runat="server"> - </asp:ContentPlaceHolder> -</asp:Content> diff --git a/projecttemplates/WebFormsRelyingParty/Admin/Admin.Master.cs b/projecttemplates/WebFormsRelyingParty/Admin/Admin.Master.cs deleted file mode 100644 index 2b6d33c..0000000 --- a/projecttemplates/WebFormsRelyingParty/Admin/Admin.Master.cs +++ /dev/null @@ -1,19 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="Admin.Master.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace WebFormsRelyingParty.Admin { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - using System.Web.UI; - using System.Web.UI.WebControls; - - public partial class Admin : System.Web.UI.MasterPage { - protected void Page_Load(object sender, EventArgs e) { - } - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Admin/Admin.Master.designer.cs b/projecttemplates/WebFormsRelyingParty/Admin/Admin.Master.designer.cs deleted file mode 100644 index fa5ccb9..0000000 --- a/projecttemplates/WebFormsRelyingParty/Admin/Admin.Master.designer.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace WebFormsRelyingParty.Admin { - - - public partial class Admin { - - /// <summary> - /// Body control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.ContentPlaceHolder Body; - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Admin/Default.aspx b/projecttemplates/WebFormsRelyingParty/Admin/Default.aspx deleted file mode 100644 index 7e3a03d..0000000 --- a/projecttemplates/WebFormsRelyingParty/Admin/Default.aspx +++ /dev/null @@ -1,52 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebFormsRelyingParty.Admin.Default" %> - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head runat="server"> - <title></title> -</head> -<body> - <form id="form1" runat="server"> - <div> - This is the specially-privileged Admin area. You can only reach here if you are - a member of the Admin role. - </div> - <asp:Repeater runat="server" ID="usersRepeater"> - <HeaderTemplate> - <table border="1"> - <thead> - <tr> - <td> - Email - </td> - <td> - Claimed IDs - </td> - </tr> - </thead> - <tbody> - </HeaderTemplate> - <ItemTemplate> - <tr> - <td> - <%# HttpUtility.HtmlEncode((string)Eval("EmailAddress")) %> - </td> - <td> - <asp:Repeater runat="server" DataSource='<%# Eval("AuthenticationTokens") %>'> - <ItemTemplate> - <%# HttpUtility.HtmlEncode((string)Eval("ClaimedIdentifier")) %> - </ItemTemplate> - <SeparatorTemplate> - <br /> - </SeparatorTemplate> - </asp:Repeater> - </td> - </tr> - </ItemTemplate> - <FooterTemplate> - </tbody> </table> - </FooterTemplate> - </asp:Repeater> - </form> -</body> -</html> diff --git a/projecttemplates/WebFormsRelyingParty/Admin/Default.aspx.cs b/projecttemplates/WebFormsRelyingParty/Admin/Default.aspx.cs deleted file mode 100644 index 8ecdcb2..0000000 --- a/projecttemplates/WebFormsRelyingParty/Admin/Default.aspx.cs +++ /dev/null @@ -1,25 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="Default.aspx.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace WebFormsRelyingParty.Admin { - using System; - using System.Collections.Generic; - using System.Configuration; - using System.Data.SqlClient; - using System.IO; - using System.Linq; - using System.Web; - using System.Web.UI; - using System.Web.UI.WebControls; - using RelyingPartyLogic; - - public partial class Default : System.Web.UI.Page { - protected void Page_Load(object sender, EventArgs e) { - this.usersRepeater.DataSource = Database.DataContext.Users.Include("AuthenticationTokens"); - this.usersRepeater.DataBind(); - } - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Admin/Default.aspx.designer.cs b/projecttemplates/WebFormsRelyingParty/Admin/Default.aspx.designer.cs deleted file mode 100644 index aa45ea1..0000000 --- a/projecttemplates/WebFormsRelyingParty/Admin/Default.aspx.designer.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace WebFormsRelyingParty.Admin { - - - public partial class Default { - - /// <summary> - /// form1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// <summary> - /// usersRepeater control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Repeater usersRepeater; - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Admin/Web.config b/projecttemplates/WebFormsRelyingParty/Admin/Web.config deleted file mode 100644 index 52a5faf..0000000 --- a/projecttemplates/WebFormsRelyingParty/Admin/Web.config +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0"?> -<configuration> - <system.web> - <authorization> - <allow roles="Admin"/> - <deny users="*"/> - </authorization> - </system.web> -</configuration> diff --git a/projecttemplates/WebFormsRelyingParty/Code/SiteUtilities.cs b/projecttemplates/WebFormsRelyingParty/Code/SiteUtilities.cs deleted file mode 100644 index a945793..0000000 --- a/projecttemplates/WebFormsRelyingParty/Code/SiteUtilities.cs +++ /dev/null @@ -1,85 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="SiteUtilities.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace WebFormsRelyingParty.Code { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Security.Cryptography; - using System.Threading; - using System.Threading.Tasks; - using System.Web; - - public static class SiteUtilities { - private const string CsrfCookieName = "CsrfCookie"; - private static readonly RandomNumberGenerator CryptoRandomDataGenerator = new RNGCryptoServiceProvider(); - - public static string SetCsrfCookie() { - // Generate an unpredictable secret that goes to the user agent and must come back - // with authorization to guarantee the user interacted with this page rather than - // being scripted by an evil Consumer. - byte[] randomData = new byte[8]; - CryptoRandomDataGenerator.GetBytes(randomData); - string secret = Convert.ToBase64String(randomData); - - // Send the secret down as a cookie... - var cookie = new HttpCookie(CsrfCookieName, secret) { - Path = HttpContext.Current.Request.Path, - HttpOnly = true, - Expires = DateTime.Now.AddMinutes(30), - }; - HttpContext.Current.Response.SetCookie(cookie); - - // ...and also return the secret so the caller can save it as a hidden form field. - return secret; - } - - public static void VerifyCsrfCookie(string secret) { - var cookie = HttpContext.Current.Request.Cookies[CsrfCookieName]; - if (cookie != null) { - if (cookie.Value == secret && !string.IsNullOrEmpty(secret)) { - // Valid CSRF check. Clear the cookie and return. - cookie.Expires = DateTime.Now.Subtract(TimeSpan.FromDays(1)); - cookie.Value = string.Empty; - if (HttpContext.Current.Request.Browser["supportsEmptyStringInCookieValue"] == "false") { - cookie.Value = "NoCookie"; - } - HttpContext.Current.Response.SetCookie(cookie); - return; - } - } - - throw new InvalidOperationException("Invalid CSRF check."); - } - - internal static Task ToApm(this Task task, AsyncCallback callback, object state) { - if (task == null) { - throw new ArgumentNullException("task"); - } - - var tcs = new TaskCompletionSource<object>(state); - task.ContinueWith( - t => { - if (t.IsFaulted) { - tcs.TrySetException(t.Exception.InnerExceptions); - } else if (t.IsCanceled) { - tcs.TrySetCanceled(); - } else { - tcs.TrySetResult(null); - } - - if (callback != null) { - callback(tcs.Task); - } - }, - CancellationToken.None, - TaskContinuationOptions.None, - TaskScheduler.Default); - - return tcs.Task; - } - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Default.aspx b/projecttemplates/WebFormsRelyingParty/Default.aspx deleted file mode 100644 index 4cecf3f..0000000 --- a/projecttemplates/WebFormsRelyingParty/Default.aspx +++ /dev/null @@ -1,12 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebFormsRelyingParty._Default" - MasterPageFile="~/Site.Master" Title="OpenID + InfoCard Relying Party template" %> - -<%@ Register Assembly="DotNetOpenAuth.OpenId.UI" Namespace="DotNetOpenAuth" TagPrefix="dnoa" %> -<asp:Content runat="server" ContentPlaceHolderID="head"> - <dnoa:XrdsPublisher runat="server" XrdsUrl="~/xrds.aspx" XrdsAdvertisement="Both" /> -</asp:Content> -<asp:Content runat="server" ContentPlaceHolderID="Body"> - <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> - <asp:HyperLink ID="HyperLink1" NavigateUrl="~/Members/Default.aspx" Text="Visit the Members Only area" - runat="server" /> -</asp:Content> diff --git a/projecttemplates/WebFormsRelyingParty/Default.aspx.cs b/projecttemplates/WebFormsRelyingParty/Default.aspx.cs deleted file mode 100644 index 357dc76..0000000 --- a/projecttemplates/WebFormsRelyingParty/Default.aspx.cs +++ /dev/null @@ -1,22 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="Default.aspx.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace WebFormsRelyingParty { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - using System.Web.UI; - using System.Web.UI.WebControls; - using RelyingPartyLogic; - - public partial class _Default : System.Web.UI.Page { - protected void Page_Load(object sender, EventArgs e) { - User user = Database.LoggedInUser; - this.Label1.Text = user != null ? HttpUtility.HtmlEncode(user.FirstName) : "<not logged in>"; - } - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Default.aspx.designer.cs b/projecttemplates/WebFormsRelyingParty/Default.aspx.designer.cs deleted file mode 100644 index 9c12f15..0000000 --- a/projecttemplates/WebFormsRelyingParty/Default.aspx.designer.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace WebFormsRelyingParty { - - - public partial class _Default { - - /// <summary> - /// Label1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Label Label1; - - /// <summary> - /// HyperLink1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.HyperLink HyperLink1; - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Getting Started.htm b/projecttemplates/WebFormsRelyingParty/Getting Started.htm deleted file mode 100644 index 6c8741c..0000000 --- a/projecttemplates/WebFormsRelyingParty/Getting Started.htm +++ /dev/null @@ -1,22 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <title>Getting started</title> -</head> -<body> - <p> - Your OpenID and InfoCard relying party web site is nearly ready to go. You just - need to create your SQL database where user accounts will be stored. <b>Just build and - start your web site</b> and visit <b>Setup.aspx</b>. You'll get further instructions - there. - </p> - <p> - Creating your database is almost totally automated, so it should be a piece of cake. - <b>Note</b> however that creating the database requires Modify permissions in your web - site's App_Data directory for the security account that creates databases on your - computer. If you get a permissions or file write error from setup.aspx, try - temporarily adding Everyone: Modify permissions to your App_Data folder just long - enough to create your database. - </p> -</body> -</html> diff --git a/projecttemplates/WebFormsRelyingParty/Global.asax b/projecttemplates/WebFormsRelyingParty/Global.asax deleted file mode 100644 index ff6cdb1..0000000 --- a/projecttemplates/WebFormsRelyingParty/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="WebFormsRelyingParty.Global" Language="C#" %> diff --git a/projecttemplates/WebFormsRelyingParty/Global.asax.cs b/projecttemplates/WebFormsRelyingParty/Global.asax.cs deleted file mode 100644 index 3ae68e2..0000000 --- a/projecttemplates/WebFormsRelyingParty/Global.asax.cs +++ /dev/null @@ -1,56 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="Global.asax.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace WebFormsRelyingParty { - using System; - using System.Data; - using System.Data.SqlClient; - using System.Linq; - using System.ServiceModel; - using System.Web; - - public class Global : System.Web.HttpApplication { - /// <summary> - /// The logger for this web site to use. - /// </summary> - private static log4net.ILog logger = log4net.LogManager.GetLogger("WebFormsRelyingParty"); - - public static log4net.ILog Logger { - get { return logger; } - } - - protected void Application_Start(object sender, EventArgs e) { - log4net.Config.XmlConfigurator.Configure(); - Logger.Info("Web application starting..."); - } - - protected void Session_Start(object sender, EventArgs e) { - } - - protected void Application_BeginRequest(object sender, EventArgs e) { - } - - protected void Application_EndRequest(object sender, EventArgs e) { - } - - protected void Application_AuthenticateRequest(object sender, EventArgs e) { - } - - protected void Application_Error(object sender, EventArgs e) { - Logger.Error("An unhandled exception occurred in ASP.NET processing for page " + HttpContext.Current.Request.Path, Server.GetLastError()); - } - - protected void Session_End(object sender, EventArgs e) { - } - - protected void Application_End(object sender, EventArgs e) { - Logger.Info("Web application shutting down..."); - - // this would be automatic, but in partial trust scenarios it is not. - log4net.LogManager.Shutdown(); - } - } -}
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/Login.aspx b/projecttemplates/WebFormsRelyingParty/Login.aspx deleted file mode 100644 index 50e7767..0000000 --- a/projecttemplates/WebFormsRelyingParty/Login.aspx +++ /dev/null @@ -1,7 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="WebFormsRelyingParty.Login" - MasterPageFile="~/Site.Master" ValidateRequest="false" %> - -<asp:Content runat="server" ContentPlaceHolderID="Body"> - <h2>Login</h2> - <iframe src="LoginFrame.aspx" frameborder="0" width="355" height="273"></iframe> -</asp:Content> diff --git a/projecttemplates/WebFormsRelyingParty/Login.aspx.cs b/projecttemplates/WebFormsRelyingParty/Login.aspx.cs deleted file mode 100644 index eae2ec9..0000000 --- a/projecttemplates/WebFormsRelyingParty/Login.aspx.cs +++ /dev/null @@ -1,23 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="Login.aspx.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace WebFormsRelyingParty { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - using System.Web.Security; - using System.Web.UI; - using System.Web.UI.WebControls; - using DotNetOpenAuth.OpenId; - using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration; - using DotNetOpenAuth.OpenId.RelyingParty; - - public partial class Login : System.Web.UI.Page { - protected void Page_Load(object sender, EventArgs e) { - } - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Login.aspx.designer.cs b/projecttemplates/WebFormsRelyingParty/Login.aspx.designer.cs deleted file mode 100644 index 30a38cb..0000000 --- a/projecttemplates/WebFormsRelyingParty/Login.aspx.designer.cs +++ /dev/null @@ -1,16 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace WebFormsRelyingParty { - - - public partial class Login { - } -} diff --git a/projecttemplates/WebFormsRelyingParty/LoginFrame.aspx b/projecttemplates/WebFormsRelyingParty/LoginFrame.aspx deleted file mode 100644 index 335fed9..0000000 --- a/projecttemplates/WebFormsRelyingParty/LoginFrame.aspx +++ /dev/null @@ -1,77 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LoginFrame.aspx.cs" Inherits="WebFormsRelyingParty.LoginFrame" - EnableViewState="false" ValidateRequest="false" %> - -<%@ Register Assembly="DotNetOpenAuth.OpenID.RelyingParty.UI" Namespace="DotNetOpenAuth.OpenId.RelyingParty" - TagPrefix="rp" %> -<%@ Register Assembly="DotNetOpenAuth.OpenID" Namespace="DotNetOpenAuth.OpenId.Extensions.SimpleRegistration" TagPrefix="sreg" %> -<%@ Register Assembly="DotNetOpenAuth.InfoCard.UI" Namespace="DotNetOpenAuth.InfoCard" TagPrefix="ic" %> -<%@ Register Assembly="DotNetOpenAuth.OpenIdInfoCard.UI" Namespace="DotNetOpenAuth.OpenId.RelyingParty" TagPrefix="rpic" %> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<!-- COPYRIGHT (C) 2011 Outercurve Foundation. All rights reserved. --> -<!-- LICENSE: Microsoft Public License available at http://opensource.org/licenses/ms-pl.html --> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head runat="server"> - <link rel="stylesheet" type="text/css" href="theme/ui.all.css" /> - <link rel="stylesheet" type="text/css" href="styles/loginpopup.css" /> -</head> -<body> -<% if (Request.Url.IsLoopback) { %> - <script type="text/javascript" src="scripts/jquery-1.3.1.js"></script> - <script type="text/javascript" src="scripts/jquery-ui-personalized-1.6rc6.js"></script> -<% } else { %> - <script type="text/javascript" language="javascript" src="http://www.google.com/jsapi"></script> - <script type="text/javascript" language="javascript"> - google.load("jquery", "1.3.2"); - google.load("jqueryui", "1.7.2"); - </script> -<% } %> - - <script type="text/javascript" src="scripts/jquery.cookie.js"></script> - - <form runat="server" id="form1" target="_top"> - <div class="wrapper"> - <p> - Login with an account you already use! - </p> - <rpic:OpenIdInfoCardSelector runat="server" ID="openIdSelector" OnLoggedIn="openIdSelector_LoggedIn" - OnFailed="openIdSelector_Failed" OnCanceled="openIdSelector_Failed" OnReceivedToken="openIdSelector_ReceivedToken" - OnTokenProcessingError="openIdSelector_TokenProcessingError"> - <Buttons> - <rp:SelectorProviderButton OPIdentifier="https://me.yahoo.com/" Image="images/yahoo.gif" /> - <rp:SelectorProviderButton OPIdentifier="https://www.google.com/accounts/o8/id" Image="images/google.gif" /> - <rpic:SelectorInfoCardButton> - <InfoCardSelector Issuer=""> - <ClaimsRequested> - <ic:ClaimType Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" IsOptional="false" /> - <ic:ClaimType Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname" IsOptional="true" /> - <ic:ClaimType Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname" IsOptional="true" /> - </ClaimsRequested> - </InfoCardSelector> - </rpic:SelectorInfoCardButton> - <rp:SelectorOpenIdButton Image="images/openid.png" /> - </Buttons> - <Extensions> - <sreg:ClaimsRequest Email="Require" FullName="Request" /> - </Extensions> - </rpic:OpenIdInfoCardSelector> - <asp:HiddenField runat="server" ID="topWindowUrl" /> - <asp:Panel ID="errorPanel" runat="server" EnableViewState="false" Visible="false" ForeColor="Red"> - Oops. Something went wrong while logging you in. Trying again may work. <a href="#" onclick="$('#errorMessage').show()"> - What went wrong?</a> - <span id="errorMessage" style="display: none"> - <asp:Label ID="errorMessageLabel" runat="server" Text="Login canceled." /> - </span> - </asp:Panel> - <div class="helpDoc"> - <p> - If you have logged in previously, click the same button you did last time. - </p> - <p> - If you don't have an account with any of these services, just pick Google. They'll - help you set up an account. - </p> - </div> - </div> - </form> -</body> -</html> diff --git a/projecttemplates/WebFormsRelyingParty/LoginFrame.aspx.cs b/projecttemplates/WebFormsRelyingParty/LoginFrame.aspx.cs deleted file mode 100644 index fbd16e7..0000000 --- a/projecttemplates/WebFormsRelyingParty/LoginFrame.aspx.cs +++ /dev/null @@ -1,81 +0,0 @@ -namespace WebFormsRelyingParty { - using System; - using System.Collections.Generic; - using System.Globalization; - using System.IdentityModel.Claims; - using System.Linq; - using System.Web; - using System.Web.Security; - using System.Web.UI; - using System.Web.UI.WebControls; - using DotNetOpenAuth.InfoCard; - using DotNetOpenAuth.Messaging; - using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration; - using DotNetOpenAuth.OpenId.RelyingParty; - using RelyingPartyLogic; - - public partial class LoginFrame : System.Web.UI.Page { - protected void Page_Load(object sender, EventArgs e) { - if (!IsPostBack) { - // Because this page can appear as an iframe in a popup of another page, - // we need to record which page the hosting page is in order to redirect back - // to it after login is complete. - this.ClientScript.RegisterOnSubmitStatement( - this.GetType(), - "getTopWindowUrl", - "document.getElementById('topWindowUrl').value = window.parent.location.href;"); - } - - // We set the privacy policy URL here instead of in the ASPX page with the rest of the - // Simple Registration extension so that we can construct the absolute URL rather than - // hard-coding it. - this.openIdSelector.Extensions.OfType<ClaimsRequest>().Single().PolicyUrl = new Uri(Request.Url, Page.ResolveUrl("~/PrivacyPolicy.aspx")); - } - - protected void openIdSelector_LoggedIn(object sender, OpenIdEventArgs e) { - this.LoginUser(RelyingPartyLogic.User.ProcessUserLogin(e.Response)); - } - - protected void openIdSelector_ReceivedToken(object sender, ReceivedTokenEventArgs e) { - this.LoginUser(RelyingPartyLogic.User.ProcessUserLogin(e.Token)); - } - - protected void openIdSelector_Failed(object sender, OpenIdEventArgs e) { - if (e.Response.Exception != null) { - this.errorMessageLabel.Text = HttpUtility.HtmlEncode(e.Response.Exception.ToStringDescriptive()); - } - this.errorPanel.Visible = true; - } - - protected void openIdSelector_TokenProcessingError(object sender, TokenProcessingErrorEventArgs e) { - this.errorMessageLabel.Text = HttpUtility.HtmlEncode(e.Exception.ToStringDescriptive()); - this.errorPanel.Visible = true; - } - - private void LoginUser(AuthenticationToken openidToken) { - bool persistentCookie = false; - if (string.IsNullOrEmpty(this.Request.QueryString["ReturnUrl"])) { - FormsAuthentication.SetAuthCookie(openidToken.ClaimedIdentifier, persistentCookie); - if (!string.IsNullOrEmpty(this.topWindowUrl.Value)) { - Uri topWindowUri = new Uri(this.topWindowUrl.Value); - string returnUrl = HttpUtility.ParseQueryString(topWindowUri.Query)["ReturnUrl"]; - if (string.IsNullOrEmpty(returnUrl)) { - if (string.Equals(topWindowUri.AbsolutePath, Utilities.ApplicationRoot.AbsolutePath + "login.aspx", StringComparison.OrdinalIgnoreCase)) { - // this happens when the user navigates deliberately directly to login.aspx - Response.Redirect("~/"); - } else { - Response.Redirect(this.topWindowUrl.Value); - } - } else { - Response.Redirect(returnUrl); - } - } else { - // This happens for unsolicited assertions. - Response.Redirect("~/"); - } - } else { - FormsAuthentication.RedirectFromLoginPage(openidToken.ClaimedIdentifier, persistentCookie); - } - } - } -} diff --git a/projecttemplates/WebFormsRelyingParty/LoginFrame.aspx.designer.cs b/projecttemplates/WebFormsRelyingParty/LoginFrame.aspx.designer.cs deleted file mode 100644 index c16954c..0000000 --- a/projecttemplates/WebFormsRelyingParty/LoginFrame.aspx.designer.cs +++ /dev/null @@ -1,60 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace WebFormsRelyingParty { - - - public partial class LoginFrame { - - /// <summary> - /// form1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// <summary> - /// openIdSelector control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::DotNetOpenAuth.OpenId.RelyingParty.OpenIdInfoCardSelector openIdSelector; - - /// <summary> - /// topWindowUrl control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.HiddenField topWindowUrl; - - /// <summary> - /// errorPanel control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Panel errorPanel; - - /// <summary> - /// errorMessageLabel control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Label errorMessageLabel; - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Logout.aspx b/projecttemplates/WebFormsRelyingParty/Logout.aspx deleted file mode 100644 index abba0c1..0000000 --- a/projecttemplates/WebFormsRelyingParty/Logout.aspx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Logout.aspx.cs" Inherits="WebFormsRelyingParty.Logout" %> - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" > -<head runat="server"> - <title></title> -</head> -<body> - <form id="form1" runat="server"> - <div> - - </div> - </form> -</body> -</html> diff --git a/projecttemplates/WebFormsRelyingParty/Logout.aspx.cs b/projecttemplates/WebFormsRelyingParty/Logout.aspx.cs deleted file mode 100644 index 0e53fac..0000000 --- a/projecttemplates/WebFormsRelyingParty/Logout.aspx.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace WebFormsRelyingParty { - using System; - using System.Web.Security; - - public partial class Logout : System.Web.UI.Page { - protected void Page_Load(object sender, EventArgs e) { - FormsAuthentication.SignOut(); - Response.Redirect("~/"); - } - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Logout.aspx.designer.cs b/projecttemplates/WebFormsRelyingParty/Logout.aspx.designer.cs deleted file mode 100644 index 19ef79d..0000000 --- a/projecttemplates/WebFormsRelyingParty/Logout.aspx.designer.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace WebFormsRelyingParty { - - - public partial class Logout { - - /// <summary> - /// form1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Members/AccountInfo.aspx b/projecttemplates/WebFormsRelyingParty/Members/AccountInfo.aspx deleted file mode 100644 index 1f0b0e8..0000000 --- a/projecttemplates/WebFormsRelyingParty/Members/AccountInfo.aspx +++ /dev/null @@ -1,150 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AccountInfo.aspx.cs" Inherits="WebFormsRelyingParty.Members.AccountInfo" - MasterPageFile="~/Site.Master" ValidateRequest="false" %> - -<%@ Register Assembly="DotNetOpenAuth.OpenID.RelyingParty.UI" Namespace="DotNetOpenAuth.OpenId.RelyingParty" - TagPrefix="rp" %> -<%@ Register Assembly="DotNetOpenAuth.InfoCard.UI" Namespace="DotNetOpenAuth.InfoCard" TagPrefix="ic" %> -<%@ Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" - Namespace="System.Web.UI.WebControls" TagPrefix="asp" %> -<%@ Register Assembly="DotNetOpenAuth.OpenIdInfoCard.UI" Namespace="DotNetOpenAuth.OpenId.RelyingParty" TagPrefix="rpic" %> -<asp:Content runat="server" ContentPlaceHolderID="head"> -<% if (Request.Url.IsLoopback) { %> - <script type="text/javascript" src="../scripts/jquery-1.3.1.js"></script> - <script type="text/javascript" src="../scripts/jquery-ui-personalized-1.6rc6.js"></script> -<% } else { %> - <script type="text/javascript" language="javascript" src="http://www.google.com/jsapi"></script> - <script type="text/javascript" language="javascript"> - google.load("jquery", "1.3.2"); - google.load("jqueryui", "1.7.2"); - </script> -<% } %> - <script type="text/javascript" src="../scripts/jquery.cookie.js"></script> -</asp:Content> -<asp:Content runat="server" ContentPlaceHolderID="Body"> - <asp:ScriptManager ID="ScriptManager1" runat="server" /> - <h3> - Personal information - </h3> - <asp:UpdatePanel ID="UpdatePanel1" runat="server"> - <ContentTemplate> - <table> - <tr> - <td> - First name - </td> - <td> - <asp:TextBox ID="firstNameBox" runat="server" /> - </td> - </tr> - <tr> - <td> - Last name - </td> - <td> - <asp:TextBox ID="lastNameBox" runat="server" /> - </td> - </tr> - <tr> - <td> - Email - </td> - <td> - <asp:TextBox ID="emailBox" runat="server" Columns="40" ValidationGroup="Profile" /> - <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="emailBox" - ErrorMessage="Invalid email address" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" - ValidationGroup="Profile" Text="invalid" Display="Dynamic" /> - <asp:Label runat="server" ID="emailVerifiedLabel" Text="verified" Visible="false" /> - </td> - </tr> - <tr> - <td> - </td> - <td> - <asp:Button ID="saveChanges" runat="server" Text="Save profile changes" OnClick="saveChanges_Click" - ValidationGroup="Profile" /> - <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" - DynamicLayout="true"> - <ProgressTemplate> - Saving... - </ProgressTemplate> - </asp:UpdateProgress> - </td> - </tr> - </table> - </ContentTemplate> - <Triggers> - <asp:AsyncPostBackTrigger ControlID="saveChanges" EventName="Click" /> - </Triggers> - </asp:UpdatePanel> - <asp:UpdatePanel runat="server" ID="authorizedClientsPanel" ChildrenAsTriggers="true"> - <ContentTemplate> - <h3> - Authorized clients - </h3> - <asp:Panel runat="server" ID="noAuthorizedClientsPanel" Visible="false"> - You have not authorized any clients to access your data. - </asp:Panel> - <asp:Repeater runat="server" ID="tokenListRepeater"> - <HeaderTemplate> - <ul> - </HeaderTemplate> - <ItemTemplate> - <li> - <asp:Label runat="server" Text='<%# HttpUtility.HtmlEncode(Eval("Client.Name").ToString()) %>' /> - - - <asp:Label ID="Label2" runat="server" Text='<%# HttpUtility.HtmlEncode((string)Eval("Scope")) %>' ForeColor="Gray" /> - - - <asp:Label ID="Label1" runat="server" Text='<%# HttpUtility.HtmlEncode(Eval("CreatedOnUtc").ToString()) %>' ForeColor="Gray" /> - - - <asp:LinkButton ID="revokeLink" runat="server" Text="revoke" OnCommand="revokeToken_Command" - CommandName="revokeToken" CommandArgument='<%# Eval("AuthorizationId") %>' /> - </li> - </ItemTemplate> - <FooterTemplate> - </ul> - </FooterTemplate> - </asp:Repeater> - </ContentTemplate> - </asp:UpdatePanel> - <h3> - OpenIDs & InfoCards - </h3> - <asp:Repeater ID="Repeater1" runat="server"> - <HeaderTemplate> - <ul class="AuthTokens"> - </HeaderTemplate> - <ItemTemplate> - <li class='<%# ((bool)Eval("IsInfoCard")) ? "InfoCard" : "OpenID" %>'> - <asp:Label ID="OpenIdClaimedIdentifierLabel" runat="server" Text='<%# HttpUtility.HtmlEncode(Eval("FriendlyIdentifier").ToString()) %>' - ToolTip='<%# Eval("ClaimedIdentifier") %>' /> - <asp:Label runat="server" ForeColor="Gray" Text="(current login token)" ToolTip="To delete this token, you must log in using some other token." - Visible='<%# String.Equals((string)Eval("ClaimedIdentifier"), Page.User.Identity.Name, StringComparison.Ordinal) %>' /> - <asp:LinkButton runat="server" Text="remove" CommandName="delete" CommandArgument='<%# Eval("ClaimedIdentifier") %>' - ID="deleteOpenId" OnCommand="deleteOpenId_Command" Visible='<%# !String.Equals((string)Eval("ClaimedIdentifier"), Page.User.Identity.Name, StringComparison.Ordinal) %>' /> - </li> - </ItemTemplate> - <FooterTemplate> - </ul> - </FooterTemplate> - </asp:Repeater> - <div> - <p> - Add a way to log into your account: - </p> - <rpic:OpenIdInfoCardSelector runat="server" ID="openIdSelector" OnLoggedIn="openIdBox_LoggedIn" - OnReceivedToken="InfoCardSelector1_ReceivedToken"> - <Buttons> - <rp:SelectorProviderButton OPIdentifier="https://me.yahoo.com/" Image="~/images/yahoo.gif" /> - <rp:SelectorProviderButton OPIdentifier="https://www.google.com/accounts/o8/id" Image="~/images/google.gif" /> - <rpic:SelectorInfoCardButton> - <InfoCardSelector Issuer="" /> - </rpic:SelectorInfoCardButton> - <rp:SelectorOpenIdButton Image="~/images/openid.png" /> - </Buttons> - </rpic:OpenIdInfoCardSelector> - </div> - <asp:Label ID="differentAccountLabel" runat="server" EnableViewState="False" ForeColor="Red" - Text="This identifier already belongs to a different user account." Visible="False" /> - <asp:Label ID="alreadyLinkedLabel" runat="server" EnableViewState="False" ForeColor="Red" - Text="This identifier is already linked to your account." Visible="False" /> -</asp:Content> diff --git a/projecttemplates/WebFormsRelyingParty/Members/AccountInfo.aspx.cs b/projecttemplates/WebFormsRelyingParty/Members/AccountInfo.aspx.cs deleted file mode 100644 index fc83f15..0000000 --- a/projecttemplates/WebFormsRelyingParty/Members/AccountInfo.aspx.cs +++ /dev/null @@ -1,108 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="AccountInfo.aspx.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace WebFormsRelyingParty.Members { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - using System.Web.UI; - using System.Web.UI.WebControls; - using DotNetOpenAuth.InfoCard; - using DotNetOpenAuth.OpenId.RelyingParty; - using RelyingPartyLogic; - - public partial class AccountInfo : System.Web.UI.Page { - protected void Page_Load(object sender, EventArgs e) { - Database.LoggedInUser.AuthenticationTokens.Load(); - this.Repeater1.DataSource = Database.LoggedInUser.AuthenticationTokens; - - if (!Database.LoggedInUser.ClientAuthorizations.IsLoaded) { - Database.LoggedInUser.ClientAuthorizations.Load(); - } - this.tokenListRepeater.DataSource = Database.LoggedInUser.ClientAuthorizations; - foreach (var token in Database.LoggedInUser.ClientAuthorizations) { - if (!token.ClientReference.IsLoaded) { - token.ClientReference.Load(); - } - } - this.authorizedClientsPanel.Visible = Database.LoggedInUser.ClientAuthorizations.Count > 0; - - if (!IsPostBack) { - this.Repeater1.DataBind(); - this.tokenListRepeater.DataBind(); - this.emailBox.Text = Database.LoggedInUser.EmailAddress; - this.emailVerifiedLabel.Visible = Database.LoggedInUser.EmailAddressVerified; - this.firstNameBox.Text = Database.LoggedInUser.FirstName; - this.lastNameBox.Text = Database.LoggedInUser.LastName; - } - - this.firstNameBox.Focus(); - } - - protected void openIdBox_LoggedIn(object sender, OpenIdEventArgs e) { - this.AddIdentifier(e.ClaimedIdentifier, e.Response.FriendlyIdentifierForDisplay); - } - - protected void deleteOpenId_Command(object sender, CommandEventArgs e) { - string claimedId = (string)e.CommandArgument; - var token = Database.DataContext.AuthenticationTokens.First(t => t.ClaimedIdentifier == claimedId && t.User.UserId == Database.LoggedInUser.UserId); - Database.DataContext.DeleteObject(token); - Database.DataContext.SaveChanges(); - this.Repeater1.DataBind(); - } - - protected void saveChanges_Click(object sender, EventArgs e) { - if (!IsValid) { - return; - } - - Database.LoggedInUser.EmailAddress = this.emailBox.Text; - Database.LoggedInUser.FirstName = this.firstNameBox.Text; - Database.LoggedInUser.LastName = this.lastNameBox.Text; - this.emailVerifiedLabel.Visible = Database.LoggedInUser.EmailAddressVerified; - } - - protected void InfoCardSelector1_ReceivedToken(object sender, ReceivedTokenEventArgs e) { - this.AddIdentifier(AuthenticationToken.SynthesizeClaimedIdentifierFromInfoCard(e.Token.UniqueId), e.Token.SiteSpecificId); - } - - protected void revokeToken_Command(object sender, CommandEventArgs e) { - int authorizationId = Convert.ToInt32(e.CommandArgument); - var tokenToRevoke = Database.DataContext.ClientAuthorizations.FirstOrDefault(a => a.AuthorizationId == authorizationId && a.User.UserId == Database.LoggedInUser.UserId); - if (tokenToRevoke != null) { - Database.DataContext.DeleteObject(tokenToRevoke); - } - - this.tokenListRepeater.DataBind(); - this.noAuthorizedClientsPanel.Visible = Database.LoggedInUser.ClientAuthorizations.Count == 0; - } - - private void AddIdentifier(string claimedId, string friendlyId) { - // Check that this identifier isn't already tied to a user account. - // We do this again here in case the LoggingIn event couldn't verify - // and in case somehow the OP changed it anyway. - var existingToken = Database.DataContext.AuthenticationTokens.FirstOrDefault(token => token.ClaimedIdentifier == claimedId); - if (existingToken == null) { - var token = new AuthenticationToken(); - token.ClaimedIdentifier = claimedId; - token.FriendlyIdentifier = friendlyId; - Database.LoggedInUser.AuthenticationTokens.Add(token); - Database.DataContext.SaveChanges(); - this.Repeater1.DataBind(); - - // Clear the box for the next entry - this.openIdSelector.Identifier = null; - } else { - if (existingToken.User == Database.LoggedInUser) { - this.alreadyLinkedLabel.Visible = true; - } else { - this.differentAccountLabel.Visible = true; - } - } - } - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Members/AccountInfo.aspx.designer.cs b/projecttemplates/WebFormsRelyingParty/Members/AccountInfo.aspx.designer.cs deleted file mode 100644 index 77edab7..0000000 --- a/projecttemplates/WebFormsRelyingParty/Members/AccountInfo.aspx.designer.cs +++ /dev/null @@ -1,159 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace WebFormsRelyingParty.Members { - - - public partial class AccountInfo { - - /// <summary> - /// ScriptManager1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.ScriptManager ScriptManager1; - - /// <summary> - /// UpdatePanel1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.UpdatePanel UpdatePanel1; - - /// <summary> - /// firstNameBox control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.TextBox firstNameBox; - - /// <summary> - /// lastNameBox control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.TextBox lastNameBox; - - /// <summary> - /// emailBox control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.TextBox emailBox; - - /// <summary> - /// RegularExpressionValidator1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator1; - - /// <summary> - /// emailVerifiedLabel control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Label emailVerifiedLabel; - - /// <summary> - /// saveChanges control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Button saveChanges; - - /// <summary> - /// UpdateProgress1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.UpdateProgress UpdateProgress1; - - /// <summary> - /// authorizedClientsPanel control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.UpdatePanel authorizedClientsPanel; - - /// <summary> - /// noAuthorizedClientsPanel control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Panel noAuthorizedClientsPanel; - - /// <summary> - /// tokenListRepeater control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Repeater tokenListRepeater; - - /// <summary> - /// Repeater1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Repeater Repeater1; - - /// <summary> - /// openIdSelector control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::DotNetOpenAuth.OpenId.RelyingParty.OpenIdInfoCardSelector openIdSelector; - - /// <summary> - /// differentAccountLabel control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Label differentAccountLabel; - - /// <summary> - /// alreadyLinkedLabel control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Label alreadyLinkedLabel; - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Members/Default.aspx b/projecttemplates/WebFormsRelyingParty/Members/Default.aspx deleted file mode 100644 index 157237f..0000000 --- a/projecttemplates/WebFormsRelyingParty/Members/Default.aspx +++ /dev/null @@ -1,9 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebFormsRelyingParty.Members.Default" - MasterPageFile="~/Site.Master" %> - -<asp:Content runat="server" ContentPlaceHolderID="Body"> - <h2>Members Only</h2> - <div> - You've made it to the Members Only area. - </div> -</asp:Content> diff --git a/projecttemplates/WebFormsRelyingParty/Members/Default.aspx.cs b/projecttemplates/WebFormsRelyingParty/Members/Default.aspx.cs deleted file mode 100644 index 8460541..0000000 --- a/projecttemplates/WebFormsRelyingParty/Members/Default.aspx.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace WebFormsRelyingParty.Members { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - using System.Web.UI; - using System.Web.UI.WebControls; - - public partial class Default : System.Web.UI.Page { - protected void Page_Load(object sender, EventArgs e) { - } - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Members/Default.aspx.designer.cs b/projecttemplates/WebFormsRelyingParty/Members/Default.aspx.designer.cs deleted file mode 100644 index 2daf037..0000000 --- a/projecttemplates/WebFormsRelyingParty/Members/Default.aspx.designer.cs +++ /dev/null @@ -1,16 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace WebFormsRelyingParty.Members { - - - public partial class Default { - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx b/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx deleted file mode 100644 index f316ee5..0000000 --- a/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx +++ /dev/null @@ -1,49 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" Async="true" - CodeBehind="OAuthAuthorize.aspx.cs" Inherits="WebFormsRelyingParty.Members.OAuthAuthorize" %> - -<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="server"> - <h2> - Client authorization - </h2> - <div style="background-color: Yellow"> - <b>Warning</b>: Never give your login credentials to another web site or application. - </div> - <p> - The - <asp:Label ID="consumerNameLabel" runat="server" Text="(app name)" /> - application is requesting to access the private data in your account here. Is that - alright with you? - </p> - <p> - <b>Requested access: </b> - <asp:Label runat="server" ID="scopeLabel" /> - </p> - <p> - If you grant access now, you can revoke it at any time by returning to <a href="AccountInfo.aspx" - target="_blank">your account page</a>. - </p> - <div style="display: none" id="responseButtonsDiv"> - <asp:Button ID="yesButton" runat="server" Text="Yes" OnClick="yesButton_Click" /> - <asp:Button ID="noButton" runat="server" Text="No" OnClick="noButton_Click" /> - <asp:HiddenField runat="server" ID="csrfCheck" EnableViewState="false" /> - </div> - <div id="javascriptDisabled"> - <b>Javascript appears to be disabled in your browser. </b>This page requires Javascript - to be enabled to better protect your security. - </div> - - <script language="javascript" type="text/javascript"> - //<![CDATA[ - // we use HTML to hide the action buttons and Javascript to show them - // to protect against click-jacking in an iframe whose javascript is disabled. - document.getElementById('responseButtonsDiv').style.display = 'block'; - document.getElementById('javascriptDisabled').style.display = 'none'; - - // Frame busting code (to protect us from being hosted in an iframe). - // This protects us from click-jacking. - if (document.location !== window.top.location) { - window.top.location = document.location; - } - //]]> - </script> -</asp:Content> diff --git a/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.cs b/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.cs deleted file mode 100644 index c82b08c..0000000 --- a/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.cs +++ /dev/null @@ -1,102 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="OAuthAuthorize.aspx.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace WebFormsRelyingParty.Members { - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Linq; - using System.Net; - using System.Web; - using System.Web.UI; - using System.Web.UI.WebControls; - using DotNetOpenAuth.Messaging; - using DotNetOpenAuth.OAuth; - using DotNetOpenAuth.OAuth.Messages; - using DotNetOpenAuth.OAuth2; - using DotNetOpenAuth.OAuth2.Messages; - using RelyingPartyLogic; - - public partial class OAuthAuthorize : System.Web.UI.Page { - private EndUserAuthorizationRequest pendingRequest; - - protected void Page_Load(object sender, EventArgs e) { - this.RegisterAsyncTask( - new PageAsyncTask( - async ct => { - if (!IsPostBack) { - this.pendingRequest = - await - OAuthServiceProvider.AuthorizationServer.ReadAuthorizationRequestAsync( - new HttpRequestWrapper(Request), Response.ClientDisconnectedToken); - if (this.pendingRequest == null) { - throw new HttpException((int)HttpStatusCode.BadRequest, "Missing authorization request."); - } - - this.csrfCheck.Value = Code.SiteUtilities.SetCsrfCookie(); - var requestingClient = - Database.DataContext.Clients.First(c => c.ClientIdentifier == this.pendingRequest.ClientIdentifier); - this.consumerNameLabel.Text = HttpUtility.HtmlEncode(requestingClient.Name); - this.scopeLabel.Text = HttpUtility.HtmlEncode(OAuthUtilities.JoinScopes(this.pendingRequest.Scope)); - - // Consider auto-approving if safe to do so. - if ( - ((OAuthAuthorizationServer)OAuthServiceProvider.AuthorizationServer.AuthorizationServerServices) - .CanBeAutoApproved(this.pendingRequest)) { - var response = OAuthServiceProvider.AuthorizationServer.PrepareApproveAuthorizationRequest( - this.pendingRequest, HttpContext.Current.User.Identity.Name); - var responseMessage = - await - OAuthServiceProvider.AuthorizationServer.Channel.PrepareResponseAsync( - response, Response.ClientDisconnectedToken); - await responseMessage.SendAsync(new HttpContextWrapper(this.Context), Response.ClientDisconnectedToken); - this.Context.Response.End(); - } - this.ViewState["AuthRequest"] = this.pendingRequest; - } else { - Code.SiteUtilities.VerifyCsrfCookie(this.csrfCheck.Value); - this.pendingRequest = (EndUserAuthorizationRequest)this.ViewState["AuthRequest"]; - } - })); - } - - protected void yesButton_Click(object sender, EventArgs e) { - this.RegisterAsyncTask( - new PageAsyncTask( - async ct => { - var requestingClient = - Database.DataContext.Clients.First(c => c.ClientIdentifier == this.pendingRequest.ClientIdentifier); - Database.LoggedInUser.ClientAuthorizations.Add( - new ClientAuthorization { - Client = requestingClient, - Scope = OAuthUtilities.JoinScopes(this.pendingRequest.Scope), - User = Database.LoggedInUser, - CreatedOnUtc = DateTime.UtcNow.CutToSecond(), - }); - var response = OAuthServiceProvider.AuthorizationServer.PrepareApproveAuthorizationRequest( - this.pendingRequest, HttpContext.Current.User.Identity.Name); - var responseMessage = - await - OAuthServiceProvider.AuthorizationServer.Channel.PrepareResponseAsync(response, Response.ClientDisconnectedToken); - await responseMessage.SendAsync(new HttpContextWrapper(this.Context), Response.ClientDisconnectedToken); - this.Context.Response.End(); - })); - } - - protected void noButton_Click(object sender, EventArgs e) { - this.RegisterAsyncTask( - new PageAsyncTask( - async ct => { - var response = OAuthServiceProvider.AuthorizationServer.PrepareRejectAuthorizationRequest(this.pendingRequest); - var responseMessage = - await - OAuthServiceProvider.AuthorizationServer.Channel.PrepareResponseAsync(response, Response.ClientDisconnectedToken); - await responseMessage.SendAsync(new HttpContextWrapper(this.Context), Response.ClientDisconnectedToken); - this.Context.Response.End(); - })); - } - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.designer.cs b/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.designer.cs deleted file mode 100644 index d243c81..0000000 --- a/projecttemplates/WebFormsRelyingParty/Members/OAuthAuthorize.aspx.designer.cs +++ /dev/null @@ -1,60 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace WebFormsRelyingParty.Members { - - - public partial class OAuthAuthorize { - - /// <summary> - /// consumerNameLabel control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Label consumerNameLabel; - - /// <summary> - /// scopeLabel control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Label scopeLabel; - - /// <summary> - /// yesButton control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Button yesButton; - - /// <summary> - /// noButton control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Button noButton; - - /// <summary> - /// csrfCheck control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.HiddenField csrfCheck; - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Members/Web.config b/projecttemplates/WebFormsRelyingParty/Members/Web.config deleted file mode 100644 index 4ab44bc..0000000 --- a/projecttemplates/WebFormsRelyingParty/Members/Web.config +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0"?> -<!-- - Note: As an alternative to hand editing this file you can use the - web admin tool to configure settings for your application. Use - the Website->Asp.Net Configuration option in Visual Studio. - A full list of settings and comments can be found in - machine.config.comments usually located in - \Windows\Microsoft.Net\Framework\v2.x\Config ---> -<configuration> - <appSettings/> - <connectionStrings/> - <system.web> - <authorization> - <deny users="?" /> - </authorization> - </system.web> - - <!-- Protect certain user pages from delegated (OAuth) clients. --> - <location path="AccountInfo.aspx"> - <system.web> - <authorization> - <deny roles="oauth_client" /> - </authorization> - </system.web> - </location> -</configuration> diff --git a/projecttemplates/WebFormsRelyingParty/OAuthTokenEndpoint.ashx b/projecttemplates/WebFormsRelyingParty/OAuthTokenEndpoint.ashx deleted file mode 100644 index 3d1cd86..0000000 --- a/projecttemplates/WebFormsRelyingParty/OAuthTokenEndpoint.ashx +++ /dev/null @@ -1 +0,0 @@ -<%@ WebHandler Language="C#" CodeBehind="OAuthTokenEndpoint.ashx.cs" Class="WebFormsRelyingParty.OAuthTokenEndpoint" %> diff --git a/projecttemplates/WebFormsRelyingParty/OAuthTokenEndpoint.ashx.cs b/projecttemplates/WebFormsRelyingParty/OAuthTokenEndpoint.ashx.cs deleted file mode 100644 index 2c84fc6..0000000 --- a/projecttemplates/WebFormsRelyingParty/OAuthTokenEndpoint.ashx.cs +++ /dev/null @@ -1,46 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="OAuthTokenEndpoint.ashx.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace WebFormsRelyingParty { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Threading.Tasks; - using System.Web; - using System.Web.SessionState; - using DotNetOpenAuth.ApplicationBlock; - using DotNetOpenAuth.Messaging; - using DotNetOpenAuth.OAuth2; - using RelyingPartyLogic; - using WebFormsRelyingParty.Code; - - /// <summary> - /// An OAuth 2.0 token endpoint. - /// </summary> - public class OAuthTokenEndpoint : HttpAsyncHandlerBase, IRequiresSessionState { - /// <summary> - /// Initializes a new instance of the <see cref="OAuthTokenEndpoint"/> class. - /// </summary> - public OAuthTokenEndpoint() { - } - - /// <summary> - /// Gets a value indicating whether another request can use the <see cref="T:System.Web.IHttpHandler"/> instance. - /// </summary> - /// <returns> - /// true if the <see cref="T:System.Web.IHttpHandler"/> instance is reusable; otherwise, false. - /// </returns> - public override bool IsReusable { - get { return true; } - } - - protected override async Task ProcessRequestAsync(HttpContext context) { - var serviceProvider = OAuthServiceProvider.AuthorizationServer; - var response = await serviceProvider.HandleTokenRequestAsync(new HttpRequestWrapper(context.Request), context.Response.ClientDisconnectedToken); - await response.SendAsync(new HttpContextWrapper(context), context.Response.ClientDisconnectedToken); - } - } -} diff --git a/projecttemplates/WebFormsRelyingParty/PrivacyPolicy.aspx b/projecttemplates/WebFormsRelyingParty/PrivacyPolicy.aspx deleted file mode 100644 index 82be533..0000000 --- a/projecttemplates/WebFormsRelyingParty/PrivacyPolicy.aspx +++ /dev/null @@ -1,10 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.Master" %> - -<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="Body"> - <h2> - Privacy Policy - </h2> - <p> - Some privacy policy would go here. - </p> -</asp:Content> diff --git a/projecttemplates/WebFormsRelyingParty/Properties/AssemblyInfo.cs b/projecttemplates/WebFormsRelyingParty/Properties/AssemblyInfo.cs deleted file mode 100644 index 1856e41..0000000 --- a/projecttemplates/WebFormsRelyingParty/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,41 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="AssemblyInfo.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("WebFormsRelyingParty")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("WebFormsRelyingParty")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/projecttemplates/WebFormsRelyingParty/Setup.aspx b/projecttemplates/WebFormsRelyingParty/Setup.aspx deleted file mode 100644 index 29d74af..0000000 --- a/projecttemplates/WebFormsRelyingParty/Setup.aspx +++ /dev/null @@ -1,43 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Setup.aspx.cs" Inherits="WebFormsRelyingParty.Setup" %> - -<%@ Register Assembly="DotNetOpenAuth.OpenID.RelyingParty.UI" Namespace="DotNetOpenAuth.OpenId.RelyingParty" - TagPrefix="rp" %> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head runat="server"> - <title>OpenID RP one-time setup</title> -</head> -<body> - <form id="form1" runat="server"> - <h2> - First steps: - </h2> - <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0"> - <asp:View ID="View1" runat="server"> - <p> - Before you can use this site, you must create your SQL database that will store - your user accounts and add an admin account to that database. - Just tell me what OpenID you will use to administer the site. - </p> - <rp:OpenIdLogin runat="server" ButtonText="Create database" ID="openidLogin" - OnLoggingIn="openidLogin_LoggingIn" Stateless="true" - TabIndex="1" LabelText="Administrator's OpenID:" - ButtonToolTip="Clicking this button will create the database and initialize the OpenID you specify as an admin of this web site." - RegisterText="get an OpenID" /> - <asp:Label ID="noOPIdentifierLabel" Visible="false" EnableViewState="false" ForeColor="Red" Font-Bold="true" runat="server" Text="Sorry. To help your admin account remain functional when you push this web site to production, directed identity is disabled on this page. Please use your personal claimed identifier." /> - </asp:View> - <asp:View ID="View2" runat="server"> - <p> - Your database has been successfully initialized. - </p> - <p> - <b>Remember to delete this Setup.aspx page.</b> - </p> - <p> - Visit the <a href="Default.aspx">home page</a>. - </p> - </asp:View> - </asp:MultiView> - </form> -</body> -</html> diff --git a/projecttemplates/WebFormsRelyingParty/Setup.aspx.cs b/projecttemplates/WebFormsRelyingParty/Setup.aspx.cs deleted file mode 100644 index 7aed5d6..0000000 --- a/projecttemplates/WebFormsRelyingParty/Setup.aspx.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace WebFormsRelyingParty { - using System; - using System.Collections.Generic; - using System.Globalization; - using System.IO; - using System.Linq; - using System.Web; - using System.Web.UI; - using System.Web.UI.WebControls; - using DotNetOpenAuth.OpenId; - using DotNetOpenAuth.OpenId.RelyingParty; - using RelyingPartyLogic; - - public partial class Setup : System.Web.UI.Page { - private bool databaseCreated; - - protected void Page_Load(object sender, EventArgs e) { - if (!Page.IsPostBack) { - this.openidLogin.Focus(); - } - } - - protected void openidLogin_LoggingIn(object sender, OpenIdEventArgs e) { - // We don't actually want to log in... we just want the claimed identifier. - e.Cancel = true; - if (e.IsDirectedIdentity) { - this.noOPIdentifierLabel.Visible = true; - } else if (!this.databaseCreated) { - Utilities.CreateDatabase(e.ClaimedIdentifier, this.openidLogin.Text, "WebFormsRelyingParty"); - this.MultiView1.ActiveViewIndex = 1; - - // indicate we have already created the database so that if the - // identifier the user gave has multiple service endpoints, - // we won't try to recreate the database as the next one is considered. - this.databaseCreated = true; - } - } - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Setup.aspx.designer.cs b/projecttemplates/WebFormsRelyingParty/Setup.aspx.designer.cs deleted file mode 100644 index a51ceed..0000000 --- a/projecttemplates/WebFormsRelyingParty/Setup.aspx.designer.cs +++ /dev/null @@ -1,70 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace WebFormsRelyingParty { - - - public partial class Setup { - - /// <summary> - /// form1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// <summary> - /// MultiView1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.MultiView MultiView1; - - /// <summary> - /// View1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.View View1; - - /// <summary> - /// openidLogin control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::DotNetOpenAuth.OpenId.RelyingParty.OpenIdLogin openidLogin; - - /// <summary> - /// noOPIdentifierLabel control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.Label noOPIdentifierLabel; - - /// <summary> - /// View2 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.View View2; - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Site.Master b/projecttemplates/WebFormsRelyingParty/Site.Master deleted file mode 100644 index 6d74076..0000000 --- a/projecttemplates/WebFormsRelyingParty/Site.Master +++ /dev/null @@ -1,60 +0,0 @@ -<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="WebFormsRelyingParty.Site" %> - -<%@ Import Namespace="RelyingPartyLogic" %> -<%@ Import Namespace="System.Linq" %> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head runat="server"> - <title><%=Page.Title %></title> - <link type="text/css" href="theme/ui.all.css" rel="Stylesheet" /> - <link href="styles/Standard.css" rel="stylesheet" type="text/css" /> - <asp:ContentPlaceHolder ID="head" runat="server" /> -</head> -<body> - <form id="form1" runat="server"> - <div style="float: right"> - <asp:LoginView runat="server"> - <LoggedInTemplate> - <% - var authToken = Database.DataContext.AuthenticationTokens.Include("User").First(token => token.ClaimedIdentifier == Page.User.Identity.Name); - if (!string.IsNullOrEmpty(authToken.User.EmailAddress)) { - Response.Write(HttpUtility.HtmlEncode(authToken.User.EmailAddress)); - } else if (!string.IsNullOrEmpty(authToken.User.FirstName)) { - Response.Write(HttpUtility.HtmlEncode(authToken.User.FirstName)); - } else { - Response.Write(HttpUtility.HtmlEncode(authToken.FriendlyIdentifier)); - } - %> - | <asp:HyperLink runat="server" NavigateUrl="~/" Text="Home" /> | <asp:HyperLink - runat="server" NavigateUrl="~/Members/AccountInfo.aspx" Text="Account" /> | - <asp:LoginStatus ID="LoginStatus1" runat="server" /> - </LoggedInTemplate> - <AnonymousTemplate> - <% if (Page.Request.Path != FormsAuthentication.LoginUrl) {%> - <a href="#" class="loginPopupLink">Login / Register</a> - <% } %> - </AnonymousTemplate> - </asp:LoginView> - </div> - <div> - <h1><asp:HyperLink runat="server" NavigateUrl="~/" Text="Adventure Works" /></h1> - <asp:ContentPlaceHolder ID="Body" runat="server"/> - </div> - </form> - -<% if (!this.Page.User.Identity.IsAuthenticated) { %> - <% if (Request.Url.IsLoopback) { %> - <script type="text/javascript" src="scripts/jquery-1.3.1.js"></script> - <script type="text/javascript" src="scripts/jquery-ui-personalized-1.6rc6.js"></script> - <% } else { %> - <script type="text/javascript" language="javascript" src="http://www.google.com/jsapi"></script> - <script type="text/javascript" language="javascript"> - google.load("jquery", "1.3.2"); - google.load("jqueryui", "1.7.2"); - </script> - <% } %> - - <script type="text/javascript" language="javascript" src="scripts/LoginLink.js"></script> -<% } %> -</body> -</html> diff --git a/projecttemplates/WebFormsRelyingParty/Site.Master.cs b/projecttemplates/WebFormsRelyingParty/Site.Master.cs deleted file mode 100644 index 36483d9..0000000 --- a/projecttemplates/WebFormsRelyingParty/Site.Master.cs +++ /dev/null @@ -1,19 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="Site.Master.cs" company="Outercurve Foundation"> -// Copyright (c) Outercurve Foundation. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace WebFormsRelyingParty { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Web; - using System.Web.UI; - using System.Web.UI.WebControls; - - public partial class Site : System.Web.UI.MasterPage { - protected void Page_Load(object sender, EventArgs e) { - } - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Site.Master.designer.cs b/projecttemplates/WebFormsRelyingParty/Site.Master.designer.cs deleted file mode 100644 index f6d2225..0000000 --- a/projecttemplates/WebFormsRelyingParty/Site.Master.designer.cs +++ /dev/null @@ -1,43 +0,0 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace WebFormsRelyingParty { - - - public partial class Site { - - /// <summary> - /// head control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.ContentPlaceHolder head; - - /// <summary> - /// form1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// <summary> - /// Body control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::System.Web.UI.WebControls.ContentPlaceHolder Body; - } -} diff --git a/projecttemplates/WebFormsRelyingParty/Web.config b/projecttemplates/WebFormsRelyingParty/Web.config deleted file mode 100644 index 4def867..0000000 --- a/projecttemplates/WebFormsRelyingParty/Web.config +++ /dev/null @@ -1,220 +0,0 @@ -<?xml version="1.0"?> -<!-- - Note: As an alternative to hand editing this file you can use the - web admin tool to configure settings for your application. Use - the Website->Asp.Net Configuration option in Visual Studio. - A full list of settings and comments can be found in - machine.config.comments usually located in - \Windows\Microsoft.Net\Framework\v2.x\Config ---> -<configuration> - <configSections> - <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler" requirePermission="false" /> - <sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth.Core"> - <section name="openid" type="DotNetOpenAuth.Configuration.OpenIdElement, DotNetOpenAuth.OpenId" requirePermission="false" allowLocation="true" /> - <section name="oauth" type="DotNetOpenAuth.Configuration.OAuthElement, DotNetOpenAuth.OAuth" requirePermission="false" allowLocation="true" /> - <section name="messaging" type="DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" /> - <section name="reporting" type="DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" /> - </sectionGroup> - </configSections> - - <!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names), - which is necessary for OpenID urls with unicode characters in the domain/host name. - It is also required to put the Uri class into RFC 3986 escaping mode, which OpenID and OAuth require. --> - <uri> - <idn enabled="All" /> - <iriParsing enabled="true" /> - </uri> - - <system.net> - <defaultProxy enabled="true" /> - <settings> - <!-- This setting causes .NET to check certificate revocation lists (CRL) - before trusting HTTPS certificates. But this setting tends to not - be allowed in shared hosting environments. --> - <servicePointManager checkCertificateRevocationList="true" /> - </settings> - </system.net> - - <!-- this is an optional configuration section where aspects of dotnetopenauth can be customized --> - <dotNetOpenAuth> - <messaging> - <untrustedWebRequest> - <whitelistHosts> - <!--<add name="localhost" />--> - </whitelistHosts> - </untrustedWebRequest> - </messaging> - <openid> - <relyingParty> - <security requireSsl="false"> - <!-- Uncomment the trustedProviders tag if your relying party should only accept positive assertions from a closed set of OpenID Providers. --> - <!--<trustedProviders rejectAssertionsFromUntrustedProviders="true"> - <add endpoint="https://www.google.com/accounts/o8/ud" /> - </trustedProviders>--> - </security> - <behaviors> - <!-- The following OPTIONAL behavior allows RPs to use SREG only, but be compatible - with OPs that use Attribute Exchange (in various formats). --> - <add type="DotNetOpenAuth.OpenId.RelyingParty.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth.OpenId.RelyingParty" /> - </behaviors> - <store type="RelyingPartyLogic.RelyingPartyApplicationDbStore, RelyingPartyLogic"/> - </relyingParty> - </openid> - <oauth> - <serviceProvider> - <store type="RelyingPartyLogic.NonceDbStore, RelyingPartyLogic"/> - </serviceProvider> - </oauth> - <!-- Allow DotNetOpenAuth to publish usage statistics to library authors to improve the library. --> - <reporting enabled="true" /> - </dotNetOpenAuth> - - <!-- log4net is a 3rd party (free) logger library that DotNetOpenAuth will use if present but does not require. --> - <log4net> - <appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender"> - <bufferSize value="100" /> - <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> - <connectionString value="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\WebFormsRelyingParty.mdf;Integrated Security=True;User Instance=True" /> - <commandText value="INSERT INTO [Log] ([Date],[Thread],[Level],[Logger],[Message],[Exception]) VALUES (@log_date, @thread, @log_level, @logger, @message, @exception)" /> - <parameter> - <parameterName value="@log_date" /> - <dbType value="DateTime" /> - <layout type="log4net.Layout.RawTimeStampLayout" /> - </parameter> - <parameter> - <parameterName value="@thread" /> - <dbType value="String" /> - <size value="255" /> - <layout type="log4net.Layout.PatternLayout"> - <conversionPattern value="%thread" /> - </layout> - </parameter> - <parameter> - <parameterName value="@log_level" /> - <dbType value="String" /> - <size value="50" /> - <layout type="log4net.Layout.PatternLayout"> - <conversionPattern value="%level" /> - </layout> - </parameter> - <parameter> - <parameterName value="@logger" /> - <dbType value="String" /> - <size value="255" /> - <layout type="log4net.Layout.PatternLayout"> - <conversionPattern value="%logger" /> - </layout> - </parameter> - <parameter> - <parameterName value="@message" /> - <dbType value="String" /> - <size value="4000" /> - <layout type="log4net.Layout.PatternLayout"> - <conversionPattern value="%message" /> - </layout> - </parameter> - <parameter> - <parameterName value="@exception" /> - <dbType value="String" /> - <size value="2000" /> - <layout type="log4net.Layout.ExceptionLayout" /> - </parameter> - </appender> - <!-- Setup the root category, add the appenders and set the default level --> - <root> - <level value="WARN" /> - <appender-ref ref="AdoNetAppender" /> - </root> - <!-- Specify the level for some specific categories --> - <logger name="DotNetOpenAuth"> - <level value="WARN" /> - </logger> - <logger name="DotNetOpenAuth.OpenId"> - <level value="INFO" /> - </logger> - <logger name="DotNetOpenAuth.OAuth"> - <level value="INFO" /> - </logger> - </log4net> - <appSettings> - <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" /> - </appSettings> - <connectionStrings> - <!-- Remember to keep this connection string in sync with the one (if any) that appears in the log4net section. --> - <add name="DatabaseEntities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\WebFormsRelyingParty.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" /> - </connectionStrings> - <system.web> - <httpRuntime targetFramework="4.5" /> - <!-- - Set compilation debug="true" to insert debugging - symbols into the compiled page. Because this - affects performance, set this value to true only - during development. - --> - <compilation debug="true" targetFramework="4.0"> - <assemblies> - <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> - <add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> - </assemblies> - </compilation> - <!-- - The <authentication> section enables configuration - of the security authentication mode used by - ASP.NET to identify an incoming user. - --> - <authentication mode="Forms"> - <forms loginUrl="~/login.aspx" name="WebFormsRelyingParty" /> - </authentication> - <!-- - The <customErrors> section enables configuration - of what to do if/when an unhandled error occurs - during the execution of a request. Specifically, - it enables developers to configure html error pages - to be displayed in place of a error stack trace. - --> - <customErrors mode="RemoteOnly"/> - <httpModules> - <add name="OAuthAuthenticationModule" type="RelyingPartyLogic.OAuthAuthenticationModule, RelyingPartyLogic" /> - <add name="Database" type="RelyingPartyLogic.Database, RelyingPartyLogic"/> - </httpModules> - <roleManager enabled="true" defaultProvider="Database"> - <providers> - <add name="Database" type="RelyingPartyLogic.DataRoleProvider, RelyingPartyLogic" /> - </providers> - </roleManager> - <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/> - </system.web> - <!-- - The system.webServer section is required for running ASP.NET AJAX under Internet - Information Services 7.0. It is not necessary for previous version of IIS. - --> - <system.webServer> - <modules runAllManagedModulesForAllRequests="true"> - <add name="OAuthAuthenticationModule" type="RelyingPartyLogic.OAuthAuthenticationModule, RelyingPartyLogic"/> - <add name="Database" type="RelyingPartyLogic.Database, RelyingPartyLogic"/> - </modules> - </system.webServer> - <system.serviceModel> - <behaviors> - <serviceBehaviors> - <behavior name="DataApiBehavior"> - <serviceMetadata httpGetEnabled="true" /> - <serviceDebug includeExceptionDetailInFaults="true" /> - <serviceAuthorization serviceAuthorizationManagerType="OAuthAuthorizationManager, __code" principalPermissionMode="Custom" /> - </behavior> - </serviceBehaviors> - </behaviors> - <services> - <!--<service behaviorConfiguration="DataApiBehavior" name="DataApi"> - </service>--> - </services> - </system.serviceModel> - <location path="default.aspx"> - <system.web> - <authorization> - <allow users="*" /> - </authorization> - </system.web> - </location> -</configuration> diff --git a/projecttemplates/WebFormsRelyingParty/WebFormsRelyingParty.csproj b/projecttemplates/WebFormsRelyingParty/WebFormsRelyingParty.csproj deleted file mode 100644 index 11384e2..0000000 --- a/projecttemplates/WebFormsRelyingParty/WebFormsRelyingParty.csproj +++ /dev/null @@ -1,354 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))' != '' " /> - <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> - <PropertyGroup> - <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> - <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> - <IISExpressSSLPort /> - <IISExpressAnonymousAuthentication /> - <IISExpressWindowsAuthentication /> - <IISExpressUseClassicPipelineMode /> - <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\src\</SolutionDir> - </PropertyGroup> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>9.0.30729</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{A78F8FC6-7B03-4230-BE41-761E400D6810}</ProjectGuid> - <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>WebFormsRelyingParty</RootNamespace> - <AssemblyName>WebFormsRelyingParty</AssemblyName> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> - <FileUpgradeFlags> - </FileUpgradeFlags> - <OldToolsVersion>4.0</OldToolsVersion> - <TargetFrameworkProfile /> - <UseIISExpress>false</UseIISExpress> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> - </PropertyGroup> - <ItemGroup> - <Reference Include="log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\src\packages\log4net.2.0.0\lib\net40-full\log4net.dll</HintPath> - </Reference> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Data.DataSetExtensions" /> - <Reference Include="System.Data.Entity"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - </Reference> - <Reference Include="System.Data.Linq"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - </Reference> - <Reference Include="System.IdentityModel"> - <RequiredTargetFramework>3.0</RequiredTargetFramework> - </Reference> - <Reference Include="System.Net.Http" /> - <Reference Include="System.Net.Http.WebRequest" /> - <Reference Include="System.Runtime.Serialization"> - <RequiredTargetFramework>3.0</RequiredTargetFramework> - </Reference> - <Reference Include="System.Security" /> - <Reference Include="System.ServiceModel"> - <RequiredTargetFramework>3.0</RequiredTargetFramework> - </Reference> - <Reference Include="System.Web.Abstractions" /> - <Reference Include="System.Web.ApplicationServices" /> - <Reference Include="System.Web.DynamicData" /> - <Reference Include="System.Web.Entity"> - <RequiredTargetFramework>3.5</RequiredTargetFramework> - </Reference> - <Reference Include="System.Drawing" /> - <Reference Include="System.Web" /> - <Reference Include="System.Web.Extensions" /> - <Reference Include="System.Xml" /> - <Reference Include="System.Configuration" /> - <Reference Include="System.Web.Services" /> - <Reference Include="System.EnterpriseServices" /> - <Reference Include="System.Web.Mobile" /> - <Reference Include="System.Xml.Linq" /> - </ItemGroup> - <ItemGroup> - <Content Include="images\openid.png" /> - <Content Include="images\openid_login.png" /> - <Content Include="Members\AccountInfo.aspx" /> - <Content Include="Default.aspx" /> - <Content Include="Login.aspx" /> - <Content Include="Web.config" /> - </ItemGroup> - <ItemGroup> - <Compile Include="Code\SiteUtilities.cs" /> - <Compile Include="Members\OAuthAuthorize.aspx.cs"> - <DependentUpon>OAuthAuthorize.aspx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="Members\OAuthAuthorize.aspx.designer.cs"> - <DependentUpon>OAuthAuthorize.aspx</DependentUpon> - </Compile> - <Compile Include="LoginFrame.aspx.cs"> - <DependentUpon>LoginFrame.aspx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="LoginFrame.aspx.designer.cs"> - <DependentUpon>LoginFrame.aspx</DependentUpon> - </Compile> - <Compile Include="Members\AccountInfo.aspx.cs"> - <DependentUpon>AccountInfo.aspx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="Members\AccountInfo.aspx.designer.cs"> - <DependentUpon>AccountInfo.aspx</DependentUpon> - </Compile> - <Compile Include="Admin\Admin.Master.cs"> - <DependentUpon>Admin.Master</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="Admin\Admin.Master.designer.cs"> - <DependentUpon>Admin.Master</DependentUpon> - </Compile> - <Compile Include="Admin\Default.aspx.cs"> - <DependentUpon>Default.aspx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="Admin\Default.aspx.designer.cs"> - <DependentUpon>Default.aspx</DependentUpon> - </Compile> - <Compile Include="Default.aspx.cs"> - <DependentUpon>Default.aspx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="Default.aspx.designer.cs"> - <DependentUpon>Default.aspx</DependentUpon> - </Compile> - <Compile Include="Global.asax.cs"> - <DependentUpon>Global.asax</DependentUpon> - </Compile> - <Compile Include="Login.aspx.cs"> - <DependentUpon>Login.aspx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="Login.aspx.designer.cs"> - <DependentUpon>Login.aspx</DependentUpon> - </Compile> - <Compile Include="Logout.aspx.cs"> - <DependentUpon>Logout.aspx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="Logout.aspx.designer.cs"> - <DependentUpon>Logout.aspx</DependentUpon> - </Compile> - <Compile Include="Members\Default.aspx.cs"> - <DependentUpon>Default.aspx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="Members\Default.aspx.designer.cs"> - <DependentUpon>Default.aspx</DependentUpon> - </Compile> - <Compile Include="OAuthTokenEndpoint.ashx.cs"> - <DependentUpon>OAuthTokenEndpoint.ashx</DependentUpon> - </Compile> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="Setup.aspx.cs"> - <DependentUpon>Setup.aspx</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="Setup.aspx.designer.cs"> - <DependentUpon>Setup.aspx</DependentUpon> - </Compile> - <Compile Include="Site.Master.cs"> - <DependentUpon>Site.Master</DependentUpon> - <SubType>ASPXCodeBehind</SubType> - </Compile> - <Compile Include="Site.Master.designer.cs"> - <DependentUpon>Site.Master</DependentUpon> - </Compile> - </ItemGroup> - <ItemGroup> - <Service Include="{3259AA49-8AA1-44D3-9025-A0B520596A8C}" /> - </ItemGroup> - <ItemGroup> - <Content Include="Admin\Default.aspx" /> - <Content Include="Admin\Web.config" /> - <Content Include="Global.asax" /> - <Content Include="Site.Master" /> - </ItemGroup> - <ItemGroup> - <Content Include="Admin\Admin.Master" /> - <Content Include="images\google.gif" /> - <Content Include="images\yahoo.gif" /> - <Content Include="styles\Standard.css" /> - </ItemGroup> - <ItemGroup> - <Content Include="Getting Started.htm" /> - <Content Include="images\infocard_23x16.png" /> - <Content Include="images\myopenid.png" /> - <Content Include="images\yahoo_login.png" /> - <Content Include="LoginFrame.aspx" /> - <Content Include="Logout.aspx" /> - <Content Include="Members\Default.aspx" /> - <Content Include="Members\Web.config" /> - <Content Include="scripts\jquery-1.3.1.js" /> - <Content Include="scripts\jquery-ui-personalized-1.6rc6.js" /> - <Content Include="scripts\jquery-ui-personalized-1.6rc6.min.js" /> - <Content Include="scripts\jquery.cookie.js" /> - <Content Include="scripts\LoginLink.js" /> - <Content Include="Setup.aspx" /> - <Content Include="styles\loginpopup.css" /> - <Content Include="theme\images\ui-bg_flat_55_999999_40x100.png" /> - <Content Include="theme\images\ui-bg_flat_75_aaaaaa_40x100.png" /> - <Content Include="theme\images\ui-bg_glass_45_0078ae_1x400.png" /> - <Content Include="theme\images\ui-bg_glass_55_f8da4e_1x400.png" /> - <Content Include="theme\images\ui-bg_glass_75_79c9ec_1x400.png" /> - <Content Include="theme\images\ui-bg_gloss-wave_45_e14f1c_500x100.png" /> - <Content Include="theme\images\ui-bg_gloss-wave_50_6eac2c_500x100.png" /> - <Content Include="theme\images\ui-bg_gloss-wave_75_2191c0_500x100.png" /> - <Content Include="theme\images\ui-bg_inset-hard_100_fcfdfd_1x100.png" /> - <Content Include="theme\images\ui-icons_0078ae_256x240.png" /> - <Content Include="theme\images\ui-icons_056b93_256x240.png" /> - <Content Include="theme\images\ui-icons_d8e7f3_256x240.png" /> - <Content Include="theme\images\ui-icons_e0fdff_256x240.png" /> - <Content Include="theme\images\ui-icons_f5e175_256x240.png" /> - <Content Include="theme\images\ui-icons_f7a50d_256x240.png" /> - <Content Include="theme\images\ui-icons_fcd113_256x240.png" /> - <Content Include="theme\ui.accordion.css" /> - <Content Include="theme\ui.all.css" /> - <Content Include="theme\ui.base.css" /> - <Content Include="theme\ui.core.css" /> - <Content Include="theme\ui.datepicker.css" /> - <Content Include="theme\ui.dialog.css" /> - <Content Include="theme\ui.progressbar.css" /> - <Content Include="theme\ui.resizable.css" /> - <Content Include="theme\ui.slider.css" /> - <Content Include="theme\ui.tabs.css" /> - <Content Include="theme\ui.theme.css" /> - <Content Include="xrds.aspx" /> - </ItemGroup> - <ItemGroup> - <Content Include="images\verisign.gif" /> - <Content Include="Members\OAuthAuthorize.aspx" /> - <Content Include="OAuthTokenEndpoint.ashx" /> - <Content Include="PrivacyPolicy.aspx" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\..\samples\DotNetOpenAuth.ApplicationBlock\DotNetOpenAuth.ApplicationBlock.csproj"> - <Project>{aa78d112-d889-414b-a7d4-467b34c7b663}</Project> - <Name>DotNetOpenAuth.ApplicationBlock</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.InfoCard.UI\DotNetOpenAuth.InfoCard.UI.csproj"> - <Project>{E040EB58-B4D2-457B-A023-AE6EF3BD34DE}</Project> - <Name>DotNetOpenAuth.InfoCard.UI</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.InfoCard\DotNetOpenAuth.InfoCard.csproj"> - <Project>{408D10B8-34BA-4CBD-B7AA-FEB1907ABA4C}</Project> - <Name>DotNetOpenAuth.InfoCard</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.Core.UI\DotNetOpenAuth.Core.UI.csproj"> - <Project>{173E7B8D-E751-46E2-A133-F72297C0D2F4}</Project> - <Name>DotNetOpenAuth.Core.UI</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.Core\DotNetOpenAuth.Core.csproj"> - <Project>{60426312-6AE5-4835-8667-37EDEA670222}</Project> - <Name>DotNetOpenAuth.Core</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth2.AuthorizationServer\DotNetOpenAuth.OAuth2.AuthorizationServer.csproj"> - <Project>{99BB7543-EA16-43EE-A7BC-D7A25A3B22F6}</Project> - <Name>DotNetOpenAuth.OAuth2.AuthorizationServer</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth2.ClientAuthorization\DotNetOpenAuth.OAuth2.ClientAuthorization.csproj"> - <Project>{CCF3728A-B3D7-404A-9BC6-75197135F2D7}</Project> - <Name>DotNetOpenAuth.OAuth2.ClientAuthorization</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth2\DotNetOpenAuth.OAuth2.csproj"> - <Project>{56459A6C-6BA2-4BAC-A9C0-27E3BD961FA6}</Project> - <Name>DotNetOpenAuth.OAuth2</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OAuth\DotNetOpenAuth.OAuth.csproj"> - <Project>{A288FCC8-6FCF-46DA-A45E-5F9281556361}</Project> - <Name>DotNetOpenAuth.OAuth</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OpenId.RelyingParty.UI\DotNetOpenAuth.OpenId.RelyingParty.UI.csproj"> - <Project>{1ED8D424-F8AB-4050-ACEB-F27F4F909484}</Project> - <Name>DotNetOpenAuth.OpenId.RelyingParty.UI</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OpenId.RelyingParty\DotNetOpenAuth.OpenId.RelyingParty.csproj"> - <Project>{F458AB60-BA1C-43D9-8CEF-EC01B50BE87B}</Project> - <Name>DotNetOpenAuth.OpenId.RelyingParty</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OpenId.UI\DotNetOpenAuth.OpenId.UI.csproj"> - <Project>{75E13AAE-7D51-4421-ABFD-3F3DC91F576E}</Project> - <Name>DotNetOpenAuth.OpenId.UI</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OpenIdInfoCard.UI\DotNetOpenAuth.OpenIdInfoCard.UI.csproj"> - <Project>{3A8347E8-59A5-4092-8842-95C75D7D2F36}</Project> - <Name>DotNetOpenAuth.OpenIdInfoCard.UI</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\DotNetOpenAuth.OpenId\DotNetOpenAuth.OpenId.csproj"> - <Project>{3896A32A-E876-4C23-B9B8-78E17D134CD3}</Project> - <Name>DotNetOpenAuth.OpenId</Name> - </ProjectReference> - <ProjectReference Include="..\RelyingPartyLogic\RelyingPartyLogic.csproj"> - <Project>{17932639-1F50-48AF-B0A5-E2BF832F82CC}</Project> - <Name>RelyingPartyLogic</Name> - </ProjectReference> - </ItemGroup> - <ItemGroup> - <Folder Include="App_Data\" /> - <Folder Include="bin\" /> - </ItemGroup> - <ItemGroup> - <Content Include="packages.config" /> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> - <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /> - <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> - <ProjectExtensions> - <VisualStudio> - <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> - <WebProjectProperties> - <UseIIS>False</UseIIS> - <AutoAssignPort>True</AutoAssignPort> - <DevelopmentServerPort>54189</DevelopmentServerPort> - <DevelopmentServerVPath>/</DevelopmentServerVPath> - <IISUrl> - </IISUrl> - <NTLMAuthentication>False</NTLMAuthentication> - <UseCustomServer>False</UseCustomServer> - <CustomServerUrl> - </CustomServerUrl> - <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> - </WebProjectProperties> - </FlavorProperties> - </VisualStudio> - </ProjectExtensions> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " /> - <Import Project="$(SolutionDir)\.nuget\nuget.targets" /> -</Project>
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/WebFormsRelyingParty.vstemplate b/projecttemplates/WebFormsRelyingParty/WebFormsRelyingParty.vstemplate deleted file mode 100644 index 567e3a1..0000000 --- a/projecttemplates/WebFormsRelyingParty/WebFormsRelyingParty.vstemplate +++ /dev/null @@ -1,13 +0,0 @@ -<VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project"> - <TemplateData> - <Name>ASP.NET OpenID-InfoCard RP</Name> - <Description>An ASP.NET web forms web site that accepts OpenID and InfoCard logins and acts as an OAuth service provider.</Description> - <ProjectType>CSharp</ProjectType> - <Icon>__TemplateIcon.ico</Icon> - </TemplateData> - <TemplateContent> - <Project File="WebFormsRelyingParty.csproj" ReplaceParameters="true"> - <ProjectItem OpenInWebBrowser="true">Getting Started.htm</ProjectItem> - </Project> - </TemplateContent> -</VSTemplate>
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/images/google.gif b/projecttemplates/WebFormsRelyingParty/images/google.gif Binary files differdeleted file mode 100644 index 1b6cd07..0000000 --- a/projecttemplates/WebFormsRelyingParty/images/google.gif +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/images/infocard_23x16.png b/projecttemplates/WebFormsRelyingParty/images/infocard_23x16.png Binary files differdeleted file mode 100644 index 9dbea9f..0000000 --- a/projecttemplates/WebFormsRelyingParty/images/infocard_23x16.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/images/myopenid.png b/projecttemplates/WebFormsRelyingParty/images/myopenid.png Binary files differdeleted file mode 100644 index 204caae..0000000 --- a/projecttemplates/WebFormsRelyingParty/images/myopenid.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/images/openid.png b/projecttemplates/WebFormsRelyingParty/images/openid.png Binary files differdeleted file mode 100644 index bf25c16..0000000 --- a/projecttemplates/WebFormsRelyingParty/images/openid.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/images/openid_login.png b/projecttemplates/WebFormsRelyingParty/images/openid_login.png Binary files differdeleted file mode 100644 index caebd58..0000000 --- a/projecttemplates/WebFormsRelyingParty/images/openid_login.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/images/verisign.gif b/projecttemplates/WebFormsRelyingParty/images/verisign.gif Binary files differdeleted file mode 100644 index faa6aaa..0000000 --- a/projecttemplates/WebFormsRelyingParty/images/verisign.gif +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/images/yahoo.gif b/projecttemplates/WebFormsRelyingParty/images/yahoo.gif Binary files differdeleted file mode 100644 index 42adbfa..0000000 --- a/projecttemplates/WebFormsRelyingParty/images/yahoo.gif +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/images/yahoo_login.png b/projecttemplates/WebFormsRelyingParty/images/yahoo_login.png Binary files differdeleted file mode 100644 index 476fa64..0000000 --- a/projecttemplates/WebFormsRelyingParty/images/yahoo_login.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/packages.config b/projecttemplates/WebFormsRelyingParty/packages.config deleted file mode 100644 index 8e40260..0000000 --- a/projecttemplates/WebFormsRelyingParty/packages.config +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<packages> - <package id="log4net" version="2.0.0" targetFramework="net45" /> - <package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" /> -</packages>
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/scripts/LoginLink.js b/projecttemplates/WebFormsRelyingParty/scripts/LoginLink.js deleted file mode 100644 index 1e47965..0000000 --- a/projecttemplates/WebFormsRelyingParty/scripts/LoginLink.js +++ /dev/null @@ -1,61 +0,0 @@ -$(function() { - var loginContent = 'LoginFrame.aspx'; - var popupWindowName = 'openidlogin'; - var popupWidth = 365; - var popupHeight = 273; // use 205 for 1 row of OP buttons, or 273 for 2 rows - var iframe; - - { - var div = window.document.createElement('div'); - div.style.padding = 0; - div.id = 'loginDialog'; - - iframe = window.document.createElement('iframe'); - iframe.src = "about:blank"; // don't set the actual page yet, since FireFox & Chrome will refresh it when the iframe is moved in the DOM anyway. - iframe.frameBorder = 0; - iframe.width = popupWidth; - iframe.height = popupHeight; - div.appendChild(iframe); - - window.document.body.appendChild(div); - } - - $(document).ready(function() { - $("#loginDialog").dialog({ - bgiframe: true, - modal: true, - title: 'Login or register', - resizable: false, - hide: 'clip', - width: popupWidth, - height: popupHeight + 50, - buttons: {}, - closeOnEscape: true, - autoOpen: false, - close: function(event, ui) { - // Clear the URL so Chrome/Firefox don't refresh the iframe when it's hidden. - iframe.src = "about:blank"; - }, - open: function(event, ui) { - iframe.src = loginContent; - }, - focus: function(event, ui) { - // var box = $('#openid_identifier')[0]; - // if (box.style.display != 'none') { - // box.focus(); - // } - } - }); - - $('.loginPopupLink').click(function() { - $("#loginDialog").dialog('open'); - }); - $('.loginWindowLink').click(function() { - if (window.showModalDialog) { - window.showModalDialog(loginContent, popupWindowName, 'status:0;resizable:1;scroll:1;center:1;dialogHeight:' + popupHeight + 'px;dialogWidth:' + popupWidth + 'px'); - } else { - window.open(loginContent, popupWindowName, 'modal=yes,status=0,location=1,toolbar=0,menubar=0,resizable=0,scrollbars=0,height=' + popupHeight + 'px,width=' + popupWidth + 'px'); - } - }); - }); -}); diff --git a/projecttemplates/WebFormsRelyingParty/scripts/jquery-1.3.1.js b/projecttemplates/WebFormsRelyingParty/scripts/jquery-1.3.1.js deleted file mode 100644 index 3a4badd..0000000 --- a/projecttemplates/WebFormsRelyingParty/scripts/jquery-1.3.1.js +++ /dev/null @@ -1,4241 +0,0 @@ -/*! - * jQuery JavaScript Library v1.3.1 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009) - * Revision: 6158 - */ -(function(){ - -var - // Will speed up references to window, and allows munging its name. - window = this, - // Will speed up references to undefined, and allows munging its name. - undefined, - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - // Map over the $ in case of overwrite - _$ = window.$, - - jQuery = window.jQuery = window.$ = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context ); - }, - - // A simple way to check for HTML strings or ID strings - // (both of which we optimize for) - quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, - // Is it a simple selector - isSimple = /^.[^:#\[\.,]*$/; - -jQuery.fn = jQuery.prototype = { - init: function( selector, context ) { - // Make sure that a selection was provided - selector = selector || document; - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this[0] = selector; - this.length = 1; - this.context = selector; - return this; - } - // Handle HTML strings - if ( typeof selector === "string" ) { - // Are we dealing with HTML string or an ID? - var match = quickExpr.exec( selector ); - - // Verify a match, and that no context was specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) - selector = jQuery.clean( [ match[1] ], context ); - - // HANDLE: $("#id") - else { - var elem = document.getElementById( match[3] ); - - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem && elem.id != match[3] ) - return jQuery().find( selector ); - - // Otherwise, we inject the element directly into the jQuery object - var ret = jQuery( elem || [] ); - ret.context = document; - ret.selector = selector; - return ret; - } - - // HANDLE: $(expr, [context]) - // (which is just equivalent to: $(content).find(expr) - } else - return jQuery( context ).find( selector ); - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) - return jQuery( document ).ready( selector ); - - // Make sure that old selector state is passed along - if ( selector.selector && selector.context ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return this.setArray(jQuery.makeArray(selector)); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.3.1", - - // The number of elements contained in the matched element set - size: function() { - return this.length; - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num === undefined ? - - // Return a 'clean' array - jQuery.makeArray( this ) : - - // Return just the object - this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - // Build a new jQuery matched element set - var ret = jQuery( elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) - ret.selector = this.selector + (this.selector ? " " : "") + selector; - else if ( name ) - ret.selector = this.selector + "." + name + "(" + selector + ")"; - - // Return the newly-formed element set - return ret; - }, - - // Force the current matched set of elements to become - // the specified array of elements (destroying the stack in the process) - // You should use pushStack() in order to do this, but maintain the stack - setArray: function( elems ) { - // Resetting the length to 0, then using the native Array push - // is a super-fast way to populate an object with array-like properties - this.length = 0; - Array.prototype.push.apply( this, elems ); - - return this; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem && elem.jquery ? elem[0] : elem - , this ); - }, - - attr: function( name, value, type ) { - var options = name; - - // Look for the case where we're accessing a style value - if ( typeof name === "string" ) - if ( value === undefined ) - return this[0] && jQuery[ type || "attr" ]( this[0], name ); - - else { - options = {}; - options[ name ] = value; - } - - // Check to see if we're setting style values - return this.each(function(i){ - // Set all the styles - for ( name in options ) - jQuery.attr( - type ? - this.style : - this, - name, jQuery.prop( this, options[ name ], type, i, name ) - ); - }); - }, - - css: function( key, value ) { - // ignore negative width and height values - if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) - value = undefined; - return this.attr( key, value, "curCSS" ); - }, - - text: function( text ) { - if ( typeof text !== "object" && text != null ) - return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); - - var ret = ""; - - jQuery.each( text || this, function(){ - jQuery.each( this.childNodes, function(){ - if ( this.nodeType != 8 ) - ret += this.nodeType != 1 ? - this.nodeValue : - jQuery.fn.text( [ this ] ); - }); - }); - - return ret; - }, - - wrapAll: function( html ) { - if ( this[0] ) { - // The elements to wrap the target around - var wrap = jQuery( html, this[0].ownerDocument ).clone(); - - if ( this[0].parentNode ) - wrap.insertBefore( this[0] ); - - wrap.map(function(){ - var elem = this; - - while ( elem.firstChild ) - elem = elem.firstChild; - - return elem; - }).append(this); - } - - return this; - }, - - wrapInner: function( html ) { - return this.each(function(){ - jQuery( this ).contents().wrapAll( html ); - }); - }, - - wrap: function( html ) { - return this.each(function(){ - jQuery( this ).wrapAll( html ); - }); - }, - - append: function() { - return this.domManip(arguments, true, function(elem){ - if (this.nodeType == 1) - this.appendChild( elem ); - }); - }, - - prepend: function() { - return this.domManip(arguments, true, function(elem){ - if (this.nodeType == 1) - this.insertBefore( elem, this.firstChild ); - }); - }, - - before: function() { - return this.domManip(arguments, false, function(elem){ - this.parentNode.insertBefore( elem, this ); - }); - }, - - after: function() { - return this.domManip(arguments, false, function(elem){ - this.parentNode.insertBefore( elem, this.nextSibling ); - }); - }, - - end: function() { - return this.prevObject || jQuery( [] ); - }, - - // For internal use only. - // Behaves like an Array's .push method, not like a jQuery method. - push: [].push, - - find: function( selector ) { - if ( this.length === 1 && !/,/.test(selector) ) { - var ret = this.pushStack( [], "find", selector ); - ret.length = 0; - jQuery.find( selector, this[0], ret ); - return ret; - } else { - var elems = jQuery.map(this, function(elem){ - return jQuery.find( selector, elem ); - }); - - return this.pushStack( /[^+>] [^+>]/.test( selector ) ? - jQuery.unique( elems ) : - elems, "find", selector ); - } - }, - - clone: function( events ) { - // Do the clone - var ret = this.map(function(){ - if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) { - // IE copies events bound via attachEvent when - // using cloneNode. Calling detachEvent on the - // clone will also remove the events from the orignal - // In order to get around this, we use innerHTML. - // Unfortunately, this means some modifications to - // attributes in IE that are actually only stored - // as properties will not be copied (such as the - // the name attribute on an input). - var clone = this.cloneNode(true), - container = document.createElement("div"); - container.appendChild(clone); - return jQuery.clean([container.innerHTML])[0]; - } else - return this.cloneNode(true); - }); - - // Need to set the expando to null on the cloned set if it exists - // removeData doesn't work here, IE removes it from the original as well - // this is primarily for IE but the data expando shouldn't be copied over in any browser - var clone = ret.find("*").andSelf().each(function(){ - if ( this[ expando ] !== undefined ) - this[ expando ] = null; - }); - - // Copy the events from the original to the clone - if ( events === true ) - this.find("*").andSelf().each(function(i){ - if (this.nodeType == 3) - return; - var events = jQuery.data( this, "events" ); - - for ( var type in events ) - for ( var handler in events[ type ] ) - jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data ); - }); - - // Return the cloned set - return ret; - }, - - filter: function( selector ) { - return this.pushStack( - jQuery.isFunction( selector ) && - jQuery.grep(this, function(elem, i){ - return selector.call( elem, i ); - }) || - - jQuery.multiFilter( selector, jQuery.grep(this, function(elem){ - return elem.nodeType === 1; - }) ), "filter", selector ); - }, - - closest: function( selector ) { - var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null; - - return this.map(function(){ - var cur = this; - while ( cur && cur.ownerDocument ) { - if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) - return cur; - cur = cur.parentNode; - } - }); - }, - - not: function( selector ) { - if ( typeof selector === "string" ) - // test special case where just one selector is passed in - if ( isSimple.test( selector ) ) - return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector ); - else - selector = jQuery.multiFilter( selector, this ); - - var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; - return this.filter(function() { - return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; - }); - }, - - add: function( selector ) { - return this.pushStack( jQuery.unique( jQuery.merge( - this.get(), - typeof selector === "string" ? - jQuery( selector ) : - jQuery.makeArray( selector ) - ))); - }, - - is: function( selector ) { - return !!selector && jQuery.multiFilter( selector, this ).length > 0; - }, - - hasClass: function( selector ) { - return !!selector && this.is( "." + selector ); - }, - - val: function( value ) { - if ( value === undefined ) { - var elem = this[0]; - - if ( elem ) { - if( jQuery.nodeName( elem, 'option' ) ) - return (elem.attributes.value || {}).specified ? elem.value : elem.text; - - // We need to handle select boxes special - if ( jQuery.nodeName( elem, "select" ) ) { - var index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type == "select-one"; - - // Nothing was selected - if ( index < 0 ) - return null; - - // Loop through all the selected options - for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { - var option = options[ i ]; - - if ( option.selected ) { - // Get the specifc value for the option - value = jQuery(option).val(); - - // We don't need an array for one selects - if ( one ) - return value; - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - } - - // Everything else, we just grab the value - return (elem.value || "").replace(/\r/g, ""); - - } - - return undefined; - } - - if ( typeof value === "number" ) - value += ''; - - return this.each(function(){ - if ( this.nodeType != 1 ) - return; - - if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) ) - this.checked = (jQuery.inArray(this.value, value) >= 0 || - jQuery.inArray(this.name, value) >= 0); - - else if ( jQuery.nodeName( this, "select" ) ) { - var values = jQuery.makeArray(value); - - jQuery( "option", this ).each(function(){ - this.selected = (jQuery.inArray( this.value, values ) >= 0 || - jQuery.inArray( this.text, values ) >= 0); - }); - - if ( !values.length ) - this.selectedIndex = -1; - - } else - this.value = value; - }); - }, - - html: function( value ) { - return value === undefined ? - (this[0] ? - this[0].innerHTML : - null) : - this.empty().append( value ); - }, - - replaceWith: function( value ) { - return this.after( value ).remove(); - }, - - eq: function( i ) { - return this.slice( i, +i + 1 ); - }, - - slice: function() { - return this.pushStack( Array.prototype.slice.apply( this, arguments ), - "slice", Array.prototype.slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function(elem, i){ - return callback.call( elem, i, elem ); - })); - }, - - andSelf: function() { - return this.add( this.prevObject ); - }, - - domManip: function( args, table, callback ) { - if ( this[0] ) { - var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(), - scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ), - first = fragment.firstChild, - extra = this.length > 1 ? fragment.cloneNode(true) : fragment; - - if ( first ) - for ( var i = 0, l = this.length; i < l; i++ ) - callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment ); - - if ( scripts ) - jQuery.each( scripts, evalScript ); - } - - return this; - - function root( elem, cur ) { - return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ? - (elem.getElementsByTagName("tbody")[0] || - elem.appendChild(elem.ownerDocument.createElement("tbody"))) : - elem; - } - } -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -function evalScript( i, elem ) { - if ( elem.src ) - jQuery.ajax({ - url: elem.src, - async: false, - dataType: "script" - }); - - else - jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); - - if ( elem.parentNode ) - elem.parentNode.removeChild( elem ); -} - -function now(){ - return +new Date; -} - -jQuery.extend = jQuery.fn.extend = function() { - // copy reference to target object - var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) - target = {}; - - // extend jQuery itself if only one argument is passed - if ( length == i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) - // Extend the base object - for ( var name in options ) { - var src = target[ name ], copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) - continue; - - // Recurse if we're merging object values - if ( deep && copy && typeof copy === "object" && !copy.nodeType ) - target[ name ] = jQuery.extend( deep, - // Never move original objects, clone them - src || ( copy.length != null ? [ ] : { } ) - , copy ); - - // Don't bring in undefined values - else if ( copy !== undefined ) - target[ name ] = copy; - - } - - // Return the modified object - return target; -}; - -// exclude the following css properties to add px -var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, - // cache defaultView - defaultView = document.defaultView || {}, - toString = Object.prototype.toString; - -jQuery.extend({ - noConflict: function( deep ) { - window.$ = _$; - - if ( deep ) - window.jQuery = _jQuery; - - return jQuery; - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return toString.call(obj) === "[object Function]"; - }, - - isArray: function( obj ) { - return toString.call(obj) === "[object Array]"; - }, - - // check if an element is in a (or is an) XML document - isXMLDoc: function( elem ) { - return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || - !!elem.ownerDocument && jQuery.isXMLDoc( elem.ownerDocument ); - }, - - // Evalulates a script in a global context - globalEval: function( data ) { - data = jQuery.trim( data ); - - if ( data ) { - // Inspired by code by Andrea Giammarchi - // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html - var head = document.getElementsByTagName("head")[0] || document.documentElement, - script = document.createElement("script"); - - script.type = "text/javascript"; - if ( jQuery.support.scriptEval ) - script.appendChild( document.createTextNode( data ) ); - else - script.text = data; - - // Use insertBefore instead of appendChild to circumvent an IE6 bug. - // This arises when a base node is used (#2709). - head.insertBefore( script, head.firstChild ); - head.removeChild( script ); - } - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); - }, - - // args is for internal usage only - each: function( object, callback, args ) { - var name, i = 0, length = object.length; - - if ( args ) { - if ( length === undefined ) { - for ( name in object ) - if ( callback.apply( object[ name ], args ) === false ) - break; - } else - for ( ; i < length; ) - if ( callback.apply( object[ i++ ], args ) === false ) - break; - - // A special, fast, case for the most common use of each - } else { - if ( length === undefined ) { - for ( name in object ) - if ( callback.call( object[ name ], name, object[ name ] ) === false ) - break; - } else - for ( var value = object[0]; - i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} - } - - return object; - }, - - prop: function( elem, value, type, i, name ) { - // Handle executable functions - if ( jQuery.isFunction( value ) ) - value = value.call( elem, i ); - - // Handle passing in a number to a CSS property - return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ? - value + "px" : - value; - }, - - className: { - // internal only, use addClass("class") - add: function( elem, classNames ) { - jQuery.each((classNames || "").split(/\s+/), function(i, className){ - if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) ) - elem.className += (elem.className ? " " : "") + className; - }); - }, - - // internal only, use removeClass("class") - remove: function( elem, classNames ) { - if (elem.nodeType == 1) - elem.className = classNames !== undefined ? - jQuery.grep(elem.className.split(/\s+/), function(className){ - return !jQuery.className.has( classNames, className ); - }).join(" ") : - ""; - }, - - // internal only, use hasClass("class") - has: function( elem, className ) { - return elem && jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1; - } - }, - - // A method for quickly swapping in/out CSS properties to get correct calculations - swap: function( elem, options, callback ) { - var old = {}; - // Remember the old values, and insert the new ones - for ( var name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - callback.call( elem ); - - // Revert the old values - for ( var name in options ) - elem.style[ name ] = old[ name ]; - }, - - css: function( elem, name, force ) { - if ( name == "width" || name == "height" ) { - var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; - - function getWH() { - val = name == "width" ? elem.offsetWidth : elem.offsetHeight; - var padding = 0, border = 0; - jQuery.each( which, function() { - padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0; - border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0; - }); - val -= Math.round(padding + border); - } - - if ( jQuery(elem).is(":visible") ) - getWH(); - else - jQuery.swap( elem, props, getWH ); - - return Math.max(0, val); - } - - return jQuery.curCSS( elem, name, force ); - }, - - curCSS: function( elem, name, force ) { - var ret, style = elem.style; - - // We need to handle opacity special in IE - if ( name == "opacity" && !jQuery.support.opacity ) { - ret = jQuery.attr( style, "opacity" ); - - return ret == "" ? - "1" : - ret; - } - - // Make sure we're using the right name for getting the float value - if ( name.match( /float/i ) ) - name = styleFloat; - - if ( !force && style && style[ name ] ) - ret = style[ name ]; - - else if ( defaultView.getComputedStyle ) { - - // Only "float" is needed here - if ( name.match( /float/i ) ) - name = "float"; - - name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); - - var computedStyle = defaultView.getComputedStyle( elem, null ); - - if ( computedStyle ) - ret = computedStyle.getPropertyValue( name ); - - // We should always get a number back from opacity - if ( name == "opacity" && ret == "" ) - ret = "1"; - - } else if ( elem.currentStyle ) { - var camelCase = name.replace(/\-(\w)/g, function(all, letter){ - return letter.toUpperCase(); - }); - - ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; - - // From the awesome hack by Dean Edwards - // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 - - // If we're not dealing with a regular pixel number - // but a number that has a weird ending, we need to convert it to pixels - if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { - // Remember the original values - var left = style.left, rsLeft = elem.runtimeStyle.left; - - // Put in the new values to get a computed value out - elem.runtimeStyle.left = elem.currentStyle.left; - style.left = ret || 0; - ret = style.pixelLeft + "px"; - - // Revert the changed values - style.left = left; - elem.runtimeStyle.left = rsLeft; - } - } - - return ret; - }, - - clean: function( elems, context, fragment ) { - context = context || document; - - // !context.createElement fails in IE with an error but returns typeof 'object' - if ( typeof context.createElement === "undefined" ) - context = context.ownerDocument || context[0] && context[0].ownerDocument || document; - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) { - var match = /^<(\w+)\s*\/?>$/.exec(elems[0]); - if ( match ) - return [ context.createElement( match[1] ) ]; - } - - var ret = [], scripts = [], div = context.createElement("div"); - - jQuery.each(elems, function(i, elem){ - if ( typeof elem === "number" ) - elem += ''; - - if ( !elem ) - return; - - // Convert html string into DOM nodes - if ( typeof elem === "string" ) { - // Fix "XHTML"-style tags in all browsers - elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ - return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? - all : - front + "></" + tag + ">"; - }); - - // Trim whitespace, otherwise indexOf won't work as expected - var tags = jQuery.trim( elem ).toLowerCase(); - - var wrap = - // option or optgroup - !tags.indexOf("<opt") && - [ 1, "<select multiple='multiple'>", "</select>" ] || - - !tags.indexOf("<leg") && - [ 1, "<fieldset>", "</fieldset>" ] || - - tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && - [ 1, "<table>", "</table>" ] || - - !tags.indexOf("<tr") && - [ 2, "<table><tbody>", "</tbody></table>" ] || - - // <thead> matched above - (!tags.indexOf("<td") || !tags.indexOf("<th")) && - [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] || - - !tags.indexOf("<col") && - [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] || - - // IE can't serialize <link> and <script> tags normally - !jQuery.support.htmlSerialize && - [ 1, "div<div>", "</div>" ] || - - [ 0, "", "" ]; - - // Go to html and back, then peel off extra wrappers - div.innerHTML = wrap[1] + elem + wrap[2]; - - // Move to the right depth - while ( wrap[0]-- ) - div = div.lastChild; - - // Remove IE's autoinserted <tbody> from table fragments - if ( !jQuery.support.tbody ) { - - // String was a <table>, *may* have spurious <tbody> - var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ? - div.firstChild && div.firstChild.childNodes : - - // String was a bare <thead> or <tfoot> - wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ? - div.childNodes : - []; - - for ( var j = tbody.length - 1; j >= 0 ; --j ) - if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) - tbody[ j ].parentNode.removeChild( tbody[ j ] ); - - } - - // IE completely kills leading whitespace when innerHTML is used - if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) ) - div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild ); - - elem = jQuery.makeArray( div.childNodes ); - } - - if ( elem.nodeType ) - ret.push( elem ); - else - ret = jQuery.merge( ret, elem ); - - }); - - if ( fragment ) { - for ( var i = 0; ret[i]; i++ ) { - if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { - scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); - } else { - if ( ret[i].nodeType === 1 ) - ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); - fragment.appendChild( ret[i] ); - } - } - - return scripts; - } - - return ret; - }, - - attr: function( elem, name, value ) { - // don't set attributes on text and comment nodes - if (!elem || elem.nodeType == 3 || elem.nodeType == 8) - return undefined; - - var notxml = !jQuery.isXMLDoc( elem ), - // Whether we are setting (or getting) - set = value !== undefined; - - // Try to normalize/fix the name - name = notxml && jQuery.props[ name ] || name; - - // Only do all the following if this is a node (faster for style) - // IE elem.getAttribute passes even for style - if ( elem.tagName ) { - - // These attributes require special treatment - var special = /href|src|style/.test( name ); - - // Safari mis-reports the default selected property of a hidden option - // Accessing the parent's selectedIndex property fixes it - if ( name == "selected" && elem.parentNode ) - elem.parentNode.selectedIndex; - - // If applicable, access the attribute via the DOM 0 way - if ( name in elem && notxml && !special ) { - if ( set ){ - // We can't allow the type property to be changed (since it causes problems in IE) - if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode ) - throw "type property can't be changed"; - - elem[ name ] = value; - } - - // browsers index elements by id/name on forms, give priority to attributes. - if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) - return elem.getAttributeNode( name ).nodeValue; - - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - if ( name == "tabIndex" ) { - var attributeNode = elem.getAttributeNode( "tabIndex" ); - return attributeNode && attributeNode.specified - ? attributeNode.value - : elem.nodeName.match(/(button|input|object|select|textarea)/i) - ? 0 - : elem.nodeName.match(/^(a|area)$/i) && elem.href - ? 0 - : undefined; - } - - return elem[ name ]; - } - - if ( !jQuery.support.style && notxml && name == "style" ) - return jQuery.attr( elem.style, "cssText", value ); - - if ( set ) - // convert the value to a string (all browsers do this but IE) see #1070 - elem.setAttribute( name, "" + value ); - - var attr = !jQuery.support.hrefNormalized && notxml && special - // Some attributes require a special call on IE - ? elem.getAttribute( name, 2 ) - : elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return attr === null ? undefined : attr; - } - - // elem is actually elem.style ... set the style - - // IE uses filters for opacity - if ( !jQuery.support.opacity && name == "opacity" ) { - if ( set ) { - // IE has trouble with opacity if it does not have layout - // Force it by setting the zoom level - elem.zoom = 1; - - // Set the alpha filter to set the opacity - elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) + - (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"); - } - - return elem.filter && elem.filter.indexOf("opacity=") >= 0 ? - (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '': - ""; - } - - name = name.replace(/-([a-z])/ig, function(all, letter){ - return letter.toUpperCase(); - }); - - if ( set ) - elem[ name ] = value; - - return elem[ name ]; - }, - - trim: function( text ) { - return (text || "").replace( /^\s+|\s+$/g, "" ); - }, - - makeArray: function( array ) { - var ret = []; - - if( array != null ){ - var i = array.length; - // The window, strings (and functions) also have 'length' - if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval ) - ret[0] = array; - else - while( i ) - ret[--i] = array[i]; - } - - return ret; - }, - - inArray: function( elem, array ) { - for ( var i = 0, length = array.length; i < length; i++ ) - // Use === because on IE, window == document - if ( array[ i ] === elem ) - return i; - - return -1; - }, - - merge: function( first, second ) { - // We have to loop this way because IE & Opera overwrite the length - // expando of getElementsByTagName - var i = 0, elem, pos = first.length; - // Also, we need to make sure that the correct elements are being returned - // (IE returns comment nodes in a '*' query) - if ( !jQuery.support.getAll ) { - while ( (elem = second[ i++ ]) != null ) - if ( elem.nodeType != 8 ) - first[ pos++ ] = elem; - - } else - while ( (elem = second[ i++ ]) != null ) - first[ pos++ ] = elem; - - return first; - }, - - unique: function( array ) { - var ret = [], done = {}; - - try { - - for ( var i = 0, length = array.length; i < length; i++ ) { - var id = jQuery.data( array[ i ] ); - - if ( !done[ id ] ) { - done[ id ] = true; - ret.push( array[ i ] ); - } - } - - } catch( e ) { - ret = array; - } - - return ret; - }, - - grep: function( elems, callback, inv ) { - var ret = []; - - // Go through the array, only saving the items - // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) - if ( !inv != !callback( elems[ i ], i ) ) - ret.push( elems[ i ] ); - - return ret; - }, - - map: function( elems, callback ) { - var ret = []; - - // Go through the array, translating each of the items to their - // new value (or values). - for ( var i = 0, length = elems.length; i < length; i++ ) { - var value = callback( elems[ i ], i ); - - if ( value != null ) - ret[ ret.length ] = value; - } - - return ret.concat.apply( [], ret ); - } -}); - -// Use of jQuery.browser is deprecated. -// It's included for backwards compatibility and plugins, -// although they should work to migrate away. - -var userAgent = navigator.userAgent.toLowerCase(); - -// Figure out what browser is being used -jQuery.browser = { - version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1], - safari: /webkit/.test( userAgent ), - opera: /opera/.test( userAgent ), - msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), - mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) -}; - -jQuery.each({ - parent: function(elem){return elem.parentNode;}, - parents: function(elem){return jQuery.dir(elem,"parentNode");}, - next: function(elem){return jQuery.nth(elem,2,"nextSibling");}, - prev: function(elem){return jQuery.nth(elem,2,"previousSibling");}, - nextAll: function(elem){return jQuery.dir(elem,"nextSibling");}, - prevAll: function(elem){return jQuery.dir(elem,"previousSibling");}, - siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);}, - children: function(elem){return jQuery.sibling(elem.firstChild);}, - contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);} -}, function(name, fn){ - jQuery.fn[ name ] = function( selector ) { - var ret = jQuery.map( this, fn ); - - if ( selector && typeof selector == "string" ) - ret = jQuery.multiFilter( selector, ret ); - - return this.pushStack( jQuery.unique( ret ), name, selector ); - }; -}); - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function(name, original){ - jQuery.fn[ name ] = function() { - var args = arguments; - - return this.each(function(){ - for ( var i = 0, length = args.length; i < length; i++ ) - jQuery( args[ i ] )[ original ]( this ); - }); - }; -}); - -jQuery.each({ - removeAttr: function( name ) { - jQuery.attr( this, name, "" ); - if (this.nodeType == 1) - this.removeAttribute( name ); - }, - - addClass: function( classNames ) { - jQuery.className.add( this, classNames ); - }, - - removeClass: function( classNames ) { - jQuery.className.remove( this, classNames ); - }, - - toggleClass: function( classNames, state ) { - if( typeof state !== "boolean" ) - state = !jQuery.className.has( this, classNames ); - jQuery.className[ state ? "add" : "remove" ]( this, classNames ); - }, - - remove: function( selector ) { - if ( !selector || jQuery.filter( selector, [ this ] ).length ) { - // Prevent memory leaks - jQuery( "*", this ).add([this]).each(function(){ - jQuery.event.remove(this); - jQuery.removeData(this); - }); - if (this.parentNode) - this.parentNode.removeChild( this ); - } - }, - - empty: function() { - // Remove element nodes and prevent memory leaks - jQuery( ">*", this ).remove(); - - // Remove any remaining nodes - while ( this.firstChild ) - this.removeChild( this.firstChild ); - } -}, function(name, fn){ - jQuery.fn[ name ] = function(){ - return this.each( fn, arguments ); - }; -}); - -// Helper function used by the dimensions and offset modules -function num(elem, prop) { - return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0; -} -var expando = "jQuery" + now(), uuid = 0, windowData = {}; - -jQuery.extend({ - cache: {}, - - data: function( elem, name, data ) { - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ]; - - // Compute a unique ID for the element - if ( !id ) - id = elem[ expando ] = ++uuid; - - // Only generate the data cache if we're - // trying to access or manipulate it - if ( name && !jQuery.cache[ id ] ) - jQuery.cache[ id ] = {}; - - // Prevent overriding the named cache with undefined values - if ( data !== undefined ) - jQuery.cache[ id ][ name ] = data; - - // Return the named cache data, or the ID for the element - return name ? - jQuery.cache[ id ][ name ] : - id; - }, - - removeData: function( elem, name ) { - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ]; - - // If we want to remove a specific section of the element's data - if ( name ) { - if ( jQuery.cache[ id ] ) { - // Remove the section of cache data - delete jQuery.cache[ id ][ name ]; - - // If we've removed all the data, remove the element's cache - name = ""; - - for ( name in jQuery.cache[ id ] ) - break; - - if ( !name ) - jQuery.removeData( elem ); - } - - // Otherwise, we want to remove all of the element's data - } else { - // Clean up the element expando - try { - delete elem[ expando ]; - } catch(e){ - // IE has trouble directly removing the expando - // but it's ok with using removeAttribute - if ( elem.removeAttribute ) - elem.removeAttribute( expando ); - } - - // Completely remove the data cache - delete jQuery.cache[ id ]; - } - }, - queue: function( elem, type, data ) { - if ( elem ){ - - type = (type || "fx") + "queue"; - - var q = jQuery.data( elem, type ); - - if ( !q || jQuery.isArray(data) ) - q = jQuery.data( elem, type, jQuery.makeArray(data) ); - else if( data ) - q.push( data ); - - } - return q; - }, - - dequeue: function( elem, type ){ - var queue = jQuery.queue( elem, type ), - fn = queue.shift(); - - if( !type || type === "fx" ) - fn = queue[0]; - - if( fn !== undefined ) - fn.call(elem); - } -}); - -jQuery.fn.extend({ - data: function( key, value ){ - var parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if ( value === undefined ) { - var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - if ( data === undefined && this.length ) - data = jQuery.data( this[0], key ); - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - } else - return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ - jQuery.data( this, key, value ); - }); - }, - - removeData: function( key ){ - return this.each(function(){ - jQuery.removeData( this, key ); - }); - }, - queue: function(type, data){ - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - } - - if ( data === undefined ) - return jQuery.queue( this[0], type ); - - return this.each(function(){ - var queue = jQuery.queue( this, type, data ); - - if( type == "fx" && queue.length == 1 ) - queue[0].call(this); - }); - }, - dequeue: function(type){ - return this.each(function(){ - jQuery.dequeue( this, type ); - }); - } -});/*! - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g, - done = 0, - toString = Object.prototype.toString; - -var Sizzle = function(selector, context, results, seed) { - results = results || []; - context = context || document; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) - return []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var parts = [], m, set, checkSet, check, mode, extra, prune = true; - - // Reset the position of the chunker regexp (start from head) - chunker.lastIndex = 0; - - while ( (m = chunker.exec(selector)) !== null ) { - parts.push( m[1] ); - - if ( m[2] ) { - extra = RegExp.rightContext; - break; - } - } - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context ); - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) - selector += parts.shift(); - - set = posProcess( selector, set ); - } - } - } else { - var ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context) ); - set = Sizzle.filter( ret.expr, ret.set ); - - if ( parts.length > 0 ) { - checkSet = makeArray(set); - } else { - prune = false; - } - - while ( parts.length ) { - var cur = parts.pop(), pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, isXML(context) ); - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - throw "Syntax error, unrecognized expression: " + (cur || selector); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - } else if ( context.nodeType === 1 ) { - for ( var i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - } else { - for ( var i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, context, results, seed ); - } - - return results; -}; - -Sizzle.matches = function(expr, set){ - return Sizzle(expr, null, null, set); -}; - -Sizzle.find = function(expr, context, isXML){ - var set, match; - - if ( !expr ) { - return []; - } - - for ( var i = 0, l = Expr.order.length; i < l; i++ ) { - var type = Expr.order[i], match; - - if ( (match = Expr.match[ type ].exec( expr )) ) { - var left = RegExp.leftContext; - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace(/\\/g, ""); - set = Expr.find[ type ]( match, context, isXML ); - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = context.getElementsByTagName("*"); - } - - return {set: set, expr: expr}; -}; - -Sizzle.filter = function(expr, set, inplace, not){ - var old = expr, result = [], curLoop = set, match, anyFound; - - while ( expr && set.length ) { - for ( var type in Expr.filter ) { - if ( (match = Expr.match[ type ].exec( expr )) != null ) { - var filter = Expr.filter[ type ], found, item; - anyFound = false; - - if ( curLoop == result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not ); - - if ( !match ) { - anyFound = found = true; - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( var i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - var pass = not ^ !!found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - } else { - curLoop[i] = false; - } - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - expr = expr.replace(/\s*,\s*/, ""); - - // Improper expression - if ( expr == old ) { - if ( anyFound == null ) { - throw "Syntax error, unrecognized expression: " + expr; - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - match: { - ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/ - }, - attrMap: { - "class": "className", - "for": "htmlFor" - }, - attrHandle: { - href: function(elem){ - return elem.getAttribute("href"); - } - }, - relative: { - "+": function(checkSet, part){ - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - var cur = elem.previousSibling; - while ( cur && cur.nodeType !== 1 ) { - cur = cur.previousSibling; - } - checkSet[i] = typeof part === "string" ? - cur || false : - cur === part; - } - } - - if ( typeof part === "string" ) { - Sizzle.filter( part, checkSet, true ); - } - }, - ">": function(checkSet, part, isXML){ - if ( typeof part === "string" && !/\W/.test(part) ) { - part = isXML ? part : part.toUpperCase(); - - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName === part ? parent : false; - } - } - } else { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - checkSet[i] = typeof part === "string" ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( typeof part === "string" ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - "": function(checkSet, part, isXML){ - var doneName = "done" + (done++), checkFn = dirCheck; - - if ( !part.match(/\W/) ) { - var nodeCheck = part = isXML ? part : part.toUpperCase(); - checkFn = dirNodeCheck; - } - - checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); - }, - "~": function(checkSet, part, isXML){ - var doneName = "done" + (done++), checkFn = dirCheck; - - if ( typeof part === "string" && !part.match(/\W/) ) { - var nodeCheck = part = isXML ? part : part.toUpperCase(); - checkFn = dirNodeCheck; - } - - checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); - } - }, - find: { - ID: function(match, context, isXML){ - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - return m ? [m] : []; - } - }, - NAME: function(match, context, isXML){ - if ( typeof context.getElementsByName !== "undefined" && !isXML ) { - return context.getElementsByName(match[1]); - } - }, - TAG: function(match, context){ - return context.getElementsByTagName(match[1]); - } - }, - preFilter: { - CLASS: function(match, curLoop, inplace, result, not){ - match = " " + match[1].replace(/\\/g, "") + " "; - - var elem; - for ( var i = 0; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (" " + elem.className + " ").indexOf(match) >= 0 ) { - if ( !inplace ) - result.push( elem ); - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - ID: function(match){ - return match[1].replace(/\\/g, ""); - }, - TAG: function(match, curLoop){ - for ( var i = 0; curLoop[i] === false; i++ ){} - return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase(); - }, - CHILD: function(match){ - if ( match[1] == "nth" ) { - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( - match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - - // TODO: Move to normal caching system - match[0] = "done" + (done++); - - return match; - }, - ATTR: function(match){ - var name = match[1].replace(/\\/g, ""); - - if ( Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - PSEUDO: function(match, curLoop, inplace, result, not){ - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( match[3].match(chunker).length > 1 ) { - match[3] = Sizzle(match[3], null, null, curLoop); - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - if ( !inplace ) { - result.push.apply( result, ret ); - } - return false; - } - } else if ( Expr.match.POS.test( match[0] ) ) { - return true; - } - - return match; - }, - POS: function(match){ - match.unshift( true ); - return match; - } - }, - filters: { - enabled: function(elem){ - return elem.disabled === false && elem.type !== "hidden"; - }, - disabled: function(elem){ - return elem.disabled === true; - }, - checked: function(elem){ - return elem.checked === true; - }, - selected: function(elem){ - // Accessing this property makes selected-by-default - // options in Safari work properly - elem.parentNode.selectedIndex; - return elem.selected === true; - }, - parent: function(elem){ - return !!elem.firstChild; - }, - empty: function(elem){ - return !elem.firstChild; - }, - has: function(elem, i, match){ - return !!Sizzle( match[3], elem ).length; - }, - header: function(elem){ - return /h\d/i.test( elem.nodeName ); - }, - text: function(elem){ - return "text" === elem.type; - }, - radio: function(elem){ - return "radio" === elem.type; - }, - checkbox: function(elem){ - return "checkbox" === elem.type; - }, - file: function(elem){ - return "file" === elem.type; - }, - password: function(elem){ - return "password" === elem.type; - }, - submit: function(elem){ - return "submit" === elem.type; - }, - image: function(elem){ - return "image" === elem.type; - }, - reset: function(elem){ - return "reset" === elem.type; - }, - button: function(elem){ - return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON"; - }, - input: function(elem){ - return /input|select|textarea|button/i.test(elem.nodeName); - } - }, - setFilters: { - first: function(elem, i){ - return i === 0; - }, - last: function(elem, i, match, array){ - return i === array.length - 1; - }, - even: function(elem, i){ - return i % 2 === 0; - }, - odd: function(elem, i){ - return i % 2 === 1; - }, - lt: function(elem, i, match){ - return i < match[3] - 0; - }, - gt: function(elem, i, match){ - return i > match[3] - 0; - }, - nth: function(elem, i, match){ - return match[3] - 0 == i; - }, - eq: function(elem, i, match){ - return match[3] - 0 == i; - } - }, - filter: { - CHILD: function(elem, match){ - var type = match[1], parent = elem.parentNode; - - var doneName = match[0]; - - if ( parent && (!parent[ doneName ] || !elem.nodeIndex) ) { - var count = 1; - - for ( var node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType == 1 ) { - node.nodeIndex = count++; - } - } - - parent[ doneName ] = count - 1; - } - - if ( type == "first" ) { - return elem.nodeIndex == 1; - } else if ( type == "last" ) { - return elem.nodeIndex == parent[ doneName ]; - } else if ( type == "only" ) { - return parent[ doneName ] == 1; - } else if ( type == "nth" ) { - var add = false, first = match[2], last = match[3]; - - if ( first == 1 && last == 0 ) { - return true; - } - - if ( first == 0 ) { - if ( elem.nodeIndex == last ) { - add = true; - } - } else if ( (elem.nodeIndex - last) % first == 0 && (elem.nodeIndex - last) / first >= 0 ) { - add = true; - } - - return add; - } - }, - PSEUDO: function(elem, match, i, array){ - var name = match[1], filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0; - } else if ( name === "not" ) { - var not = match[3]; - - for ( var i = 0, l = not.length; i < l; i++ ) { - if ( not[i] === elem ) { - return false; - } - } - - return true; - } - }, - ID: function(elem, match){ - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - TAG: function(elem, match){ - return (match === "*" && elem.nodeType === 1) || elem.nodeName === match; - }, - CLASS: function(elem, match){ - return match.test( elem.className ); - }, - ATTR: function(elem, match){ - var result = Expr.attrHandle[ match[1] ] ? Expr.attrHandle[ match[1] ]( elem ) : elem[ match[1] ] || elem.getAttribute( match[1] ), value = result + "", type = match[2], check = match[4]; - return result == null ? - type === "!=" : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !match[4] ? - result : - type === "!=" ? - value != check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - POS: function(elem, match, i, array){ - var name = match[2], filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS; - -for ( var type in Expr.match ) { - Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); -} - -var makeArray = function(array, results) { - array = Array.prototype.slice.call( array ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -try { - Array.prototype.slice.call( document.documentElement.childNodes ); - -// Provide a fallback method if it does not work -} catch(e){ - makeArray = function(array, results) { - var ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - } else { - if ( typeof array.length === "number" ) { - for ( var i = 0, l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - } else { - for ( var i = 0; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("form"), - id = "script" + (new Date).getTime(); - form.innerHTML = "<input name='" + id + "'/>"; - - // Inject it into the root element, check its status, and remove it quickly - var root = document.documentElement; - root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( !!document.getElementById( id ) ) { - Expr.find.ID = function(match, context, isXML){ - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; - } - }; - - Expr.filter.ID = function(elem, match){ - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } - - root.removeChild( form ); -})(); - -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); - - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function(match, context){ - var results = context.getElementsByTagName(match[1]); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - } - - // Check to see if an attribute returns normalized href attributes - div.innerHTML = "<a href='#'></a>"; - if ( div.firstChild && div.firstChild.getAttribute("href") !== "#" ) { - Expr.attrHandle.href = function(elem){ - return elem.getAttribute("href", 2); - }; - } -})(); - -if ( document.querySelectorAll ) (function(){ - var oldSizzle = Sizzle, div = document.createElement("div"); - div.innerHTML = "<p class='TEST'></p>"; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function(query, context, extra, seed){ - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && context.nodeType === 9 && !isXML(context) ) { - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(e){} - } - - return oldSizzle(query, context, extra, seed); - }; - - Sizzle.find = oldSizzle.find; - Sizzle.filter = oldSizzle.filter; - Sizzle.selectors = oldSizzle.selectors; - Sizzle.matches = oldSizzle.matches; -})(); - -if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) { - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function(match, context) { - return context.getElementsByClassName(match[1]); - }; -} - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - elem = elem[dir]; - var match = false; - - while ( elem && elem.nodeType ) { - var done = elem[doneName]; - if ( done ) { - match = checkSet[ done ]; - break; - } - - if ( elem.nodeType === 1 && !isXML ) - elem[doneName] = i; - - if ( elem.nodeName === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - elem = elem[dir]; - var match = false; - - while ( elem && elem.nodeType ) { - if ( elem[doneName] ) { - match = checkSet[ elem[doneName] ]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) - elem[doneName] = i; - - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -var contains = document.compareDocumentPosition ? function(a, b){ - return a.compareDocumentPosition(b) & 16; -} : function(a, b){ - return a !== b && (a.contains ? a.contains(b) : true); -}; - -var isXML = function(elem){ - return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || - !!elem.ownerDocument && isXML( elem.ownerDocument ); -}; - -var posProcess = function(selector, context){ - var tmpSet = [], later = "", match, - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE -jQuery.find = Sizzle; -jQuery.filter = Sizzle.filter; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; - -Sizzle.selectors.filters.hidden = function(elem){ - return "hidden" === elem.type || - jQuery.css(elem, "display") === "none" || - jQuery.css(elem, "visibility") === "hidden"; -}; - -Sizzle.selectors.filters.visible = function(elem){ - return "hidden" !== elem.type && - jQuery.css(elem, "display") !== "none" && - jQuery.css(elem, "visibility") !== "hidden"; -}; - -Sizzle.selectors.filters.animated = function(elem){ - return jQuery.grep(jQuery.timers, function(fn){ - return elem === fn.elem; - }).length; -}; - -jQuery.multiFilter = function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return Sizzle.matches(expr, elems); -}; - -jQuery.dir = function( elem, dir ){ - var matched = [], cur = elem[dir]; - while ( cur && cur != document ) { - if ( cur.nodeType == 1 ) - matched.push( cur ); - cur = cur[dir]; - } - return matched; -}; - -jQuery.nth = function(cur, result, dir, elem){ - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) - if ( cur.nodeType == 1 && ++num == result ) - break; - - return cur; -}; - -jQuery.sibling = function(n, elem){ - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType == 1 && n != elem ) - r.push( n ); - } - - return r; -}; - -return; - -window.Sizzle = Sizzle; - -})(); -/* - * A number of helper functions used for managing events. - * Many of the ideas behind this code originated from - * Dean Edwards' addEvent library. - */ -jQuery.event = { - - // Bind an event to an element - // Original by Dean Edwards - add: function(elem, types, handler, data) { - if ( elem.nodeType == 3 || elem.nodeType == 8 ) - return; - - // For whatever reason, IE has trouble passing the window object - // around, causing it to be cloned in the process - if ( elem.setInterval && elem != window ) - elem = window; - - // Make sure that the function being executed has a unique ID - if ( !handler.guid ) - handler.guid = this.guid++; - - // if data is passed, bind to handler - if ( data !== undefined ) { - // Create temporary function pointer to original handler - var fn = handler; - - // Create unique handler function, wrapped around original handler - handler = this.proxy( fn ); - - // Store data in unique handler - handler.data = data; - } - - // Init the element's event structure - var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}), - handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){ - // Handle the second event of a trigger and when - // an event is called after a page has unloaded - return typeof jQuery !== "undefined" && !jQuery.event.triggered ? - jQuery.event.handle.apply(arguments.callee.elem, arguments) : - undefined; - }); - // Add elem as a property of the handle function - // This is to prevent a memory leak with non-native - // event in IE. - handle.elem = elem; - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - jQuery.each(types.split(/\s+/), function(index, type) { - // Namespaced event handlers - var namespaces = type.split("."); - type = namespaces.shift(); - handler.type = namespaces.slice().sort().join("."); - - // Get the current list of functions bound to this event - var handlers = events[type]; - - if ( jQuery.event.specialAll[type] ) - jQuery.event.specialAll[type].setup.call(elem, data, namespaces); - - // Init the event handler queue - if (!handlers) { - handlers = events[type] = {}; - - // Check for a special event handler - // Only use addEventListener/attachEvent if the special - // events handler returns false - if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) { - // Bind the global event handler to the element - if (elem.addEventListener) - elem.addEventListener(type, handle, false); - else if (elem.attachEvent) - elem.attachEvent("on" + type, handle); - } - } - - // Add the function to the element's handler list - handlers[handler.guid] = handler; - - // Keep track of which events have been used, for global triggering - jQuery.event.global[type] = true; - }); - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - guid: 1, - global: {}, - - // Detach an event or set of events from an element - remove: function(elem, types, handler) { - // don't do events on text and comment nodes - if ( elem.nodeType == 3 || elem.nodeType == 8 ) - return; - - var events = jQuery.data(elem, "events"), ret, index; - - if ( events ) { - // Unbind all events for the element - if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") ) - for ( var type in events ) - this.remove( elem, type + (types || "") ); - else { - // types is actually an event object here - if ( types.type ) { - handler = types.handler; - types = types.type; - } - - // Handle multiple events seperated by a space - // jQuery(...).unbind("mouseover mouseout", fn); - jQuery.each(types.split(/\s+/), function(index, type){ - // Namespaced event handlers - var namespaces = type.split("."); - type = namespaces.shift(); - var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); - - if ( events[type] ) { - // remove the given handler for the given type - if ( handler ) - delete events[type][handler.guid]; - - // remove all handlers for the given type - else - for ( var handle in events[type] ) - // Handle the removal of namespaced events - if ( namespace.test(events[type][handle].type) ) - delete events[type][handle]; - - if ( jQuery.event.specialAll[type] ) - jQuery.event.specialAll[type].teardown.call(elem, namespaces); - - // remove generic event handler if no more handlers exist - for ( ret in events[type] ) break; - if ( !ret ) { - if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) { - if (elem.removeEventListener) - elem.removeEventListener(type, jQuery.data(elem, "handle"), false); - else if (elem.detachEvent) - elem.detachEvent("on" + type, jQuery.data(elem, "handle")); - } - ret = null; - delete events[type]; - } - } - }); - } - - // Remove the expando if it's no longer used - for ( ret in events ) break; - if ( !ret ) { - var handle = jQuery.data( elem, "handle" ); - if ( handle ) handle.elem = null; - jQuery.removeData( elem, "events" ); - jQuery.removeData( elem, "handle" ); - } - } - }, - - // bubbling is internal - trigger: function( event, data, elem, bubbling ) { - // Event object or event type - var type = event.type || event; - - if( !bubbling ){ - event = typeof event === "object" ? - // jQuery.Event object - event[expando] ? event : - // Object literal - jQuery.extend( jQuery.Event(type), event ) : - // Just the event type (string) - jQuery.Event(type); - - if ( type.indexOf("!") >= 0 ) { - event.type = type = type.slice(0, -1); - event.exclusive = true; - } - - // Handle a global trigger - if ( !elem ) { - // Don't bubble custom events when global (to avoid too much overhead) - event.stopPropagation(); - // Only trigger if we've ever bound an event for it - if ( this.global[type] ) - jQuery.each( jQuery.cache, function(){ - if ( this.events && this.events[type] ) - jQuery.event.trigger( event, data, this.handle.elem ); - }); - } - - // Handle triggering a single element - - // don't do events on text and comment nodes - if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 ) - return undefined; - - // Clean up in case it is reused - event.result = undefined; - event.target = elem; - - // Clone the incoming data, if any - data = jQuery.makeArray(data); - data.unshift( event ); - } - - event.currentTarget = elem; - - // Trigger the event, it is assumed that "handle" is a function - var handle = jQuery.data(elem, "handle"); - if ( handle ) - handle.apply( elem, data ); - - // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links) - if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false ) - event.result = false; - - // Trigger the native events (except for clicks on links) - if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) { - this.triggered = true; - try { - elem[ type ](); - // prevent IE from throwing an error for some hidden elements - } catch (e) {} - } - - this.triggered = false; - - if ( !event.isPropagationStopped() ) { - var parent = elem.parentNode || elem.ownerDocument; - if ( parent ) - jQuery.event.trigger(event, data, parent, true); - } - }, - - handle: function(event) { - // returned undefined or false - var all, handlers; - - event = arguments[0] = jQuery.event.fix( event || window.event ); - - // Namespaced event handlers - var namespaces = event.type.split("."); - event.type = namespaces.shift(); - - // Cache this now, all = true means, any handler - all = !namespaces.length && !event.exclusive; - - var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); - - handlers = ( jQuery.data(this, "events") || {} )[event.type]; - - for ( var j in handlers ) { - var handler = handlers[j]; - - // Filter the functions by class - if ( all || namespace.test(handler.type) ) { - // Pass in a reference to the handler function itself - // So that we can later remove it - event.handler = handler; - event.data = handler.data; - - var ret = handler.apply(this, arguments); - - if( ret !== undefined ){ - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - - if( event.isImmediatePropagationStopped() ) - break; - - } - } - }, - - props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), - - fix: function(event) { - if ( event[expando] ) - return event; - - // store a copy of the original event object - // and "clone" to set read-only properties - var originalEvent = event; - event = jQuery.Event( originalEvent ); - - for ( var i = this.props.length, prop; i; ){ - prop = this.props[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary - if ( !event.target ) - event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either - - // check if target is a textnode (safari) - if ( event.target.nodeType == 3 ) - event.target = event.target.parentNode; - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && event.fromElement ) - event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && event.clientX != null ) { - var doc = document.documentElement, body = document.body; - event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0); - event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0); - } - - // Add which for key events - if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) - event.which = event.charCode || event.keyCode; - - // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) - if ( !event.metaKey && event.ctrlKey ) - event.metaKey = event.ctrlKey; - - // Add which for click: 1 == left; 2 == middle; 3 == right - // Note: button is not normalized, so don't use it - if ( !event.which && event.button ) - event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); - - return event; - }, - - proxy: function( fn, proxy ){ - proxy = proxy || function(){ return fn.apply(this, arguments); }; - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++; - // So proxy can be declared as an argument - return proxy; - }, - - special: { - ready: { - // Make sure the ready event is setup - setup: bindReady, - teardown: function() {} - } - }, - - specialAll: { - live: { - setup: function( selector, namespaces ){ - jQuery.event.add( this, namespaces[0], liveHandler ); - }, - teardown: function( namespaces ){ - if ( namespaces.length ) { - var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)"); - - jQuery.each( (jQuery.data(this, "events").live || {}), function(){ - if ( name.test(this.type) ) - remove++; - }); - - if ( remove < 1 ) - jQuery.event.remove( this, namespaces[0], liveHandler ); - } - } - } - } -}; - -jQuery.Event = function( src ){ - // Allow instantiation without the 'new' keyword - if( !this.preventDefault ) - return new jQuery.Event(src); - - // Event object - if( src && src.type ){ - this.originalEvent = src; - this.type = src.type; - // Event type - }else - this.type = src; - - // timeStamp is buggy for some events on Firefox(#3843) - // So we won't rely on the native value - this.timeStamp = now(); - - // Mark it as fixed - this[expando] = true; -}; - -function returnFalse(){ - return false; -} -function returnTrue(){ - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if( !e ) - return; - // if preventDefault exists run it on the original event - if (e.preventDefault) - e.preventDefault(); - // otherwise set the returnValue property of the original event to false (IE) - e.returnValue = false; - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if( !e ) - return; - // if stopPropagation exists run it on the original event - if (e.stopPropagation) - e.stopPropagation(); - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation:function(){ - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; -// Checks if an event happened on an element within another element -// Used in jQuery.event.special.mouseenter and mouseleave handlers -var withinElement = function(event) { - // Check if mouse(over|out) are still within the same parent element - var parent = event.relatedTarget; - // Traverse up the tree - while ( parent && parent != this ) - try { parent = parent.parentNode; } - catch(e) { parent = this; } - - if( parent != this ){ - // set the correct event type - event.type = event.data; - // handle event if we actually just moused on to a non sub-element - jQuery.event.handle.apply( this, arguments ); - } -}; - -jQuery.each({ - mouseover: 'mouseenter', - mouseout: 'mouseleave' -}, function( orig, fix ){ - jQuery.event.special[ fix ] = { - setup: function(){ - jQuery.event.add( this, orig, withinElement, fix ); - }, - teardown: function(){ - jQuery.event.remove( this, orig, withinElement ); - } - }; -}); - -jQuery.fn.extend({ - bind: function( type, data, fn ) { - return type == "unload" ? this.one(type, data, fn) : this.each(function(){ - jQuery.event.add( this, type, fn || data, fn && data ); - }); - }, - - one: function( type, data, fn ) { - var one = jQuery.event.proxy( fn || data, function(event) { - jQuery(this).unbind(event, one); - return (fn || data).apply( this, arguments ); - }); - return this.each(function(){ - jQuery.event.add( this, type, one, fn && data); - }); - }, - - unbind: function( type, fn ) { - return this.each(function(){ - jQuery.event.remove( this, type, fn ); - }); - }, - - trigger: function( type, data ) { - return this.each(function(){ - jQuery.event.trigger( type, data, this ); - }); - }, - - triggerHandler: function( type, data ) { - if( this[0] ){ - var event = jQuery.Event(type); - event.preventDefault(); - event.stopPropagation(); - jQuery.event.trigger( event, data, this[0] ); - return event.result; - } - }, - - toggle: function( fn ) { - // Save reference to arguments for access in closure - var args = arguments, i = 1; - - // link all the functions, so any of them can unbind this click handler - while( i < args.length ) - jQuery.event.proxy( fn, args[i++] ); - - return this.click( jQuery.event.proxy( fn, function(event) { - // Figure out which function to execute - this.lastToggle = ( this.lastToggle || 0 ) % i; - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ this.lastToggle++ ].apply( this, arguments ) || false; - })); - }, - - hover: function(fnOver, fnOut) { - return this.mouseenter(fnOver).mouseleave(fnOut); - }, - - ready: function(fn) { - // Attach the listeners - bindReady(); - - // If the DOM is already ready - if ( jQuery.isReady ) - // Execute the function immediately - fn.call( document, jQuery ); - - // Otherwise, remember the function for later - else - // Add the function to the wait list - jQuery.readyList.push( fn ); - - return this; - }, - - live: function( type, fn ){ - var proxy = jQuery.event.proxy( fn ); - proxy.guid += this.selector + type; - - jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy ); - - return this; - }, - - die: function( type, fn ){ - jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null ); - return this; - } -}); - -function liveHandler( event ){ - var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"), - stop = true, - elems = []; - - jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){ - if ( check.test(fn.type) ) { - var elem = jQuery(event.target).closest(fn.data)[0]; - if ( elem ) - elems.push({ elem: elem, fn: fn }); - } - }); - - jQuery.each(elems, function(){ - if ( this.fn.call(this.elem, event, this.fn.data) === false ) - stop = false; - }); - - return stop; -} - -function liveConvert(type, selector){ - return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join("."); -} - -jQuery.extend({ - isReady: false, - readyList: [], - // Handle when the DOM is ready - ready: function() { - // Make sure that the DOM is not already loaded - if ( !jQuery.isReady ) { - // Remember that the DOM is ready - jQuery.isReady = true; - - // If there are functions bound, to execute - if ( jQuery.readyList ) { - // Execute all of them - jQuery.each( jQuery.readyList, function(){ - this.call( document, jQuery ); - }); - - // Reset the list of functions - jQuery.readyList = null; - } - - // Trigger any bound ready events - jQuery(document).triggerHandler("ready"); - } - } -}); - -var readyBound = false; - -function bindReady(){ - if ( readyBound ) return; - readyBound = true; - - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", function(){ - document.removeEventListener( "DOMContentLoaded", arguments.callee, false ); - jQuery.ready(); - }, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent("onreadystatechange", function(){ - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", arguments.callee ); - jQuery.ready(); - } - }); - - // If IE and not an iframe - // continually check to see if the document is ready - if ( document.documentElement.doScroll && typeof window.frameElement === "undefined" ) (function(){ - if ( jQuery.isReady ) return; - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch( error ) { - setTimeout( arguments.callee, 0 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); - })(); - } - - // A fallback to window.onload, that will always work - jQuery.event.add( window, "load", jQuery.ready ); -} - -jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," + - "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," + - "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){ - - // Handle event binding - jQuery.fn[name] = function(fn){ - return fn ? this.bind(name, fn) : this.trigger(name); - }; -}); - -// Prevent memory leaks in IE -// And prevent errors on refresh with events like mouseover in other browsers -// Window isn't included so as not to unbind existing unload events -jQuery( window ).bind( 'unload', function(){ - for ( var id in jQuery.cache ) - // Skip the window - if ( id != 1 && jQuery.cache[ id ].handle ) - jQuery.event.remove( jQuery.cache[ id ].handle.elem ); -}); -(function(){ - - jQuery.support = {}; - - var root = document.documentElement, - script = document.createElement("script"), - div = document.createElement("div"), - id = "script" + (new Date).getTime(); - - div.style.display = "none"; - div.innerHTML = ' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>'; - - var all = div.getElementsByTagName("*"), - a = div.getElementsByTagName("a")[0]; - - // Can't get basic test support - if ( !all || !all.length || !a ) { - return; - } - - jQuery.support = { - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: div.firstChild.nodeType == 3, - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName("tbody").length, - - // Make sure that you can get all elements in an <object> element - // IE 7 always returns no results - objectAll: !!div.getElementsByTagName("object")[0] - .getElementsByTagName("*").length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName("link").length, - - // Get the style information from getAttribute - // (IE uses .cssText insted) - style: /red/.test( a.getAttribute("style") ), - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: a.getAttribute("href") === "/a", - - // Make sure that element opacity exists - // (IE uses filter instead) - opacity: a.style.opacity === "0.5", - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: !!a.style.cssFloat, - - // Will be defined later - scriptEval: false, - noCloneEvent: true, - boxModel: null - }; - - script.type = "text/javascript"; - try { - script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); - } catch(e){} - - root.insertBefore( script, root.firstChild ); - - // Make sure that the execution of code works by injecting a script - // tag with appendChild/createTextNode - // (IE doesn't support this, fails, and uses .text instead) - if ( window[ id ] ) { - jQuery.support.scriptEval = true; - delete window[ id ]; - } - - root.removeChild( script ); - - if ( div.attachEvent && div.fireEvent ) { - div.attachEvent("onclick", function(){ - // Cloning a node shouldn't copy over any - // bound event handlers (IE does this) - jQuery.support.noCloneEvent = false; - div.detachEvent("onclick", arguments.callee); - }); - div.cloneNode(true).fireEvent("onclick"); - } - - // Figure out if the W3C box model works as expected - // document.body must exist before we can do this - jQuery(function(){ - var div = document.createElement("div"); - div.style.width = "1px"; - div.style.paddingLeft = "1px"; - - document.body.appendChild( div ); - jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; - document.body.removeChild( div ); - }); -})(); - -var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat"; - -jQuery.props = { - "for": "htmlFor", - "class": "className", - "float": styleFloat, - cssFloat: styleFloat, - styleFloat: styleFloat, - readonly: "readOnly", - maxlength: "maxLength", - cellspacing: "cellSpacing", - rowspan: "rowSpan", - tabindex: "tabIndex" -}; -jQuery.fn.extend({ - // Keep a copy of the old load - _load: jQuery.fn.load, - - load: function( url, params, callback ) { - if ( typeof url !== "string" ) - return this._load( url ); - - var off = url.indexOf(" "); - if ( off >= 0 ) { - var selector = url.slice(off, url.length); - url = url.slice(0, off); - } - - // Default to a GET request - var type = "GET"; - - // If the second parameter was provided - if ( params ) - // If it's a function - if ( jQuery.isFunction( params ) ) { - // We assume that it's the callback - callback = params; - params = null; - - // Otherwise, build a param string - } else if( typeof params === "object" ) { - params = jQuery.param( params ); - type = "POST"; - } - - var self = this; - - // Request the remote document - jQuery.ajax({ - url: url, - type: type, - dataType: "html", - data: params, - complete: function(res, status){ - // If successful, inject the HTML into all the matched elements - if ( status == "success" || status == "notmodified" ) - // See if a selector was specified - self.html( selector ? - // Create a dummy div to hold the results - jQuery("<div/>") - // inject the contents of the document in, removing the scripts - // to avoid any 'Permission Denied' errors in IE - .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, "")) - - // Locate the specified elements - .find(selector) : - - // If not, just inject the full result - res.responseText ); - - if( callback ) - self.each( callback, [res.responseText, status, res] ); - } - }); - return this; - }, - - serialize: function() { - return jQuery.param(this.serializeArray()); - }, - serializeArray: function() { - return this.map(function(){ - return this.elements ? jQuery.makeArray(this.elements) : this; - }) - .filter(function(){ - return this.name && !this.disabled && - (this.checked || /select|textarea/i.test(this.nodeName) || - /text|hidden|password/i.test(this.type)); - }) - .map(function(i, elem){ - var val = jQuery(this).val(); - return val == null ? null : - jQuery.isArray(val) ? - jQuery.map( val, function(val, i){ - return {name: elem.name, value: val}; - }) : - {name: elem.name, value: val}; - }).get(); - } -}); - -// Attach a bunch of functions for handling common AJAX events -jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){ - jQuery.fn[o] = function(f){ - return this.bind(o, f); - }; -}); - -var jsc = now(); - -jQuery.extend({ - - get: function( url, data, callback, type ) { - // shift arguments if data argument was ommited - if ( jQuery.isFunction( data ) ) { - callback = data; - data = null; - } - - return jQuery.ajax({ - type: "GET", - url: url, - data: data, - success: callback, - dataType: type - }); - }, - - getScript: function( url, callback ) { - return jQuery.get(url, null, callback, "script"); - }, - - getJSON: function( url, data, callback ) { - return jQuery.get(url, data, callback, "json"); - }, - - post: function( url, data, callback, type ) { - if ( jQuery.isFunction( data ) ) { - callback = data; - data = {}; - } - - return jQuery.ajax({ - type: "POST", - url: url, - data: data, - success: callback, - dataType: type - }); - }, - - ajaxSetup: function( settings ) { - jQuery.extend( jQuery.ajaxSettings, settings ); - }, - - ajaxSettings: { - url: location.href, - global: true, - type: "GET", - contentType: "application/x-www-form-urlencoded", - processData: true, - async: true, - /* - timeout: 0, - data: null, - username: null, - password: null, - */ - // Create the request object; Microsoft failed to properly - // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available - // This function can be overriden by calling jQuery.ajaxSetup - xhr:function(){ - return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); - }, - accepts: { - xml: "application/xml, text/xml", - html: "text/html", - script: "text/javascript, application/javascript", - json: "application/json, text/javascript", - text: "text/plain", - _default: "*/*" - } - }, - - // Last-Modified header cache for next request - lastModified: {}, - - ajax: function( s ) { - // Extend the settings, but re-extend 's' so that it can be - // checked again later (in the test suite, specifically) - s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s)); - - var jsonp, jsre = /=\?(&|$)/g, status, data, - type = s.type.toUpperCase(); - - // convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) - s.data = jQuery.param(s.data); - - // Handle JSONP Parameter Callbacks - if ( s.dataType == "jsonp" ) { - if ( type == "GET" ) { - if ( !s.url.match(jsre) ) - s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?"; - } else if ( !s.data || !s.data.match(jsre) ) - s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?"; - s.dataType = "json"; - } - - // Build temporary JSONP function - if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) { - jsonp = "jsonp" + jsc++; - - // Replace the =? sequence both in the query string and the data - if ( s.data ) - s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1"); - s.url = s.url.replace(jsre, "=" + jsonp + "$1"); - - // We need to make sure - // that a JSONP style response is executed properly - s.dataType = "script"; - - // Handle JSONP-style loading - window[ jsonp ] = function(tmp){ - data = tmp; - success(); - complete(); - // Garbage collect - window[ jsonp ] = undefined; - try{ delete window[ jsonp ]; } catch(e){} - if ( head ) - head.removeChild( script ); - }; - } - - if ( s.dataType == "script" && s.cache == null ) - s.cache = false; - - if ( s.cache === false && type == "GET" ) { - var ts = now(); - // try replacing _= if it is there - var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2"); - // if nothing was replaced, add timestamp to the end - s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : ""); - } - - // If data is available, append data to url for get requests - if ( s.data && type == "GET" ) { - s.url += (s.url.match(/\?/) ? "&" : "?") + s.data; - - // IE likes to send both get and post data, prevent this - s.data = null; - } - - // Watch for a new set of requests - if ( s.global && ! jQuery.active++ ) - jQuery.event.trigger( "ajaxStart" ); - - // Matches an absolute URL, and saves the domain - var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url ); - - // If we're requesting a remote document - // and trying to load JSON or Script with a GET - if ( s.dataType == "script" && type == "GET" && parts - && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){ - - var head = document.getElementsByTagName("head")[0]; - var script = document.createElement("script"); - script.src = s.url; - if (s.scriptCharset) - script.charset = s.scriptCharset; - - // Handle Script loading - if ( !jsonp ) { - var done = false; - - // Attach handlers for all browsers - script.onload = script.onreadystatechange = function(){ - if ( !done && (!this.readyState || - this.readyState == "loaded" || this.readyState == "complete") ) { - done = true; - success(); - complete(); - head.removeChild( script ); - } - }; - } - - head.appendChild(script); - - // We handle everything using the script element injection - return undefined; - } - - var requestDone = false; - - // Create the request object - var xhr = s.xhr(); - - // Open the socket - // Passing null username, generates a login popup on Opera (#2865) - if( s.username ) - xhr.open(type, s.url, s.async, s.username, s.password); - else - xhr.open(type, s.url, s.async); - - // Need an extra try/catch for cross domain requests in Firefox 3 - try { - // Set the correct header, if data is being sent - if ( s.data ) - xhr.setRequestHeader("Content-Type", s.contentType); - - // Set the If-Modified-Since header, if ifModified mode. - if ( s.ifModified ) - xhr.setRequestHeader("If-Modified-Since", - jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" ); - - // Set header so the called script knows that it's an XMLHttpRequest - xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - - // Set the Accepts header for the server, depending on the dataType - xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ? - s.accepts[ s.dataType ] + ", */*" : - s.accepts._default ); - } catch(e){} - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && s.beforeSend(xhr, s) === false ) { - // Handle the global AJAX counter - if ( s.global && ! --jQuery.active ) - jQuery.event.trigger( "ajaxStop" ); - // close opended socket - xhr.abort(); - return false; - } - - if ( s.global ) - jQuery.event.trigger("ajaxSend", [xhr, s]); - - // Wait for a response to come back - var onreadystatechange = function(isTimeout){ - // The request was aborted, clear the interval and decrement jQuery.active - if (xhr.readyState == 0) { - if (ival) { - // clear poll interval - clearInterval(ival); - ival = null; - // Handle the global AJAX counter - if ( s.global && ! --jQuery.active ) - jQuery.event.trigger( "ajaxStop" ); - } - // The transfer is complete and the data is available, or the request timed out - } else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) { - requestDone = true; - - // clear poll interval - if (ival) { - clearInterval(ival); - ival = null; - } - - status = isTimeout == "timeout" ? "timeout" : - !jQuery.httpSuccess( xhr ) ? "error" : - s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" : - "success"; - - if ( status == "success" ) { - // Watch for, and catch, XML document parse errors - try { - // process the data (runs the xml through httpData regardless of callback) - data = jQuery.httpData( xhr, s.dataType, s ); - } catch(e) { - status = "parsererror"; - } - } - - // Make sure that the request was successful or notmodified - if ( status == "success" ) { - // Cache Last-Modified header, if ifModified mode. - var modRes; - try { - modRes = xhr.getResponseHeader("Last-Modified"); - } catch(e) {} // swallow exception thrown by FF if header is not available - - if ( s.ifModified && modRes ) - jQuery.lastModified[s.url] = modRes; - - // JSONP handles its own success callback - if ( !jsonp ) - success(); - } else - jQuery.handleError(s, xhr, status); - - // Fire the complete handlers - complete(); - - if ( isTimeout ) - xhr.abort(); - - // Stop memory leaks - if ( s.async ) - xhr = null; - } - }; - - if ( s.async ) { - // don't attach the handler to the request, just poll it instead - var ival = setInterval(onreadystatechange, 13); - - // Timeout checker - if ( s.timeout > 0 ) - setTimeout(function(){ - // Check to see if the request is still happening - if ( xhr && !requestDone ) - onreadystatechange( "timeout" ); - }, s.timeout); - } - - // Send the data - try { - xhr.send(s.data); - } catch(e) { - jQuery.handleError(s, xhr, null, e); - } - - // firefox 1.5 doesn't fire statechange for sync requests - if ( !s.async ) - onreadystatechange(); - - function success(){ - // If a local callback was specified, fire it and pass it the data - if ( s.success ) - s.success( data, status ); - - // Fire the global callback - if ( s.global ) - jQuery.event.trigger( "ajaxSuccess", [xhr, s] ); - } - - function complete(){ - // Process result - if ( s.complete ) - s.complete(xhr, status); - - // The request was completed - if ( s.global ) - jQuery.event.trigger( "ajaxComplete", [xhr, s] ); - - // Handle the global AJAX counter - if ( s.global && ! --jQuery.active ) - jQuery.event.trigger( "ajaxStop" ); - } - - // return XMLHttpRequest to allow aborting the request etc. - return xhr; - }, - - handleError: function( s, xhr, status, e ) { - // If a local callback was specified, fire it - if ( s.error ) s.error( xhr, status, e ); - - // Fire the global callback - if ( s.global ) - jQuery.event.trigger( "ajaxError", [xhr, s, e] ); - }, - - // Counter for holding the number of active queries - active: 0, - - // Determines if an XMLHttpRequest was successful or not - httpSuccess: function( xhr ) { - try { - // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450 - return !xhr.status && location.protocol == "file:" || - ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223; - } catch(e){} - return false; - }, - - // Determines if an XMLHttpRequest returns NotModified - httpNotModified: function( xhr, url ) { - try { - var xhrRes = xhr.getResponseHeader("Last-Modified"); - - // Firefox always returns 200. check Last-Modified date - return xhr.status == 304 || xhrRes == jQuery.lastModified[url]; - } catch(e){} - return false; - }, - - httpData: function( xhr, type, s ) { - var ct = xhr.getResponseHeader("content-type"), - xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0, - data = xml ? xhr.responseXML : xhr.responseText; - - if ( xml && data.documentElement.tagName == "parsererror" ) - throw "parsererror"; - - // Allow a pre-filtering function to sanitize the response - // s != null is checked to keep backwards compatibility - if( s && s.dataFilter ) - data = s.dataFilter( data, type ); - - // The filter can actually parse the response - if( typeof data === "string" ){ - - // If the type is "script", eval it in global context - if ( type == "script" ) - jQuery.globalEval( data ); - - // Get the JavaScript object, if JSON is used. - if ( type == "json" ) - data = window["eval"]("(" + data + ")"); - } - - return data; - }, - - // Serialize an array of form elements or a set of - // key/values into a query string - param: function( a ) { - var s = [ ]; - - function add( key, value ){ - s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value); - }; - - // If an array was passed in, assume that it is an array - // of form elements - if ( jQuery.isArray(a) || a.jquery ) - // Serialize the form elements - jQuery.each( a, function(){ - add( this.name, this.value ); - }); - - // Otherwise, assume that it's an object of key/value pairs - else - // Serialize the key/values - for ( var j in a ) - // If the value is an array then the key names need to be repeated - if ( jQuery.isArray(a[j]) ) - jQuery.each( a[j], function(){ - add( j, this ); - }); - else - add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] ); - - // Return the resulting serialization - return s.join("&").replace(/%20/g, "+"); - } - -}); -var elemdisplay = {}, - timerId, - fxAttrs = [ - // height animations - [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], - // width animations - [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], - // opacity animations - [ "opacity" ] - ]; - -function genFx( type, num ){ - var obj = {}; - jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){ - obj[ this ] = type; - }); - return obj; -} - -jQuery.fn.extend({ - show: function(speed,callback){ - if ( speed ) { - return this.animate( genFx("show", 3), speed, callback); - } else { - for ( var i = 0, l = this.length; i < l; i++ ){ - var old = jQuery.data(this[i], "olddisplay"); - - this[i].style.display = old || ""; - - if ( jQuery.css(this[i], "display") === "none" ) { - var tagName = this[i].tagName, display; - - if ( elemdisplay[ tagName ] ) { - display = elemdisplay[ tagName ]; - } else { - var elem = jQuery("<" + tagName + " />").appendTo("body"); - - display = elem.css("display"); - if ( display === "none" ) - display = "block"; - - elem.remove(); - - elemdisplay[ tagName ] = display; - } - - this[i].style.display = jQuery.data(this[i], "olddisplay", display); - } - } - - return this; - } - }, - - hide: function(speed,callback){ - if ( speed ) { - return this.animate( genFx("hide", 3), speed, callback); - } else { - for ( var i = 0, l = this.length; i < l; i++ ){ - var old = jQuery.data(this[i], "olddisplay"); - if ( !old && old !== "none" ) - jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display")); - this[i].style.display = "none"; - } - return this; - } - }, - - // Save the old toggle function - _toggle: jQuery.fn.toggle, - - toggle: function( fn, fn2 ){ - var bool = typeof fn === "boolean"; - - return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? - this._toggle.apply( this, arguments ) : - fn == null || bool ? - this.each(function(){ - var state = bool ? fn : jQuery(this).is(":hidden"); - jQuery(this)[ state ? "show" : "hide" ](); - }) : - this.animate(genFx("toggle", 3), fn, fn2); - }, - - fadeTo: function(speed,to,callback){ - return this.animate({opacity: to}, speed, callback); - }, - - animate: function( prop, speed, easing, callback ) { - var optall = jQuery.speed(speed, easing, callback); - - return this[ optall.queue === false ? "each" : "queue" ](function(){ - - var opt = jQuery.extend({}, optall), p, - hidden = this.nodeType == 1 && jQuery(this).is(":hidden"), - self = this; - - for ( p in prop ) { - if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden ) - return opt.complete.call(this); - - if ( ( p == "height" || p == "width" ) && this.style ) { - // Store display property - opt.display = jQuery.css(this, "display"); - - // Make sure that nothing sneaks out - opt.overflow = this.style.overflow; - } - } - - if ( opt.overflow != null ) - this.style.overflow = "hidden"; - - opt.curAnim = jQuery.extend({}, prop); - - jQuery.each( prop, function(name, val){ - var e = new jQuery.fx( self, opt, name ); - - if ( /toggle|show|hide/.test(val) ) - e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop ); - else { - var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/), - start = e.cur(true) || 0; - - if ( parts ) { - var end = parseFloat(parts[2]), - unit = parts[3] || "px"; - - // We need to compute starting value - if ( unit != "px" ) { - self.style[ name ] = (end || 1) + unit; - start = ((end || 1) / e.cur(true)) * start; - self.style[ name ] = start + unit; - } - - // If a +=/-= token was provided, we're doing a relative animation - if ( parts[1] ) - end = ((parts[1] == "-=" ? -1 : 1) * end) + start; - - e.custom( start, end, unit ); - } else - e.custom( start, val, "" ); - } - }); - - // For JS strict compliance - return true; - }); - }, - - stop: function(clearQueue, gotoEnd){ - var timers = jQuery.timers; - - if (clearQueue) - this.queue([]); - - this.each(function(){ - // go in reverse order so anything added to the queue during the loop is ignored - for ( var i = timers.length - 1; i >= 0; i-- ) - if ( timers[i].elem == this ) { - if (gotoEnd) - // force the next step to be the last - timers[i](true); - timers.splice(i, 1); - } - }); - - // start the next in the queue if the last step wasn't forced - if (!gotoEnd) - this.dequeue(); - - return this; - } - -}); - -// Generate shortcuts for custom animations -jQuery.each({ - slideDown: genFx("show", 1), - slideUp: genFx("hide", 1), - slideToggle: genFx("toggle", 1), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" } -}, function( name, props ){ - jQuery.fn[ name ] = function( speed, callback ){ - return this.animate( props, speed, callback ); - }; -}); - -jQuery.extend({ - - speed: function(speed, easing, fn) { - var opt = typeof speed === "object" ? speed : { - complete: fn || !fn && easing || - jQuery.isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !jQuery.isFunction(easing) && easing - }; - - opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : - jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default; - - // Queueing - opt.old = opt.complete; - opt.complete = function(){ - if ( opt.queue !== false ) - jQuery(this).dequeue(); - if ( jQuery.isFunction( opt.old ) ) - opt.old.call( this ); - }; - - return opt; - }, - - easing: { - linear: function( p, n, firstNum, diff ) { - return firstNum + diff * p; - }, - swing: function( p, n, firstNum, diff ) { - return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; - } - }, - - timers: [], - - fx: function( elem, options, prop ){ - this.options = options; - this.elem = elem; - this.prop = prop; - - if ( !options.orig ) - options.orig = {}; - } - -}); - -jQuery.fx.prototype = { - - // Simple function for setting a style value - update: function(){ - if ( this.options.step ) - this.options.step.call( this.elem, this.now, this ); - - (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); - - // Set display property to block for height/width animations - if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style ) - this.elem.style.display = "block"; - }, - - // Get the current size - cur: function(force){ - if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) - return this.elem[ this.prop ]; - - var r = parseFloat(jQuery.css(this.elem, this.prop, force)); - return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0; - }, - - // Start an animation from one number to another - custom: function(from, to, unit){ - this.startTime = now(); - this.start = from; - this.end = to; - this.unit = unit || this.unit || "px"; - this.now = this.start; - this.pos = this.state = 0; - - var self = this; - function t(gotoEnd){ - return self.step(gotoEnd); - } - - t.elem = this.elem; - - if ( t() && jQuery.timers.push(t) == 1 ) { - timerId = setInterval(function(){ - var timers = jQuery.timers; - - for ( var i = 0; i < timers.length; i++ ) - if ( !timers[i]() ) - timers.splice(i--, 1); - - if ( !timers.length ) { - clearInterval( timerId ); - } - }, 13); - } - }, - - // Simple 'show' function - show: function(){ - // Remember where we started, so that we can go back to it later - this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); - this.options.show = true; - - // Begin the animation - // Make sure that we start at a small width/height to avoid any - // flash of content - this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur()); - - // Start by showing the element - jQuery(this.elem).show(); - }, - - // Simple 'hide' function - hide: function(){ - // Remember where we started, so that we can go back to it later - this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); - this.options.hide = true; - - // Begin the animation - this.custom(this.cur(), 0); - }, - - // Each step of an animation - step: function(gotoEnd){ - var t = now(); - - if ( gotoEnd || t >= this.options.duration + this.startTime ) { - this.now = this.end; - this.pos = this.state = 1; - this.update(); - - this.options.curAnim[ this.prop ] = true; - - var done = true; - for ( var i in this.options.curAnim ) - if ( this.options.curAnim[i] !== true ) - done = false; - - if ( done ) { - if ( this.options.display != null ) { - // Reset the overflow - this.elem.style.overflow = this.options.overflow; - - // Reset the display - this.elem.style.display = this.options.display; - if ( jQuery.css(this.elem, "display") == "none" ) - this.elem.style.display = "block"; - } - - // Hide the element if the "hide" operation was done - if ( this.options.hide ) - jQuery(this.elem).hide(); - - // Reset the properties, if the item has been hidden or shown - if ( this.options.hide || this.options.show ) - for ( var p in this.options.curAnim ) - jQuery.attr(this.elem.style, p, this.options.orig[p]); - - // Execute the complete function - this.options.complete.call( this.elem ); - } - - return false; - } else { - var n = t - this.startTime; - this.state = n / this.options.duration; - - // Perform the easing function, defaults to swing - this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration); - this.now = this.start + ((this.end - this.start) * this.pos); - - // Perform the next step of the animation - this.update(); - } - - return true; - } - -}; - -jQuery.extend( jQuery.fx, { - speeds:{ - slow: 600, - fast: 200, - // Default speed - _default: 400 - }, - step: { - - opacity: function(fx){ - jQuery.attr(fx.elem.style, "opacity", fx.now); - }, - - _default: function(fx){ - if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) - fx.elem.style[ fx.prop ] = fx.now + fx.unit; - else - fx.elem[ fx.prop ] = fx.now; - } - } -}); -if ( document.documentElement["getBoundingClientRect"] ) - jQuery.fn.offset = function() { - if ( !this[0] ) return { top: 0, left: 0 }; - if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] ); - var box = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement, - clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, - top = box.top + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop, - left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft; - return { top: top, left: left }; - }; -else - jQuery.fn.offset = function() { - if ( !this[0] ) return { top: 0, left: 0 }; - if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] ); - jQuery.offset.initialized || jQuery.offset.initialize(); - - var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem, - doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement, - body = doc.body, defaultView = doc.defaultView, - prevComputedStyle = defaultView.getComputedStyle(elem, null), - top = elem.offsetTop, left = elem.offsetLeft; - - while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { - computedStyle = defaultView.getComputedStyle(elem, null); - top -= elem.scrollTop, left -= elem.scrollLeft; - if ( elem === offsetParent ) { - top += elem.offsetTop, left += elem.offsetLeft; - if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) ) - top += parseInt( computedStyle.borderTopWidth, 10) || 0, - left += parseInt( computedStyle.borderLeftWidth, 10) || 0; - prevOffsetParent = offsetParent, offsetParent = elem.offsetParent; - } - if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) - top += parseInt( computedStyle.borderTopWidth, 10) || 0, - left += parseInt( computedStyle.borderLeftWidth, 10) || 0; - prevComputedStyle = computedStyle; - } - - if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) - top += body.offsetTop, - left += body.offsetLeft; - - if ( prevComputedStyle.position === "fixed" ) - top += Math.max(docElem.scrollTop, body.scrollTop), - left += Math.max(docElem.scrollLeft, body.scrollLeft); - - return { top: top, left: left }; - }; - -jQuery.offset = { - initialize: function() { - if ( this.initialized ) return; - var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop, - html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>'; - - rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' }; - for ( prop in rules ) container.style[prop] = rules[prop]; - - container.innerHTML = html; - body.insertBefore(container, body.firstChild); - innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild; - - this.doesNotAddBorder = (checkDiv.offsetTop !== 5); - this.doesAddBorderForTableAndCells = (td.offsetTop === 5); - - innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative'; - this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); - - body.style.marginTop = '1px'; - this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0); - body.style.marginTop = bodyMarginTop; - - body.removeChild(container); - this.initialized = true; - }, - - bodyOffset: function(body) { - jQuery.offset.initialized || jQuery.offset.initialize(); - var top = body.offsetTop, left = body.offsetLeft; - if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) - top += parseInt( jQuery.curCSS(body, 'marginTop', true), 10 ) || 0, - left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0; - return { top: top, left: left }; - } -}; - - -jQuery.fn.extend({ - position: function() { - var left = 0, top = 0, results; - - if ( this[0] ) { - // Get *real* offsetParent - var offsetParent = this.offsetParent(), - - // Get correct offsets - offset = this.offset(), - parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset(); - - // Subtract element margins - // note: when an element has margin: auto the offsetLeft and marginLeft - // are the same in Safari causing offset.left to incorrectly be 0 - offset.top -= num( this, 'marginTop' ); - offset.left -= num( this, 'marginLeft' ); - - // Add offsetParent borders - parentOffset.top += num( offsetParent, 'borderTopWidth' ); - parentOffset.left += num( offsetParent, 'borderLeftWidth' ); - - // Subtract the two offsets - results = { - top: offset.top - parentOffset.top, - left: offset.left - parentOffset.left - }; - } - - return results; - }, - - offsetParent: function() { - var offsetParent = this[0].offsetParent || document.body; - while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') ) - offsetParent = offsetParent.offsetParent; - return jQuery(offsetParent); - } -}); - - -// Create scrollLeft and scrollTop methods -jQuery.each( ['Left', 'Top'], function(i, name) { - var method = 'scroll' + name; - - jQuery.fn[ method ] = function(val) { - if (!this[0]) return null; - - return val !== undefined ? - - // Set the scroll offset - this.each(function() { - this == window || this == document ? - window.scrollTo( - !i ? val : jQuery(window).scrollLeft(), - i ? val : jQuery(window).scrollTop() - ) : - this[ method ] = val; - }) : - - // Return the scroll offset - this[0] == window || this[0] == document ? - self[ i ? 'pageYOffset' : 'pageXOffset' ] || - jQuery.boxModel && document.documentElement[ method ] || - document.body[ method ] : - this[0][ method ]; - }; -}); -// Create innerHeight, innerWidth, outerHeight and outerWidth methods -jQuery.each([ "Height", "Width" ], function(i, name){ - - var tl = i ? "Left" : "Top", // top or left - br = i ? "Right" : "Bottom"; // bottom or right - - // innerHeight and innerWidth - jQuery.fn["inner" + name] = function(){ - return this[ name.toLowerCase() ]() + - num(this, "padding" + tl) + - num(this, "padding" + br); - }; - - // outerHeight and outerWidth - jQuery.fn["outer" + name] = function(margin) { - return this["inner" + name]() + - num(this, "border" + tl + "Width") + - num(this, "border" + br + "Width") + - (margin ? - num(this, "margin" + tl) + num(this, "margin" + br) : 0); - }; - - var type = name.toLowerCase(); - - jQuery.fn[ type ] = function( size ) { - // Get window width or height - return this[0] == window ? - // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode - document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || - document.body[ "client" + name ] : - - // Get document width or height - this[0] == document ? - // Either scroll[Width/Height] or offset[Width/Height], whichever is greater - Math.max( - document.documentElement["client" + name], - document.body["scroll" + name], document.documentElement["scroll" + name], - document.body["offset" + name], document.documentElement["offset" + name] - ) : - - // Get or set width or height on the element - size === undefined ? - // Get width or height on the element - (this.length ? jQuery.css( this[0], type ) : null) : - - // Set the width or height on the element (default to pixels if value is unitless) - this.css( type, typeof size === "string" ? size : size + "px" ); - }; - -});})(); diff --git a/projecttemplates/WebFormsRelyingParty/scripts/jquery-ui-personalized-1.6rc6.js b/projecttemplates/WebFormsRelyingParty/scripts/jquery-ui-personalized-1.6rc6.js deleted file mode 100644 index 71bea46..0000000 --- a/projecttemplates/WebFormsRelyingParty/scripts/jquery-ui-personalized-1.6rc6.js +++ /dev/null @@ -1,4126 +0,0 @@ -/* - * jQuery UI 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI - */ -;(function($) { - -var _remove = $.fn.remove, - isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9); - -//Helper functions and ui object -$.ui = { - version: "1.6rc6", - - // $.ui.plugin is deprecated. Use the proxy pattern instead. - plugin: { - add: function(module, option, set) { - var proto = $.ui[module].prototype; - for(var i in set) { - proto.plugins[i] = proto.plugins[i] || []; - proto.plugins[i].push([option, set[i]]); - } - }, - call: function(instance, name, args) { - var set = instance.plugins[name]; - if(!set) { return; } - - for (var i = 0; i < set.length; i++) { - if (instance.options[set[i][0]]) { - set[i][1].apply(instance.element, args); - } - } - } - }, - - contains: function(a, b) { - return document.compareDocumentPosition - ? a.compareDocumentPosition(b) & 16 - : a !== b && a.contains(b); - }, - - cssCache: {}, - css: function(name) { - if ($.ui.cssCache[name]) { return $.ui.cssCache[name]; } - var tmp = $('<div class="ui-gen"></div>').addClass(name).css({position:'absolute', top:'-5000px', left:'-5000px', display:'block'}).appendTo('body'); - - //if (!$.browser.safari) - //tmp.appendTo('body'); - - //Opera and Safari set width and height to 0px instead of auto - //Safari returns rgba(0,0,0,0) when bgcolor is not set - $.ui.cssCache[name] = !!( - (!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) || - !(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))) - ); - try { $('body').get(0).removeChild(tmp.get(0)); } catch(e){} - return $.ui.cssCache[name]; - }, - - hasScroll: function(el, a) { - - //If overflow is hidden, the element might have extra content, but the user wants to hide it - if ($(el).css('overflow') == 'hidden') { return false; } - - var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop', - has = false; - - if (el[scroll] > 0) { return true; } - - // TODO: determine which cases actually cause this to happen - // if the element doesn't have the scroll set, see if it's possible to - // set the scroll - el[scroll] = 1; - has = (el[scroll] > 0); - el[scroll] = 0; - return has; - }, - - isOverAxis: function(x, reference, size) { - //Determines when x coordinate is over "b" element axis - return (x > reference) && (x < (reference + size)); - }, - - isOver: function(y, x, top, left, height, width) { - //Determines when x, y coordinates is over "b" element - return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width); - }, - - keyCode: { - BACKSPACE: 8, - CAPS_LOCK: 20, - COMMA: 188, - CONTROL: 17, - DELETE: 46, - DOWN: 40, - END: 35, - ENTER: 13, - ESCAPE: 27, - HOME: 36, - INSERT: 45, - LEFT: 37, - NUMPAD_ADD: 107, - NUMPAD_DECIMAL: 110, - NUMPAD_DIVIDE: 111, - NUMPAD_ENTER: 108, - NUMPAD_MULTIPLY: 106, - NUMPAD_SUBTRACT: 109, - PAGE_DOWN: 34, - PAGE_UP: 33, - PERIOD: 190, - RIGHT: 39, - SHIFT: 16, - SPACE: 32, - TAB: 9, - UP: 38 - } -}; - -// WAI-ARIA normalization -if (isFF2) { - var attr = $.attr, - removeAttr = $.fn.removeAttr, - ariaNS = "http://www.w3.org/2005/07/aaa", - ariaState = /^aria-/, - ariaRole = /^wairole:/; - - $.attr = function(elem, name, value) { - var set = value !== undefined; - - return (name == 'role' - ? (set - ? attr.call(this, elem, name, "wairole:" + value) - : (attr.apply(this, arguments) || "").replace(ariaRole, "")) - : (ariaState.test(name) - ? (set - ? elem.setAttributeNS(ariaNS, - name.replace(ariaState, "aaa:"), value) - : attr.call(this, elem, name.replace(ariaState, "aaa:"))) - : attr.apply(this, arguments))); - }; - - $.fn.removeAttr = function(name) { - return (ariaState.test(name) - ? this.each(function() { - this.removeAttributeNS(ariaNS, name.replace(ariaState, "")); - }) : removeAttr.call(this, name)); - }; -} - -//jQuery plugins -$.fn.extend({ - remove: function() { - // Safari has a native remove event which actually removes DOM elements, - // so we have to use triggerHandler instead of trigger (#3037). - $("*", this).add(this).each(function() { - $(this).triggerHandler("remove"); - }); - return _remove.apply(this, arguments ); - }, - - enableSelection: function() { - return this - .attr('unselectable', 'off') - .css('MozUserSelect', '') - .unbind('selectstart.ui'); - }, - - disableSelection: function() { - return this - .attr('unselectable', 'on') - .css('MozUserSelect', 'none') - .bind('selectstart.ui', function() { return false; }); - }, - - scrollParent: function() { - var scrollParent; - if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { - scrollParent = this.parents().filter(function() { - return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); - }).eq(0); - } else { - scrollParent = this.parents().filter(function() { - return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); - }).eq(0); - } - - return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; - } -}); - - -//Additional selectors -$.extend($.expr[':'], { - data: function(elem, i, match) { - return !!$.data(elem, match[3]); - }, - - focusable: function(element) { - var nodeName = element.nodeName.toLowerCase(), - tabIndex = $.attr(element, 'tabindex'); - return (/input|select|textarea|button|object/.test(nodeName) - ? !element.disabled - : 'a' == nodeName || 'area' == nodeName - ? element.href || !isNaN(tabIndex) - : !isNaN(tabIndex)) - // the element and all of its ancestors must be visible - // the browser may report that the area is hidden - && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length; - }, - - tabbable: function(element) { - var tabIndex = $.attr(element, 'tabindex'); - return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable'); - } -}); - - -// $.widget is a factory to create jQuery plugins -// taking some boilerplate code out of the plugin code -function getter(namespace, plugin, method, args) { - function getMethods(type) { - var methods = $[namespace][plugin][type] || []; - return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods); - } - - var methods = getMethods('getter'); - if (args.length == 1 && typeof args[0] == 'string') { - methods = methods.concat(getMethods('getterSetter')); - } - return ($.inArray(method, methods) != -1); -} - -$.widget = function(name, prototype) { - var namespace = name.split(".")[0]; - name = name.split(".")[1]; - - // create plugin method - $.fn[name] = function(options) { - var isMethodCall = (typeof options == 'string'), - args = Array.prototype.slice.call(arguments, 1); - - // prevent calls to internal methods - if (isMethodCall && options.substring(0, 1) == '_') { - return this; - } - - // handle getter methods - if (isMethodCall && getter(namespace, name, options, args)) { - var instance = $.data(this[0], name); - return (instance ? instance[options].apply(instance, args) - : undefined); - } - - // handle initialization and non-getter methods - return this.each(function() { - var instance = $.data(this, name); - - // constructor - (!instance && !isMethodCall && - $.data(this, name, new $[namespace][name](this, options))._init()); - - // method call - (instance && isMethodCall && $.isFunction(instance[options]) && - instance[options].apply(instance, args)); - }); - }; - - // create widget constructor - $[namespace] = $[namespace] || {}; - $[namespace][name] = function(element, options) { - var self = this; - - this.namespace = namespace; - this.widgetName = name; - this.widgetEventPrefix = $[namespace][name].eventPrefix || name; - this.widgetBaseClass = namespace + '-' + name; - - this.options = $.extend({}, - $.widget.defaults, - $[namespace][name].defaults, - $.metadata && $.metadata.get(element)[name], - options); - - this.element = $(element) - .bind('setData.' + name, function(event, key, value) { - if (event.target == element) { - return self._setData(key, value); - } - }) - .bind('getData.' + name, function(event, key) { - if (event.target == element) { - return self._getData(key); - } - }) - .bind('remove', function() { - return self.destroy(); - }); - }; - - // add widget prototype - $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype); - - // TODO: merge getter and getterSetter properties from widget prototype - // and plugin prototype - $[namespace][name].getterSetter = 'option'; -}; - -$.widget.prototype = { - _init: function() {}, - destroy: function() { - this.element.removeData(this.widgetName) - .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled') - .removeAttr('aria-disabled'); - }, - - option: function(key, value) { - var options = key, - self = this; - - if (typeof key == "string") { - if (value === undefined) { - return this._getData(key); - } - options = {}; - options[key] = value; - } - - $.each(options, function(key, value) { - self._setData(key, value); - }); - }, - _getData: function(key) { - return this.options[key]; - }, - _setData: function(key, value) { - this.options[key] = value; - - if (key == 'disabled') { - this.element - [value ? 'addClass' : 'removeClass']( - this.widgetBaseClass + '-disabled' + ' ' + - this.namespace + '-state-disabled') - .attr("aria-disabled", value); - } - }, - - enable: function() { - this._setData('disabled', false); - }, - disable: function() { - this._setData('disabled', true); - }, - - _trigger: function(type, event, data) { - var callback = this.options[type], - eventName = (type == this.widgetEventPrefix - ? type : this.widgetEventPrefix + type); - - event = $.Event(event); - event.type = eventName; - - // copy original event properties over to the new event - // this would happen if we could call $.event.fix instead of $.Event - // but we don't have a way to force an event to be fixed multiple times - if (event.originalEvent) { - for (var i = $.event.props.length, prop; i;) { - prop = $.event.props[--i]; - event[prop] = event.originalEvent[prop]; - } - } - - this.element.trigger(event, data); - - return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false - || event.isDefaultPrevented()); - } -}; - -$.widget.defaults = { - disabled: false -}; - - -/** Mouse Interaction Plugin **/ - -$.ui.mouse = { - _mouseInit: function() { - var self = this; - - this.element - .bind('mousedown.'+this.widgetName, function(event) { - return self._mouseDown(event); - }) - .bind('click.'+this.widgetName, function(event) { - if(self._preventClickEvent) { - self._preventClickEvent = false; - return false; - } - }); - - // Prevent text selection in IE - if ($.browser.msie) { - this._mouseUnselectable = this.element.attr('unselectable'); - this.element.attr('unselectable', 'on'); - } - - this.started = false; - }, - - // TODO: make sure destroying one instance of mouse doesn't mess with - // other instances of mouse - _mouseDestroy: function() { - this.element.unbind('.'+this.widgetName); - - // Restore text selection in IE - ($.browser.msie - && this.element.attr('unselectable', this._mouseUnselectable)); - }, - - _mouseDown: function(event) { - // don't let more than one widget handle mouseStart - if (event.originalEvent.mouseHandled) { return; } - - // we may have missed mouseup (out of window) - (this._mouseStarted && this._mouseUp(event)); - - this._mouseDownEvent = event; - - var self = this, - btnIsLeft = (event.which == 1), - elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false); - if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { - return true; - } - - this.mouseDelayMet = !this.options.delay; - if (!this.mouseDelayMet) { - this._mouseDelayTimer = setTimeout(function() { - self.mouseDelayMet = true; - }, this.options.delay); - } - - if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { - this._mouseStarted = (this._mouseStart(event) !== false); - if (!this._mouseStarted) { - event.preventDefault(); - return true; - } - } - - // these delegates are required to keep context - this._mouseMoveDelegate = function(event) { - return self._mouseMove(event); - }; - this._mouseUpDelegate = function(event) { - return self._mouseUp(event); - }; - $(document) - .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) - .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); - - // preventDefault() is used to prevent the selection of text here - - // however, in Safari, this causes select boxes not to be selectable - // anymore, so this fix is needed - ($.browser.safari || event.preventDefault()); - - event.originalEvent.mouseHandled = true; - return true; - }, - - _mouseMove: function(event) { - // IE mouseup check - mouseup happened when mouse was out of window - if ($.browser.msie && !event.button) { - return this._mouseUp(event); - } - - if (this._mouseStarted) { - this._mouseDrag(event); - return event.preventDefault(); - } - - if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { - this._mouseStarted = - (this._mouseStart(this._mouseDownEvent, event) !== false); - (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); - } - - return !this._mouseStarted; - }, - - _mouseUp: function(event) { - $(document) - .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) - .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); - - if (this._mouseStarted) { - this._mouseStarted = false; - this._preventClickEvent = true; - this._mouseStop(event); - } - - return false; - }, - - _mouseDistanceMet: function(event) { - return (Math.max( - Math.abs(this._mouseDownEvent.pageX - event.pageX), - Math.abs(this._mouseDownEvent.pageY - event.pageY) - ) >= this.options.distance - ); - }, - - _mouseDelayMet: function(event) { - return this.mouseDelayMet; - }, - - // These are placeholder methods, to be overriden by extending plugin - _mouseStart: function(event) {}, - _mouseDrag: function(event) {}, - _mouseStop: function(event) {}, - _mouseCapture: function(event) { return true; } -}; - -$.ui.mouse.defaults = { - cancel: null, - distance: 1, - delay: 0 -}; - -})(jQuery); -/* - * jQuery UI Draggable 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * ui.core.js - */ -(function($) { - -$.widget("ui.draggable", $.extend({}, $.ui.mouse, { - - _init: function() { - - if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position"))) - this.element[0].style.position = 'relative'; - - (this.options.cssNamespace && this.element.addClass(this.options.cssNamespace+"-draggable")); - (this.options.disabled && this.element.addClass(this.options.cssNamespace+'-draggable-disabled')); - - this._mouseInit(); - - }, - - destroy: function() { - if(!this.element.data('draggable')) return; - this.element.removeData("draggable").unbind(".draggable").removeClass(this.options.cssNamespace+'-draggable '+this.options.cssNamespace+'-draggable-dragging '+this.options.cssNamespace+'-draggable-disabled'); - this._mouseDestroy(); - }, - - _mouseCapture: function(event) { - - var o = this.options; - - if (this.helper || o.disabled || $(event.target).is('.'+this.options.cssNamespace+'-resizable-handle')) - return false; - - //Quit if we're not on a valid handle - this.handle = this._getHandle(event); - if (!this.handle) - return false; - - return true; - - }, - - _mouseStart: function(event) { - - var o = this.options; - - //Create and append the visible helper - this.helper = this._createHelper(event); - - //Cache the helper size - this._cacheHelperProportions(); - - //If ddmanager is used for droppables, set the global draggable - if($.ui.ddmanager) - $.ui.ddmanager.current = this; - - /* - * - Position generation - - * This block generates everything position related - it's the core of draggables. - */ - - //Cache the margins of the original element - this._cacheMargins(); - - //Store the helper's css position - this.cssPosition = this.helper.css("position"); - this.scrollParent = this.helper.scrollParent(); - - //The element's absolute position on the page minus margins - this.offset = this.element.offset(); - this.offset = { - top: this.offset.top - this.margins.top, - left: this.offset.left - this.margins.left - }; - - $.extend(this.offset, { - click: { //Where the click happened, relative to the element - left: event.pageX - this.offset.left, - top: event.pageY - this.offset.top - }, - parent: this._getParentOffset(), - relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper - }); - - //Generate the original position - this.originalPosition = this._generatePosition(event); - this.originalPageX = event.pageX; - this.originalPageY = event.pageY; - - //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied - if(o.cursorAt) - this._adjustOffsetFromHelper(o.cursorAt); - - //Set a containment if given in the options - if(o.containment) - this._setContainment(); - - //Call plugins and callbacks - this._trigger("start", event); - - //Recache the helper size - this._cacheHelperProportions(); - - //Prepare the droppable offsets - if ($.ui.ddmanager && !o.dropBehaviour) - $.ui.ddmanager.prepareOffsets(this, event); - - this.helper.addClass(o.cssNamespace+"-draggable-dragging"); - this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position - return true; - }, - - _mouseDrag: function(event, noPropagation) { - - //Compute the helpers position - this.position = this._generatePosition(event); - this.positionAbs = this._convertPositionTo("absolute"); - - //Call plugins and callbacks and use the resulting position if something is returned - if (!noPropagation) { - var ui = this._uiHash(); - this._trigger('drag', event, ui); - this.position = ui.position; - } - - if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; - if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; - if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); - - return false; - }, - - _mouseStop: function(event) { - - //If we are using droppables, inform the manager about the drop - var dropped = false; - if ($.ui.ddmanager && !this.options.dropBehaviour) - dropped = $.ui.ddmanager.drop(this, event); - - //if a drop comes from outside (a sortable) - if(this.dropped) { - dropped = this.dropped; - this.dropped = false; - } - - if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { - var self = this; - $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { - self._trigger("stop", event); - self._clear(); - }); - } else { - this._trigger("stop", event); - this._clear(); - } - - return false; - }, - - _getHandle: function(event) { - - var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; - $(this.options.handle, this.element) - .find("*") - .andSelf() - .each(function() { - if(this == event.target) handle = true; - }); - - return handle; - - }, - - _createHelper: function(event) { - - var o = this.options; - var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element); - - if(!helper.parents('body').length) - helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); - - if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) - helper.css("position", "absolute"); - - return helper; - - }, - - _adjustOffsetFromHelper: function(obj) { - if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left; - if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; - if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top; - if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; - }, - - _getParentOffset: function() { - - //Get the offsetParent and cache its position - this.offsetParent = this.helper.offsetParent(); - var po = this.offsetParent.offset(); - - // This is a special case where we need to modify a offset calculated on start, since the following happened: - // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent - // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that - // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag - if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { - po.left += this.scrollParent.scrollLeft(); - po.top += this.scrollParent.scrollTop(); - } - - if((this.offsetParent[0] == document.body && $.browser.mozilla) //Ugly FF3 fix - || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix - po = { top: 0, left: 0 }; - - return { - top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), - left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) - }; - - }, - - _getRelativeOffset: function() { - - if(this.cssPosition == "relative") { - var p = this.element.position(); - return { - top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), - left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() - }; - } else { - return { top: 0, left: 0 }; - } - - }, - - _cacheMargins: function() { - this.margins = { - left: (parseInt(this.element.css("marginLeft"),10) || 0), - top: (parseInt(this.element.css("marginTop"),10) || 0) - }; - }, - - _cacheHelperProportions: function() { - this.helperProportions = { - width: this.helper.outerWidth(), - height: this.helper.outerHeight() - }; - }, - - _setContainment: function() { - - var o = this.options; - if(o.containment == 'parent') o.containment = this.helper[0].parentNode; - if(o.containment == 'document' || o.containment == 'window') this.containment = [ - 0 - this.offset.relative.left - this.offset.parent.left, - 0 - this.offset.relative.top - this.offset.parent.top, - $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, - ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top - ]; - - if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) { - var ce = $(o.containment)[0]; if(!ce) return; - var co = $(o.containment).offset(); - var over = ($(ce).css("overflow") != 'hidden'); - - this.containment = [ - co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, - co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, - co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, - co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - ]; - } else if(o.containment.constructor == Array) { - this.containment = o.containment; - } - - }, - - _convertPositionTo: function(d, pos) { - - if(!pos) pos = this.position; - var mod = d == "absolute" ? 1 : -1; - var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); - - return { - top: ( - pos.top // The absolute mouse position - + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent - + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) - - ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod - ), - left: ( - pos.left // The absolute mouse position - + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent - + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) - - ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod - ) - }; - - }, - - _generatePosition: function(event) { - - var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); - - // This is another very weird special case that only happens for relative elements: - // 1. If the css position is relative - // 2. and the scroll parent is the document or similar to the offset parent - // we have to refresh the relative offset during the scroll so there are no jumps - if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { - this.offset.relative = this._getRelativeOffset(); - } - - var pageX = event.pageX; - var pageY = event.pageY; - - /* - * - Position constraining - - * Constrain the position to a mix of grid, containment. - */ - - if(this.originalPosition) { //If we are not dragging yet, we won't check for options - - if(this.containment) { - if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left; - if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top; - if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; - if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; - } - - if(o.grid) { - var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; - pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; - - var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; - pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; - } - - } - - return { - top: ( - pageY // The absolute mouse position - - this.offset.click.top // Click offset (relative to the element) - - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent - - this.offset.parent.top // The offsetParent's offset without borders (offset + border) - + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) - ), - left: ( - pageX // The absolute mouse position - - this.offset.click.left // Click offset (relative to the element) - - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent - - this.offset.parent.left // The offsetParent's offset without borders (offset + border) - + ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) - ) - }; - - }, - - _clear: function() { - this.helper.removeClass(this.options.cssNamespace+"-draggable-dragging"); - if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove(); - //if($.ui.ddmanager) $.ui.ddmanager.current = null; - this.helper = null; - this.cancelHelperRemoval = false; - }, - - // From now on bulk stuff - mainly helpers - - _trigger: function(type, event, ui) { - ui = ui || this._uiHash(); - $.ui.plugin.call(this, type, [event, ui]); - if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins - return $.widget.prototype._trigger.call(this, type, event, ui); - }, - - plugins: {}, - - _uiHash: function(event) { - return { - helper: this.helper, - position: this.position, - absolutePosition: this.positionAbs, //deprecated - offset: this.positionAbs - }; - } - -})); - -$.extend($.ui.draggable, { - version: "1.6rc6", - eventPrefix: "drag", - defaults: { - appendTo: "parent", - axis: false, - cancel: ":input,option", - connectToSortable: false, - containment: false, - cssNamespace: "ui", - cursor: "default", - cursorAt: false, - delay: 0, - distance: 1, - grid: false, - handle: false, - helper: "original", - iframeFix: false, - opacity: false, - refreshPositions: false, - revert: false, - revertDuration: 500, - scope: "default", - scroll: true, - scrollSensitivity: 20, - scrollSpeed: 20, - snap: false, - snapMode: "both", - snapTolerance: 20, - stack: false, - zIndex: false - } -}); - -$.ui.plugin.add("draggable", "connectToSortable", { - start: function(event, ui) { - - var inst = $(this).data("draggable"), o = inst.options; - inst.sortables = []; - $(o.connectToSortable).each(function() { - // 'this' points to a string, and should therefore resolved as query, but instead, if the string is assigned to a variable, it loops through the strings properties, - // so we have to append '' to make it anonymous again - $(typeof this == 'string' ? this+'': this).each(function() { - if($.data(this, 'sortable')) { - var sortable = $.data(this, 'sortable'); - inst.sortables.push({ - instance: sortable, - shouldRevert: sortable.options.revert - }); - sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache - sortable._trigger("activate", event, inst); - } - }); - }); - - }, - stop: function(event, ui) { - - //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper - var inst = $(this).data("draggable"); - - $.each(inst.sortables, function() { - if(this.instance.isOver) { - - this.instance.isOver = 0; - - inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance - this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) - - //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid' - if(this.shouldRevert) this.instance.options.revert = true; - - //Trigger the stop of the sortable - this.instance._mouseStop(event); - - this.instance.options.helper = this.instance.options._helper; - - //If the helper has been the original item, restore properties in the sortable - if(inst.options.helper == 'original') - this.instance.currentItem.css({ top: 'auto', left: 'auto' }); - - } else { - this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance - this.instance._trigger("deactivate", event, inst); - } - - }); - - }, - drag: function(event, ui) { - - var inst = $(this).data("draggable"), self = this; - - var checkPos = function(o) { - var dyClick = this.offset.click.top, dxClick = this.offset.click.left; - var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left; - var itemHeight = o.height, itemWidth = o.width; - var itemTop = o.top, itemLeft = o.left; - - return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth); - }; - - $.each(inst.sortables, function(i) { - - if(checkPos.call(inst, this.instance.containerCache)) { - - //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once - if(!this.instance.isOver) { - this.instance.isOver = 1; - //Now we fake the start of dragging for the sortable instance, - //by cloning the list group item, appending it to the sortable and using it as inst.currentItem - //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) - this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true); - this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it - this.instance.options.helper = function() { return ui.helper[0]; }; - - event.target = this.instance.currentItem[0]; - this.instance._mouseCapture(event, true); - this.instance._mouseStart(event, true, true); - - //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes - this.instance.offset.click.top = inst.offset.click.top; - this.instance.offset.click.left = inst.offset.click.left; - this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; - this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; - - inst._trigger("toSortable", event); - inst.dropped = this.instance.element; //draggable revert needs that - this.instance.fromOutside = inst; //Little hack so receive/update callbacks work - - } - - //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable - if(this.instance.currentItem) this.instance._mouseDrag(event); - - } else { - - //If it doesn't intersect with the sortable, and it intersected before, - //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval - if(this.instance.isOver) { - this.instance.isOver = 0; - this.instance.cancelHelperRemoval = true; - this.instance.options.revert = false; //No revert here - this.instance._mouseStop(event, true); - this.instance.options.helper = this.instance.options._helper; - - //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size - this.instance.currentItem.remove(); - if(this.instance.placeholder) this.instance.placeholder.remove(); - - inst._trigger("fromSortable", event); - inst.dropped = false; //draggable revert needs that - } - - }; - - }); - - } -}); - -$.ui.plugin.add("draggable", "cursor", { - start: function(event, ui) { - var t = $('body'), o = $(this).data('draggable').options; - if (t.css("cursor")) o._cursor = t.css("cursor"); - t.css("cursor", o.cursor); - }, - stop: function(event, ui) { - var o = $(this).data('draggable').options; - if (o._cursor) $('body').css("cursor", o._cursor); - } -}); - -$.ui.plugin.add("draggable", "iframeFix", { - start: function(event, ui) { - var o = $(this).data('draggable').options; - $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { - $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>') - .css({ - width: this.offsetWidth+"px", height: this.offsetHeight+"px", - position: "absolute", opacity: "0.001", zIndex: 1000 - }) - .css($(this).offset()) - .appendTo("body"); - }); - }, - stop: function(event, ui) { - $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers - } -}); - -$.ui.plugin.add("draggable", "opacity", { - start: function(event, ui) { - var t = $(ui.helper), o = $(this).data('draggable').options; - if(t.css("opacity")) o._opacity = t.css("opacity"); - t.css('opacity', o.opacity); - }, - stop: function(event, ui) { - var o = $(this).data('draggable').options; - if(o._opacity) $(ui.helper).css('opacity', o._opacity); - } -}); - -$.ui.plugin.add("draggable", "scroll", { - start: function(event, ui) { - var i = $(this).data("draggable"); - if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); - }, - drag: function(event, ui) { - - var i = $(this).data("draggable"), o = i.options, scrolled = false; - - if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { - - if(!o.axis || o.axis != 'x') { - if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) - i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed; - else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) - i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed; - } - - if(!o.axis || o.axis != 'y') { - if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) - i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed; - else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) - i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed; - } - - } else { - - if(!o.axis || o.axis != 'x') { - if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) - scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); - else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) - scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); - } - - if(!o.axis || o.axis != 'y') { - if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) - scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); - else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) - scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); - } - - } - - if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) - $.ui.ddmanager.prepareOffsets(i, event); - - } -}); - -$.ui.plugin.add("draggable", "snap", { - start: function(event, ui) { - - var i = $(this).data("draggable"), o = i.options; - i.snapElements = []; - - $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() { - var $t = $(this); var $o = $t.offset(); - if(this != i.element[0]) i.snapElements.push({ - item: this, - width: $t.outerWidth(), height: $t.outerHeight(), - top: $o.top, left: $o.left - }); - }); - - }, - drag: function(event, ui) { - - var inst = $(this).data("draggable"), o = inst.options; - var d = o.snapTolerance; - - var x1 = ui.absolutePosition.left, x2 = x1 + inst.helperProportions.width, - y1 = ui.absolutePosition.top, y2 = y1 + inst.helperProportions.height; - - for (var i = inst.snapElements.length - 1; i >= 0; i--){ - - var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width, - t = inst.snapElements[i].top, b = t + inst.snapElements[i].height; - - //Yes, I know, this is insane ;) - if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) { - if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); - inst.snapElements[i].snapping = false; - continue; - } - - if(o.snapMode != 'inner') { - var ts = Math.abs(t - y2) <= d; - var bs = Math.abs(b - y1) <= d; - var ls = Math.abs(l - x2) <= d; - var rs = Math.abs(r - x1) <= d; - if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top; - if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top; - if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left; - if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left; - } - - var first = (ts || bs || ls || rs); - - if(o.snapMode != 'outer') { - var ts = Math.abs(t - y1) <= d; - var bs = Math.abs(b - y2) <= d; - var ls = Math.abs(l - x1) <= d; - var rs = Math.abs(r - x2) <= d; - if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top; - if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top; - if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left; - if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left; - } - - if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) - (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); - inst.snapElements[i].snapping = (ts || bs || ls || rs || first); - - }; - - } -}); - -$.ui.plugin.add("draggable", "stack", { - start: function(event, ui) { - - var o = $(this).data("draggable").options; - - var group = $.makeArray($(o.stack.group)).sort(function(a,b) { - return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min); - }); - - $(group).each(function(i) { - this.style.zIndex = o.stack.min + i; - }); - - this[0].style.zIndex = o.stack.min + group.length; - - } -}); - -$.ui.plugin.add("draggable", "zIndex", { - start: function(event, ui) { - var t = $(ui.helper), o = $(this).data("draggable").options; - if(t.css("zIndex")) o._zIndex = t.css("zIndex"); - t.css('zIndex', o.zIndex); - }, - stop: function(event, ui) { - var o = $(this).data("draggable").options; - if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex); - } -}); - -})(jQuery); -/* - * jQuery UI Resizable 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Resizables - * - * Depends: - * ui.core.js - */ -(function($) { - -$.widget("ui.resizable", $.extend({}, $.ui.mouse, { - - _init: function() { - - var self = this, o = this.options; - this.element.addClass("ui-resizable"); - - $.extend(this, { - _aspectRatio: !!(o.aspectRatio), - aspectRatio: o.aspectRatio, - originalElement: this.element, - proportionallyResize: o.proportionallyResize ? [o.proportionallyResize] : [], - _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null - }); - - //Wrap the element if it cannot hold child nodes - if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { - - //Opera fix for relative positioning - if (/relative/.test(this.element.css('position')) && $.browser.opera) - this.element.css({ position: 'relative', top: 'auto', left: 'auto' }); - - //Create a wrapper element and set the wrapper to the new current internal element - this.element.wrap( - $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({ - position: this.element.css('position'), - width: this.element.outerWidth(), - height: this.element.outerHeight(), - top: this.element.css('top'), - left: this.element.css('left') - }) - ); - - //Overwrite the original this.element - this.element = this.element.parent(); - this.elementIsWrapper = true; - - //Move margins to the wrapper - this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); - this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0}); - - //Prevent Safari textarea resize - if ($.browser.safari && o.preventDefault) this.originalElement.css('resize', 'none'); - - //Push the actual element to our proportionallyResize internal array - this.proportionallyResize.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' })); - - // avoid IE jump (hard set the margin) - this.originalElement.css({ margin: this.originalElement.css('margin') }); - - // fix handlers offset - this._proportionallyResize(); - - } - - this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' }); - if(this.handles.constructor == String) { - - if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw'; - var n = this.handles.split(","); this.handles = {}; - - for(var i = 0; i < n.length; i++) { - - var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle; - var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>'); - - // increase zIndex of sw, se, ne, nw axis - //TODO : this modifies original option - if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex }); - - //TODO : What's going on here? - if ('se' == handle) { - axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se'); - }; - - //Insert into internal handles object and append to element - this.handles[handle] = '.ui-resizable-'+handle; - this.element.append(axis); - } - - } - - this._renderAxis = function(target) { - - target = target || this.element; - - for(var i in this.handles) { - - if(this.handles[i].constructor == String) - this.handles[i] = $(this.handles[i], this.element).show(); - - if (o.transparent) - this.handles[i].css({ opacity: 0 }); - - //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) - if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { - - var axis = $(this.handles[i], this.element), padWrapper = 0; - - //Checking the correct pad and border - padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); - - //The padding type i have to apply... - var padPos = [ 'padding', - /ne|nw|n/.test(i) ? 'Top' : - /se|sw|s/.test(i) ? 'Bottom' : - /^e$/.test(i) ? 'Right' : 'Left' ].join(""); - - if (!o.transparent) - target.css(padPos, padWrapper); - - this._proportionallyResize(); - - } - - //TODO: What's that good for? There's not anything to be executed left - if(!$(this.handles[i]).length) - continue; - - } - }; - - //TODO: make renderAxis a prototype function - this._renderAxis(this.element); - - this._handles = $('.ui-resizable-handle', this.element); - - if (o.disableSelection) - this._handles.disableSelection(); - - //Matching axis name - this._handles.mouseover(function() { - if (!self.resizing) { - if (this.className) - var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); - //Axis, default = se - self.axis = axis && axis[1] ? axis[1] : 'se'; - } - }); - - //If we want to auto hide the elements - if (o.autoHide) { - this._handles.hide(); - $(this.element) - .addClass("ui-resizable-autohide") - .hover(function() { - $(this).removeClass("ui-resizable-autohide"); - self._handles.show(); - }, - function(){ - if (!self.resizing) { - $(this).addClass("ui-resizable-autohide"); - self._handles.hide(); - } - }); - } - - //Initialize the mouse interaction - this._mouseInit(); - - }, - - destroy: function() { - - this._mouseDestroy(); - - var _destroy = function(exp) { - $(exp).removeClass("ui-resizable ui-resizable-disabled") - .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove(); - }; - - //TODO: Unwrap at same DOM position - if (this.elementIsWrapper) { - _destroy(this.element); - this.wrapper.parent().append( - this.originalElement.css({ - position: this.wrapper.css('position'), - width: this.wrapper.outerWidth(), - height: this.wrapper.outerHeight(), - top: this.wrapper.css('top'), - left: this.wrapper.css('left') - }) - ).end().remove(); - } - - _destroy(this.originalElement); - - }, - - _mouseCapture: function(event) { - - var handle = false; - for(var i in this.handles) { - if($(this.handles[i])[0] == event.target) handle = true; - } - - return this.options.disabled || !!handle; - - }, - - _mouseStart: function(event) { - - var o = this.options, iniPos = this.element.position(), el = this.element; - - this.resizing = true; - this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() }; - - // bugfix for http://dev.jquery.com/ticket/1749 - if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) { - el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left }); - } - - //Opera fixing relative position - if ($.browser.opera && (/relative/).test(el.css('position'))) - el.css({ position: 'relative', top: 'auto', left: 'auto' }); - - this._renderProxy(); - - var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top')); - - if (o.containment) { - curleft += $(o.containment).scrollLeft() || 0; - curtop += $(o.containment).scrollTop() || 0; - } - - //Store needed variables - this.offset = this.helper.offset(); - this.position = { left: curleft, top: curtop }; - this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; - this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; - this.originalPosition = { left: curleft, top: curtop }; - this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; - this.originalMousePosition = { left: event.pageX, top: event.pageY }; - - //Aspect Ratio - this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); - - if (o.preserveCursor) { - var cursor = $('.ui-resizable-' + this.axis).css('cursor'); - $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor); - } - - this._propagate("start", event); - return true; - }, - - _mouseDrag: function(event) { - - //Increase performance, avoid regex - var el = this.helper, o = this.options, props = {}, - self = this, smp = this.originalMousePosition, a = this.axis; - - var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0; - var trigger = this._change[a]; - if (!trigger) return false; - - // Calculate the attrs that will be change - var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff; - - if (this._aspectRatio || event.shiftKey) - data = this._updateRatio(data, event); - - data = this._respectSize(data, event); - - // plugins callbacks need to be called first - this._propagate("resize", event); - - el.css({ - top: this.position.top + "px", left: this.position.left + "px", - width: this.size.width + "px", height: this.size.height + "px" - }); - - if (!this._helper && this.proportionallyResize.length) - this._proportionallyResize(); - - this._updateCache(data); - - // calling the user callback at the end - this._trigger('resize', event, this.ui()); - - return false; - }, - - _mouseStop: function(event) { - - this.resizing = false; - var o = this.options, self = this; - - if(this._helper) { - var pr = this.proportionallyResize, ista = pr.length && (/textarea/i).test(pr[0].nodeName), - soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, - soffsetw = ista ? 0 : self.sizeDiff.width; - - var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, - left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, - top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; - - if (!o.animate) - this.element.css($.extend(s, { top: top, left: left })); - - if (this._helper && !o.animate) this._proportionallyResize(); - } - - if (o.preserveCursor) - $('body').css('cursor', 'auto'); - - this._propagate("stop", event); - - if (this._helper) this.helper.remove(); - return false; - - }, - - _updateCache: function(data) { - var o = this.options; - this.offset = this.helper.offset(); - if (data.left) this.position.left = data.left; - if (data.top) this.position.top = data.top; - if (data.height) this.size.height = data.height; - if (data.width) this.size.width = data.width; - }, - - _updateRatio: function(data, event) { - - var o = this.options, cpos = this.position, csize = this.size, a = this.axis; - - if (data.height) data.width = (csize.height * this.aspectRatio); - else if (data.width) data.height = (csize.width / this.aspectRatio); - - if (a == 'sw') { - data.left = cpos.left + (csize.width - data.width); - data.top = null; - } - if (a == 'nw') { - data.top = cpos.top + (csize.height - data.height); - data.left = cpos.left + (csize.width - data.width); - } - - return data; - }, - - _respectSize: function(data, event) { - - var isNumber = function(value) { - return !isNaN(parseInt(value, 10)) - }; - - var el = this.helper, o = this.options, pRatio = this._aspectRatio || event.shiftKey, a = this.axis, - ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), - isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); - - if (isminw) data.width = o.minWidth; - if (isminh) data.height = o.minHeight; - if (ismaxw) data.width = o.maxWidth; - if (ismaxh) data.height = o.maxHeight; - - var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height; - var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); - - if (isminw && cw) data.left = dw - o.minWidth; - if (ismaxw && cw) data.left = dw - o.maxWidth; - if (isminh && ch) data.top = dh - o.minHeight; - if (ismaxh && ch) data.top = dh - o.maxHeight; - - // fixing jump error on top/left - bug #2330 - var isNotwh = !data.width && !data.height; - if (isNotwh && !data.left && data.top) data.top = null; - else if (isNotwh && !data.top && data.left) data.left = null; - - return data; - }, - - _proportionallyResize: function() { - - var o = this.options; - if (!this.proportionallyResize.length) return; - var element = this.helper || this.element; - - for (var i=0; i < this.proportionallyResize.length; i++) { - - var prel = this.proportionallyResize[i]; - - if (!this.borderDif) { - var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')], - p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')]; - - this.borderDif = $.map(b, function(v, i) { - var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0; - return border + padding; - }); - } - - if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length))) - continue; - - prel.css({ - height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0, - width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 - }); - - }; - - }, - - _renderProxy: function() { - - var el = this.element, o = this.options; - this.elementOffset = el.offset(); - - if(this._helper) { - - this.helper = this.helper || $('<div style="overflow:hidden;"></div>'); - - // fix ie6 offset TODO: This seems broken - var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0), - pxyoffset = ( ie6 ? 2 : -1 ); - - this.helper.addClass(this._helper).css({ - width: this.element.outerWidth() + pxyoffset, - height: this.element.outerHeight() + pxyoffset, - position: 'absolute', - left: this.elementOffset.left - ie6offset +'px', - top: this.elementOffset.top - ie6offset +'px', - zIndex: ++o.zIndex //TODO: Don't modify option - }); - - this.helper.appendTo("body"); - - if (o.disableSelection) - this.helper.disableSelection(); - - } else { - this.helper = this.element; - } - - }, - - _change: { - e: function(event, dx, dy) { - return { width: this.originalSize.width + dx }; - }, - w: function(event, dx, dy) { - var o = this.options, cs = this.originalSize, sp = this.originalPosition; - return { left: sp.left + dx, width: cs.width - dx }; - }, - n: function(event, dx, dy) { - var o = this.options, cs = this.originalSize, sp = this.originalPosition; - return { top: sp.top + dy, height: cs.height - dy }; - }, - s: function(event, dx, dy) { - return { height: this.originalSize.height + dy }; - }, - se: function(event, dx, dy) { - return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); - }, - sw: function(event, dx, dy) { - return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); - }, - ne: function(event, dx, dy) { - return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); - }, - nw: function(event, dx, dy) { - return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); - } - }, - - _propagate: function(n, event) { - $.ui.plugin.call(this, n, [event, this.ui()]); - (n != "resize" && this._trigger(n, event, this.ui())); - }, - - plugins: {}, - - ui: function() { - return { - originalElement: this.originalElement, - element: this.element, - helper: this.helper, - position: this.position, - size: this.size, - originalSize: this.originalSize, - originalPosition: this.originalPosition - }; - } - -})); - -$.extend($.ui.resizable, { - version: "1.6rc6", - eventPrefix: "resize", - defaults: { - alsoResize: false, - animate: false, - animateDuration: "slow", - animateEasing: "swing", - aspectRatio: false, - autoHide: false, - cancel: ":input,option", - containment: false, - delay: 0, - disableSelection: true, - distance: 1, - ghost: false, - grid: false, - handles: "e,s,se", - helper: false, - maxHeight: null, - maxWidth: null, - minHeight: 10, - minWidth: 10, - preserveCursor: true, - preventDefault: true, - proportionallyResize: false, - transparent: false, - zIndex: 1000 - } -}); - -/* - * Resizable Extensions - */ - -$.ui.plugin.add("resizable", "alsoResize", { - - start: function(event, ui) { - - var self = $(this).data("resizable"), o = self.options; - - _store = function(exp) { - $(exp).each(function() { - $(this).data("resizable-alsoresize", { - width: parseInt($(this).width(), 10), height: parseInt($(this).height(), 10), - left: parseInt($(this).css('left'), 10), top: parseInt($(this).css('top'), 10) - }); - }); - }; - - if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) { - if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); } - else { $.each(o.alsoResize, function(exp, c) { _store(exp); }); } - }else{ - _store(o.alsoResize); - } - }, - - resize: function(event, ui){ - var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition; - - var delta = { - height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0, - top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0 - }, - - _alsoResize = function(exp, c) { - $(exp).each(function() { - var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left']; - - $.each(css || ['width', 'height', 'top', 'left'], function(i, prop) { - var sum = (start[prop]||0) + (delta[prop]||0); - if (sum && sum >= 0) - style[prop] = sum || null; - }); - - //Opera fixing relative position - if (/relative/.test(el.css('position')) && $.browser.opera) { - self._revertToRelativePosition = true; - el.css({ position: 'absolute', top: 'auto', left: 'auto' }); - } - - el.css(style); - }); - }; - - if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) { - $.each(o.alsoResize, function(exp, c) { _alsoResize(exp, c); }); - }else{ - _alsoResize(o.alsoResize); - } - }, - - stop: function(event, ui){ - var self = $(this).data("resizable"); - - //Opera fixing relative position - if (self._revertToRelativePosition && $.browser.opera) { - self._revertToRelativePosition = false; - el.css({ position: 'relative' }); - } - - $(this).removeData("resizable-alsoresize-start"); - } -}); - -$.ui.plugin.add("resizable", "animate", { - - stop: function(event, ui) { - var self = $(this).data("resizable"), o = self.options; - - var pr = o.proportionallyResize, ista = pr && (/textarea/i).test(pr.get(0).nodeName), - soffseth = ista && $.ui.hasScroll(pr.get(0), 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, - soffsetw = ista ? 0 : self.sizeDiff.width; - - var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, - left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, - top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; - - self.element.animate( - $.extend(style, top && left ? { top: top, left: left } : {}), { - duration: o.animateDuration, - easing: o.animateEasing, - step: function() { - - var data = { - width: parseInt(self.element.css('width'), 10), - height: parseInt(self.element.css('height'), 10), - top: parseInt(self.element.css('top'), 10), - left: parseInt(self.element.css('left'), 10) - }; - - if (pr) pr.css({ width: data.width, height: data.height }); - - // propagating resize, and updating values for each animation step - self._updateCache(data); - self._propagate("resize", event); - - } - } - ); - } - -}); - -$.ui.plugin.add("resizable", "containment", { - - start: function(event, ui) { - var self = $(this).data("resizable"), o = self.options, el = self.element; - var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; - if (!ce) return; - - self.containerElement = $(ce); - - if (/document/.test(oc) || oc == document) { - self.containerOffset = { left: 0, top: 0 }; - self.containerPosition = { left: 0, top: 0 }; - - self.parentData = { - element: $(document), left: 0, top: 0, - width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight - }; - } - - // i'm a node, so compute top, left, right, bottom - else { - var element = $(ce), p = []; - $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); }); - - self.containerOffset = element.offset(); - self.containerPosition = element.position(); - self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) }; - - var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width, - width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); - - self.parentData = { - element: ce, left: co.left, top: co.top, width: width, height: height - }; - } - }, - - resize: function(event, ui) { - var self = $(this).data("resizable"), o = self.options, - ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position, - pRatio = o._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement; - - if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co; - - if (cp.left < (self._helper ? co.left : 0)) { - self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left)); - if (pRatio) self.size.height = self.size.width / o.aspectRatio; - self.position.left = o.helper ? co.left : 0; - } - - if (cp.top < (self._helper ? co.top : 0)) { - self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top); - if (pRatio) self.size.width = self.size.height * o.aspectRatio; - self.position.top = self._helper ? co.top : 0; - } - - var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ), - hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height ); - - if (woset + self.size.width >= self.parentData.width) { - self.size.width = self.parentData.width - woset; - if (pRatio) self.size.height = self.size.width / o.aspectRatio; - } - - if (hoset + self.size.height >= self.parentData.height) { - self.size.height = self.parentData.height - hoset; - if (pRatio) self.size.width = self.size.height * o.aspectRatio; - } - }, - - stop: function(event, ui){ - var self = $(this).data("resizable"), o = self.options, cp = self.position, - co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement; - - var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height; - - if (self._helper && !o.animate && (/relative/).test(ce.css('position'))) - $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); - - if (self._helper && !o.animate && (/static/).test(ce.css('position'))) - $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); - - } -}); - -$.ui.plugin.add("resizable", "ghost", { - - start: function(event, ui) { - - var self = $(this).data("resizable"), o = self.options, pr = o.proportionallyResize, cs = self.size; - - self.ghost = self.originalElement.clone(); - self.ghost - .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) - .addClass('ui-resizable-ghost') - .addClass(typeof o.ghost == 'string' ? o.ghost : ''); - - self.ghost.appendTo(self.helper); - - }, - - resize: function(event, ui){ - var self = $(this).data("resizable"), o = self.options; - if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width }); - }, - - stop: function(event, ui){ - var self = $(this).data("resizable"), o = self.options; - if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0)); - } - -}); - -$.ui.plugin.add("resizable", "grid", { - - resize: function(event, ui) { - var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey; - o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; - var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); - - if (/^(se|s|e)$/.test(a)) { - self.size.width = os.width + ox; - self.size.height = os.height + oy; - } - else if (/^(ne)$/.test(a)) { - self.size.width = os.width + ox; - self.size.height = os.height + oy; - self.position.top = op.top - oy; - } - else if (/^(sw)$/.test(a)) { - self.size.width = os.width + ox; - self.size.height = os.height + oy; - self.position.left = op.left - ox; - } - else { - self.size.width = os.width + ox; - self.size.height = os.height + oy; - self.position.top = op.top - oy; - self.position.left = op.left - ox; - } - } - -}); - -var num = function(v) { - return parseInt(v, 10) || 0; -}; - -})(jQuery); -/* - * jQuery UI Dialog 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Dialog - * - * Depends: - * ui.core.js - * ui.draggable.js - * ui.resizable.js - */ -(function($) { - -var setDataSwitch = { - dragStart: "start.draggable", - drag: "drag.draggable", - dragStop: "stop.draggable", - maxHeight: "maxHeight.resizable", - minHeight: "minHeight.resizable", - maxWidth: "maxWidth.resizable", - minWidth: "minWidth.resizable", - resizeStart: "start.resizable", - resize: "drag.resizable", - resizeStop: "stop.resizable" -}; - -$.widget("ui.dialog", { - - _init: function() { - this.originalTitle = this.element.attr('title'); - - var self = this, - options = this.options, - - title = options.title || this.originalTitle || ' ', - titleId = $.ui.dialog.getTitleId(this.element), - - uiDialog = (this.uiDialog = $('<div/>')) - .appendTo(document.body) - .hide() - .addClass( - 'ui-dialog ' + - 'ui-widget ' + - 'ui-widget-content ' + - 'ui-corner-all ' + - options.dialogClass - ) - .css({ - position: 'absolute', - overflow: 'hidden', - zIndex: options.zIndex - }) - // setting tabIndex makes the div focusable - // setting outline to 0 prevents a border on focus in Mozilla - .attr('tabIndex', -1).css('outline', 0).keydown(function(event) { - (options.closeOnEscape && event.keyCode - && event.keyCode == $.ui.keyCode.ESCAPE && self.close(event)); - }) - .attr({ - role: 'dialog', - 'aria-labelledby': titleId - }) - .mousedown(function(event) { - self.moveToTop(event); - }), - - uiDialogContent = this.element - .show() - .removeAttr('title') - .addClass( - 'ui-dialog-content ' + - 'ui-widget-content') - .appendTo(uiDialog), - - uiDialogTitlebar = (this.uiDialogTitlebar = $('<div></div>')) - .addClass( - 'ui-dialog-titlebar ' + - 'ui-widget-header ' + - 'ui-corner-all ' + - 'ui-helper-clearfix' - ) - .prependTo(uiDialog), - - uiDialogTitlebarClose = $('<a href="#"/>') - .addClass( - 'ui-dialog-titlebar-close ' + - 'ui-corner-all' - ) - .attr('role', 'button') - .hover( - function() { - uiDialogTitlebarClose.addClass('ui-state-hover'); - }, - function() { - uiDialogTitlebarClose.removeClass('ui-state-hover'); - } - ) - .focus(function() { - uiDialogTitlebarClose.addClass('ui-state-focus'); - }) - .blur(function() { - uiDialogTitlebarClose.removeClass('ui-state-focus'); - }) - .mousedown(function(ev) { - ev.stopPropagation(); - }) - .click(function(event) { - self.close(event); - return false; - }) - .appendTo(uiDialogTitlebar), - - uiDialogTitlebarCloseText = (this.uiDialogTitlebarCloseText = $('<span/>')) - .addClass( - 'ui-icon ' + - 'ui-icon-closethick' - ) - .text(options.closeText) - .appendTo(uiDialogTitlebarClose), - - uiDialogTitle = $('<span/>') - .addClass('ui-dialog-title') - .attr('id', titleId) - .html(title) - .prependTo(uiDialogTitlebar); - - uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection(); - - (options.draggable && $.fn.draggable && this._makeDraggable()); - (options.resizable && $.fn.resizable && this._makeResizable()); - - this._createButtons(options.buttons); - this._isOpen = false; - - (options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe()); - (options.autoOpen && this.open()); - - }, - - destroy: function() { - (this.overlay && this.overlay.destroy()); - (this.shadow && this._destroyShadow()); - this.uiDialog.hide(); - this.element - .unbind('.dialog') - .removeData('dialog') - .removeClass('ui-dialog-content ui-widget-content') - .hide().appendTo('body'); - this.uiDialog.remove(); - - (this.originalTitle && this.element.attr('title', this.originalTitle)); - }, - - close: function(event) { - if (false === this._trigger('beforeclose', event)) { - return; - } - - (this.overlay && this.overlay.destroy()); - (this.shadow && this._destroyShadow()); - this.uiDialog - .hide(this.options.hide) - .unbind('keypress.ui-dialog'); - - this._trigger('close', event); - $.ui.dialog.overlay.resize(); - - this._isOpen = false; - }, - - isOpen: function() { - return this._isOpen; - }, - - // the force parameter allows us to move modal dialogs to their correct - // position on open - moveToTop: function(force, event) { - - if ((this.options.modal && !force) - || (!this.options.stack && !this.options.modal)) { - return this._trigger('focus', event); - } - - var maxZ = this.options.zIndex, options = this.options; - $('.ui-dialog:visible').each(function() { - maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10) || options.zIndex); - }); - (this.overlay && this.overlay.$el.css('z-index', ++maxZ)); - (this.shadow && this.shadow.css('z-index', ++maxZ)); - - //Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed. - // http://ui.jquery.com/bugs/ticket/3193 - var saveScroll = { scrollTop: this.element.attr('scrollTop'), scrollLeft: this.element.attr('scrollLeft') }; - this.uiDialog.css('z-index', ++maxZ); - this.element.attr(saveScroll); - this._trigger('focus', event); - }, - - open: function(event) { - if (this._isOpen) { return; } - - var options = this.options, - uiDialog = this.uiDialog; - - this.overlay = options.modal ? new $.ui.dialog.overlay(this) : null; - (uiDialog.next().length && uiDialog.appendTo('body')); - this._size(); - this._position(options.position); - uiDialog.show(options.show); - this.moveToTop(true, event); - - // prevent tabbing out of modal dialogs - (options.modal && uiDialog.bind('keypress.ui-dialog', function(event) { - if (event.keyCode != $.ui.keyCode.TAB) { - return; - } - - var tabbables = $(':tabbable', this), - first = tabbables.filter(':first')[0], - last = tabbables.filter(':last')[0]; - - if (event.target == last && !event.shiftKey) { - setTimeout(function() { - first.focus(); - }, 1); - } else if (event.target == first && event.shiftKey) { - setTimeout(function() { - last.focus(); - }, 1); - } - })); - - // set focus to the first tabbable element in: - // - content area - // - button pane - // - title bar - $([]) - .add(uiDialog.find('.ui-dialog-content :tabbable:first')) - .add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first')) - .add(uiDialog.find('.ui-dialog-titlebar :tabbable:first')) - .filter(':first') - .focus(); - - if(options.shadow) - this._createShadow(); - - this._trigger('open', event); - this._isOpen = true; - }, - - _createButtons: function(buttons) { - var self = this, - hasButtons = false, - uiDialogButtonPane = $('<div></div>') - .addClass( - 'ui-dialog-buttonpane ' + - 'ui-widget-content ' + - 'ui-helper-clearfix' - ); - - // if we already have a button pane, remove it - this.uiDialog.find('.ui-dialog-buttonpane').remove(); - - (typeof buttons == 'object' && buttons !== null && - $.each(buttons, function() { return !(hasButtons = true); })); - if (hasButtons) { - $.each(buttons, function(name, fn) { - $('<button type="button"></button>') - .addClass( - 'ui-state-default ' + - 'ui-corner-all' - ) - .text(name) - .click(function() { fn.apply(self.element[0], arguments); }) - .hover( - function() { - $(this).addClass('ui-state-hover'); - }, - function() { - $(this).removeClass('ui-state-hover'); - } - ) - .focus(function() { - $(this).addClass('ui-state-focus'); - }) - .blur(function() { - $(this).removeClass('ui-state-focus'); - }) - .appendTo(uiDialogButtonPane); - }); - uiDialogButtonPane.appendTo(this.uiDialog); - } - }, - - _makeDraggable: function() { - var self = this, - options = this.options; - - this.uiDialog.draggable({ - cancel: '.ui-dialog-content', - helper: options.dragHelper, - handle: '.ui-dialog-titlebar', - containment: 'document', - start: function() { - (options.dragStart && options.dragStart.apply(self.element[0], arguments)); - if($.browser.msie && $.browser.version < 7 && self.shadow) self.shadow.hide(); - }, - drag: function() { - (options.drag && options.drag.apply(self.element[0], arguments)); - self._refreshShadow(1); - }, - stop: function() { - (options.dragStop && options.dragStop.apply(self.element[0], arguments)); - $.ui.dialog.overlay.resize(); - if($.browser.msie && $.browser.version < 7 && self.shadow) self.shadow.show(); - self._refreshShadow(); - } - }); - }, - - _makeResizable: function(handles) { - handles = (handles === undefined ? this.options.resizable : handles); - var self = this, - options = this.options, - resizeHandles = typeof handles == 'string' - ? handles - : 'n,e,s,w,se,sw,ne,nw'; - - this.uiDialog.resizable({ - cancel: '.ui-dialog-content', - alsoResize: this.element, - helper: options.resizeHelper, - maxWidth: options.maxWidth, - maxHeight: options.maxHeight, - minWidth: options.minWidth, - minHeight: options.minHeight, - start: function() { - (options.resizeStart && options.resizeStart.apply(self.element[0], arguments)); - if($.browser.msie && $.browser.version < 7 && self.shadow) self.shadow.hide(); - }, - resize: function() { - (options.resize && options.resize.apply(self.element[0], arguments)); - self._refreshShadow(1); - }, - handles: resizeHandles, - stop: function() { - (options.resizeStop && options.resizeStop.apply(self.element[0], arguments)); - $.ui.dialog.overlay.resize(); - if($.browser.msie && $.browser.version < 7 && self.shadow) self.shadow.show(); - self._refreshShadow(); - } - }) - .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se'); - }, - - _position: function(pos) { - var wnd = $(window), doc = $(document), - pTop = doc.scrollTop(), pLeft = doc.scrollLeft(), - minTop = pTop; - - if ($.inArray(pos, ['center','top','right','bottom','left']) >= 0) { - pos = [ - pos == 'right' || pos == 'left' ? pos : 'center', - pos == 'top' || pos == 'bottom' ? pos : 'middle' - ]; - } - if (pos.constructor != Array) { - pos = ['center', 'middle']; - } - if (pos[0].constructor == Number) { - pLeft += pos[0]; - } else { - switch (pos[0]) { - case 'left': - pLeft += 0; - break; - case 'right': - pLeft += wnd.width() - this.uiDialog.outerWidth(); - break; - default: - case 'center': - pLeft += (wnd.width() - this.uiDialog.outerWidth()) / 2; - } - } - if (pos[1].constructor == Number) { - pTop += pos[1]; - } else { - switch (pos[1]) { - case 'top': - pTop += 0; - break; - case 'bottom': - pTop += wnd.height() - this.uiDialog.outerHeight(); - break; - default: - case 'middle': - pTop += (wnd.height() - this.uiDialog.outerHeight()) / 2; - } - } - - // prevent the dialog from being too high (make sure the titlebar - // is accessible) - pTop = Math.max(pTop, minTop); - this.uiDialog.css({top: pTop, left: pLeft}); - }, - - _setData: function(key, value){ - (setDataSwitch[key] && this.uiDialog.data(setDataSwitch[key], value)); - switch (key) { - case "buttons": - this._createButtons(value); - break; - case "closeText": - this.uiDialogTitlebarCloseText.text(value); - break; - case "draggable": - (value - ? this._makeDraggable() - : this.uiDialog.draggable('destroy')); - break; - case "height": - this.uiDialog.height(value); - break; - case "position": - this._position(value); - break; - case "resizable": - var uiDialog = this.uiDialog, - isResizable = this.uiDialog.is(':data(resizable)'); - - // currently resizable, becoming non-resizable - (isResizable && !value && uiDialog.resizable('destroy')); - - // currently resizable, changing handles - (isResizable && typeof value == 'string' && - uiDialog.resizable('option', 'handles', value)); - - // currently non-resizable, becoming resizable - (isResizable || this._makeResizable(value)); - - break; - case "title": - $(".ui-dialog-title", this.uiDialogTitlebar).html(value || ' '); - break; - case "width": - this.uiDialog.width(value); - break; - } - - $.widget.prototype._setData.apply(this, arguments); - }, - - _size: function() { - /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content - * divs will both have width and height set, so we need to reset them - */ - var options = this.options; - - // reset content sizing - this.element.css({ - height: 0, - minHeight: 0, - width: 'auto' - }); - - // reset wrapper sizing - // determine the height of all the non-content elements - var nonContentHeight = this.uiDialog.css({ - height: 'auto', - width: options.width - }) - .height(); - - this.element - .css({ - minHeight: Math.max(options.minHeight - nonContentHeight, 0), - height: options.height == 'auto' - ? 'auto' - : options.height - nonContentHeight - }); - }, - - _createShadow: function() { - this.shadow = $('<div class="ui-widget-shadow"></div>').css('position', 'absolute').appendTo(document.body); - this._refreshShadow(); - return this.shadow; - }, - - _refreshShadow: function(dragging) { - // IE6 is simply to slow to handle the reflow in a good way, so - // resizing only happens on stop, and the shadow is hidden during drag/resize - if(dragging && $.browser.msie && $.browser.version < 7) return; - - var offset = this.uiDialog.offset(); - this.shadow.css({ - left: offset.left, - top: offset.top, - width: this.uiDialog.outerWidth(), - height: this.uiDialog.outerHeight() - }); - }, - - _destroyShadow: function() { - this.shadow.remove(); - this.shadow = null; - } - -}); - -$.extend($.ui.dialog, { - version: "1.6rc6", - defaults: { - autoOpen: true, - bgiframe: false, - buttons: {}, - closeOnEscape: true, - closeText: 'close', - draggable: true, - height: 'auto', - minHeight: 150, - minWidth: 150, - modal: false, - position: 'center', - resizable: true, - shadow: true, - stack: true, - title: '', - width: 300, - zIndex: 1000 - }, - - getter: 'isOpen', - - uuid: 0, - - getTitleId: function($el) { - return 'ui-dialog-title-' + ($el.attr('id') || ++this.uuid); - }, - - overlay: function(dialog) { - this.$el = $.ui.dialog.overlay.create(dialog); - } -}); - -$.extend($.ui.dialog.overlay, { - instances: [], - events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','), - function(event) { return event + '.dialog-overlay'; }).join(' '), - create: function(dialog) { - if (this.instances.length === 0) { - // prevent use of anchors and inputs - // we use a setTimeout in case the overlay is created from an - // event that we're going to be cancelling (see #2804) - setTimeout(function() { - $('a, :input').bind($.ui.dialog.overlay.events, function() { - // allow use of the element if inside a dialog and - // - there are no modal dialogs - // - there are modal dialogs, but we are in front of the topmost modal - var allow = false; - var $dialog = $(this).parents('.ui-dialog'); - if ($dialog.length) { - var $overlays = $('.ui-dialog-overlay'); - if ($overlays.length) { - var maxZ = parseInt($overlays.css('z-index'), 10); - $overlays.each(function() { - maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10)); - }); - allow = parseInt($dialog.css('z-index'), 10) > maxZ; - } else { - allow = true; - } - } - return allow; - }); - }, 1); - - // allow closing by pressing the escape key - $(document).bind('keydown.dialog-overlay', function(event) { - (dialog.options.closeOnEscape && event.keyCode - && event.keyCode == $.ui.keyCode.ESCAPE && dialog.close(event)); - }); - - // handle window resize - $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize); - } - - var $el = $('<div></div>').appendTo(document.body) - .addClass('ui-widget-overlay').css({ - width: this.width(), - height: this.height() - }); - - (dialog.options.bgiframe && $.fn.bgiframe && $el.bgiframe()); - - this.instances.push($el); - return $el; - }, - - destroy: function($el) { - this.instances.splice($.inArray(this.instances, $el), 1); - - if (this.instances.length === 0) { - $('a, :input').add([document, window]).unbind('.dialog-overlay'); - } - - $el.remove(); - }, - - height: function() { - // handle IE 6 - if ($.browser.msie && $.browser.version < 7) { - var scrollHeight = Math.max( - document.documentElement.scrollHeight, - document.body.scrollHeight - ); - var offsetHeight = Math.max( - document.documentElement.offsetHeight, - document.body.offsetHeight - ); - - if (scrollHeight < offsetHeight) { - return $(window).height() + 'px'; - } else { - return scrollHeight + 'px'; - } - // handle "good" browsers - } else { - return $(document).height() + 'px'; - } - }, - - width: function() { - // handle IE 6 - if ($.browser.msie && $.browser.version < 7) { - var scrollWidth = Math.max( - document.documentElement.scrollWidth, - document.body.scrollWidth - ); - var offsetWidth = Math.max( - document.documentElement.offsetWidth, - document.body.offsetWidth - ); - - if (scrollWidth < offsetWidth) { - return $(window).width() + 'px'; - } else { - return scrollWidth + 'px'; - } - // handle "good" browsers - } else { - return $(document).width() + 'px'; - } - }, - - resize: function() { - /* If the dialog is draggable and the user drags it past the - * right edge of the window, the document becomes wider so we - * need to stretch the overlay. If the user then drags the - * dialog back to the left, the document will become narrower, - * so we need to shrink the overlay to the appropriate size. - * This is handled by shrinking the overlay before setting it - * to the full document size. - */ - var $overlays = $([]); - $.each($.ui.dialog.overlay.instances, function() { - $overlays = $overlays.add(this); - }); - - $overlays.css({ - width: 0, - height: 0 - }).css({ - width: $.ui.dialog.overlay.width(), - height: $.ui.dialog.overlay.height() - }); - } -}); - -$.extend($.ui.dialog.overlay.prototype, { - destroy: function() { - $.ui.dialog.overlay.destroy(this.$el); - } -}); - -})(jQuery); -/* - * jQuery UI Effects 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/ - */ -;(function($) { - -$.effects = $.effects || {}; //Add the 'effects' scope - -$.extend($.effects, { - version: "1.6rc6", - - // Saves a set of properties in a data storage - save: function(element, set) { - for(var i=0; i < set.length; i++) { - if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]); - } - }, - - // Restores a set of previously saved properties from a data storage - restore: function(element, set) { - for(var i=0; i < set.length; i++) { - if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i])); - } - }, - - setMode: function(el, mode) { - if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle - return mode; - }, - - getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value - // this should be a little more flexible in the future to handle a string & hash - var y, x; - switch (origin[0]) { - case 'top': y = 0; break; - case 'middle': y = 0.5; break; - case 'bottom': y = 1; break; - default: y = origin[0] / original.height; - }; - switch (origin[1]) { - case 'left': x = 0; break; - case 'center': x = 0.5; break; - case 'right': x = 1; break; - default: x = origin[1] / original.width; - }; - return {x: x, y: y}; - }, - - // Wraps the element around a wrapper that copies position properties - createWrapper: function(element) { - - //if the element is already wrapped, return it - if (element.parent().is('.ui-effects-wrapper')) - return element.parent(); - - //Cache width,height and float properties of the element, and create a wrapper around it - var props = { width: element.outerWidth(true), height: element.outerHeight(true), 'float': element.css('float') }; - element.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>'); - var wrapper = element.parent(); - - //Transfer the positioning of the element to the wrapper - if (element.css('position') == 'static') { - wrapper.css({ position: 'relative' }); - element.css({ position: 'relative'} ); - } else { - var top = element.css('top'); if(isNaN(parseInt(top,10))) top = 'auto'; - var left = element.css('left'); if(isNaN(parseInt(left,10))) left = 'auto'; - wrapper.css({ position: element.css('position'), top: top, left: left, zIndex: element.css('z-index') }).show(); - element.css({position: 'relative', top: 0, left: 0 }); - } - - wrapper.css(props); - return wrapper; - }, - - removeWrapper: function(element) { - if (element.parent().is('.ui-effects-wrapper')) - return element.parent().replaceWith(element); - return element; - }, - - setTransition: function(element, list, factor, value) { - value = value || {}; - $.each(list, function(i, x){ - unit = element.cssUnit(x); - if (unit[0] > 0) value[x] = unit[0] * factor + unit[1]; - }); - return value; - }, - - //Base function to animate from one class to another in a seamless transition - animateClass: function(value, duration, easing, callback) { - - var cb = (typeof easing == "function" ? easing : (callback ? callback : null)); - var ea = (typeof easing == "string" ? easing : null); - - return this.each(function() { - - var offset = {}; var that = $(this); var oldStyleAttr = that.attr("style") || ''; - if(typeof oldStyleAttr == 'object') oldStyleAttr = oldStyleAttr["cssText"]; /* Stupidly in IE, style is a object.. */ - if(value.toggle) { that.hasClass(value.toggle) ? value.remove = value.toggle : value.add = value.toggle; } - - //Let's get a style offset - var oldStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle)); - if(value.add) that.addClass(value.add); if(value.remove) that.removeClass(value.remove); - var newStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle)); - if(value.add) that.removeClass(value.add); if(value.remove) that.addClass(value.remove); - - // The main function to form the object for animation - for(var n in newStyle) { - if( typeof newStyle[n] != "function" && newStyle[n] /* No functions and null properties */ - && n.indexOf("Moz") == -1 && n.indexOf("length") == -1 /* No mozilla spezific render properties. */ - && newStyle[n] != oldStyle[n] /* Only values that have changed are used for the animation */ - && (n.match(/color/i) || (!n.match(/color/i) && !isNaN(parseInt(newStyle[n],10)))) /* Only things that can be parsed to integers or colors */ - && (oldStyle.position != "static" || (oldStyle.position == "static" && !n.match(/left|top|bottom|right/))) /* No need for positions when dealing with static positions */ - ) offset[n] = newStyle[n]; - } - - that.animate(offset, duration, ea, function() { // Animate the newly constructed offset object - // Change style attribute back to original. For stupid IE, we need to clear the damn object. - if(typeof $(this).attr("style") == 'object') { $(this).attr("style")["cssText"] = ""; $(this).attr("style")["cssText"] = oldStyleAttr; } else $(this).attr("style", oldStyleAttr); - if(value.add) $(this).addClass(value.add); if(value.remove) $(this).removeClass(value.remove); - if(cb) cb.apply(this, arguments); - }); - - }); - } -}); - - -function _normalizeArguments(a, m) { - - var o = a[1] && a[1].constructor == Object ? a[1] : {}; if(m) o.mode = m; - var speed = a[1] && a[1].constructor != Object ? a[1] : o.duration; //either comes from options.duration or the second argument - speed = $.fx.off ? 0 : typeof speed === "number" ? speed : $.fx.speeds[speed] || $.fx.speeds._default; - var callback = o.callback || ( $.isFunction(a[2]) && a[2] ) || ( $.isFunction(a[3]) && a[3] ); - - return [a[0], o, speed, callback]; - -} - -//Extend the methods of jQuery -$.fn.extend({ - - //Save old methods - _show: $.fn.show, - _hide: $.fn.hide, - __toggle: $.fn.toggle, - _addClass: $.fn.addClass, - _removeClass: $.fn.removeClass, - _toggleClass: $.fn.toggleClass, - - // New effect methods - effect: function(fx, options, speed, callback) { - return $.effects[fx] ? $.effects[fx].call(this, {method: fx, options: options || {}, duration: speed, callback: callback }) : null; - }, - - show: function() { - if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0]))) - return this._show.apply(this, arguments); - else { - return this.effect.apply(this, _normalizeArguments(arguments, 'show')); - } - }, - - hide: function() { - if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0]))) - return this._hide.apply(this, arguments); - else { - return this.effect.apply(this, _normalizeArguments(arguments, 'hide')); - } - }, - - toggle: function(){ - if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])) || (arguments[0].constructor == Function)) - return this.__toggle.apply(this, arguments); - else { - return this.effect.apply(this, _normalizeArguments(arguments, 'toggle')); - } - }, - - addClass: function(classNames, speed, easing, callback) { - return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames); - }, - removeClass: function(classNames,speed,easing,callback) { - return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames); - }, - toggleClass: function(classNames,speed,easing,callback) { - return ( (typeof speed !== "boolean") && speed ) ? $.effects.animateClass.apply(this, [{ toggle: classNames },speed,easing,callback]) : this._toggleClass(classNames, speed); - }, - morph: function(remove,add,speed,easing,callback) { - return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]); - }, - switchClass: function() { - return this.morph.apply(this, arguments); - }, - - // helper functions - cssUnit: function(key) { - var style = this.css(key), val = []; - $.each( ['em','px','%','pt'], function(i, unit){ - if(style.indexOf(unit) > 0) - val = [parseFloat(style), unit]; - }); - return val; - } -}); - -/* - * jQuery Color Animations - * Copyright 2007 John Resig - * Released under the MIT and GPL licenses. - */ - -// We override the animation for all of these color styles -$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){ - $.fx.step[attr] = function(fx) { - if ( fx.state == 0 ) { - fx.start = getColor( fx.elem, attr ); - fx.end = getRGB( fx.end ); - } - - fx.elem.style[attr] = "rgb(" + [ - Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0],10), 255), 0), - Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1],10), 255), 0), - Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2],10), 255), 0) - ].join(",") + ")"; - }; -}); - -// Color Conversion functions from highlightFade -// By Blair Mitchelmore -// http://jquery.offput.ca/highlightFade/ - -// Parse strings looking for color tuples [255,255,255] -function getRGB(color) { - var result; - - // Check if we're already dealing with an array of colors - if ( color && color.constructor == Array && color.length == 3 ) - return color; - - // Look for rgb(num,num,num) - if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) - return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)]; - - // Look for rgb(num%,num%,num%) - if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) - return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; - - // Look for #a0b1c2 - if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) - return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; - - // Look for #fff - if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) - return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; - - // Look for rgba(0, 0, 0, 0) == transparent in Safari 3 - if (result = /rgba\(0, 0, 0, 0\)/.exec(color)) - return colors['transparent']; - - // Otherwise, we're most likely dealing with a named color - return colors[$.trim(color).toLowerCase()]; -} - -function getColor(elem, attr) { - var color; - - do { - color = $.curCSS(elem, attr); - - // Keep going until we find an element that has color, or we hit the body - if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") ) - break; - - attr = "backgroundColor"; - } while ( elem = elem.parentNode ); - - return getRGB(color); -}; - -// Some named colors to work with -// From Interface by Stefan Petre -// http://interface.eyecon.ro/ - -var colors = { - aqua:[0,255,255], - azure:[240,255,255], - beige:[245,245,220], - black:[0,0,0], - blue:[0,0,255], - brown:[165,42,42], - cyan:[0,255,255], - darkblue:[0,0,139], - darkcyan:[0,139,139], - darkgrey:[169,169,169], - darkgreen:[0,100,0], - darkkhaki:[189,183,107], - darkmagenta:[139,0,139], - darkolivegreen:[85,107,47], - darkorange:[255,140,0], - darkorchid:[153,50,204], - darkred:[139,0,0], - darksalmon:[233,150,122], - darkviolet:[148,0,211], - fuchsia:[255,0,255], - gold:[255,215,0], - green:[0,128,0], - indigo:[75,0,130], - khaki:[240,230,140], - lightblue:[173,216,230], - lightcyan:[224,255,255], - lightgreen:[144,238,144], - lightgrey:[211,211,211], - lightpink:[255,182,193], - lightyellow:[255,255,224], - lime:[0,255,0], - magenta:[255,0,255], - maroon:[128,0,0], - navy:[0,0,128], - olive:[128,128,0], - orange:[255,165,0], - pink:[255,192,203], - purple:[128,0,128], - violet:[128,0,128], - red:[255,0,0], - silver:[192,192,192], - white:[255,255,255], - yellow:[255,255,0], - transparent: [255,255,255] -}; - -/* - * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ - * - * Uses the built in easing capabilities added In jQuery 1.1 - * to offer multiple easing options - * - * TERMS OF USE - jQuery Easing - * - * Open source under the BSD License. - * - * Copyright 2008 George McGinley Smith - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * Neither the name of the author nor the names of contributors may be used to endorse - * or promote products derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * -*/ - -// t: current time, b: begInnIng value, c: change In value, d: duration -$.easing.jswing = $.easing.swing; - -$.extend($.easing, -{ - def: 'easeOutQuad', - swing: function (x, t, b, c, d) { - //alert($.easing.default); - return $.easing[$.easing.def](x, t, b, c, d); - }, - easeInQuad: function (x, t, b, c, d) { - return c*(t/=d)*t + b; - }, - easeOutQuad: function (x, t, b, c, d) { - return -c *(t/=d)*(t-2) + b; - }, - easeInOutQuad: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t + b; - return -c/2 * ((--t)*(t-2) - 1) + b; - }, - easeInCubic: function (x, t, b, c, d) { - return c*(t/=d)*t*t + b; - }, - easeOutCubic: function (x, t, b, c, d) { - return c*((t=t/d-1)*t*t + 1) + b; - }, - easeInOutCubic: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t*t + b; - return c/2*((t-=2)*t*t + 2) + b; - }, - easeInQuart: function (x, t, b, c, d) { - return c*(t/=d)*t*t*t + b; - }, - easeOutQuart: function (x, t, b, c, d) { - return -c * ((t=t/d-1)*t*t*t - 1) + b; - }, - easeInOutQuart: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t*t*t + b; - return -c/2 * ((t-=2)*t*t*t - 2) + b; - }, - easeInQuint: function (x, t, b, c, d) { - return c*(t/=d)*t*t*t*t + b; - }, - easeOutQuint: function (x, t, b, c, d) { - return c*((t=t/d-1)*t*t*t*t + 1) + b; - }, - easeInOutQuint: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; - return c/2*((t-=2)*t*t*t*t + 2) + b; - }, - easeInSine: function (x, t, b, c, d) { - return -c * Math.cos(t/d * (Math.PI/2)) + c + b; - }, - easeOutSine: function (x, t, b, c, d) { - return c * Math.sin(t/d * (Math.PI/2)) + b; - }, - easeInOutSine: function (x, t, b, c, d) { - return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; - }, - easeInExpo: function (x, t, b, c, d) { - return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; - }, - easeOutExpo: function (x, t, b, c, d) { - return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; - }, - easeInOutExpo: function (x, t, b, c, d) { - if (t==0) return b; - if (t==d) return b+c; - if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; - return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; - }, - easeInCirc: function (x, t, b, c, d) { - return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; - }, - easeOutCirc: function (x, t, b, c, d) { - return c * Math.sqrt(1 - (t=t/d-1)*t) + b; - }, - easeInOutCirc: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; - return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; - }, - easeInElastic: function (x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; - }, - easeOutElastic: function (x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; - }, - easeInOutElastic: function (x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; - return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; - }, - easeInBack: function (x, t, b, c, d, s) { - if (s == undefined) s = 1.70158; - return c*(t/=d)*t*((s+1)*t - s) + b; - }, - easeOutBack: function (x, t, b, c, d, s) { - if (s == undefined) s = 1.70158; - return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; - }, - easeInOutBack: function (x, t, b, c, d, s) { - if (s == undefined) s = 1.70158; - if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; - return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; - }, - easeInBounce: function (x, t, b, c, d) { - return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b; - }, - easeOutBounce: function (x, t, b, c, d) { - if ((t/=d) < (1/2.75)) { - return c*(7.5625*t*t) + b; - } else if (t < (2/2.75)) { - return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; - } else if (t < (2.5/2.75)) { - return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; - } else { - return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; - } - }, - easeInOutBounce: function (x, t, b, c, d) { - if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; - return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; - } -}); - -/* - * - * TERMS OF USE - EASING EQUATIONS - * - * Open source under the BSD License. - * - * Copyright 2001 Robert Penner - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * Neither the name of the author nor the names of contributors may be used to endorse - * or promote products derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -})(jQuery); -/* - * jQuery UI Effects Blind 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Blind - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.blind = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode - var direction = o.options.direction || 'vertical'; // Default direction - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper - var ref = (direction == 'vertical') ? 'height' : 'width'; - var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width(); - if(mode == 'show') wrapper.css(ref, 0); // Shift - - // Animation - var animation = {}; - animation[ref] = mode == 'show' ? distance : 0; - - // Animate - wrapper.animate(animation, o.duration, o.options.easing, function() { - if(mode == 'hide') el.hide(); // Hide - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(el[0], arguments); // Callback - el.dequeue(); - }); - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Bounce 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Bounce - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.bounce = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode - var direction = o.options.direction || 'up'; // Default direction - var distance = o.options.distance || 20; // Default distance - var times = o.options.times || 5; // Default # of times - var speed = o.duration || 250; // Default speed per bounce - if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - $.effects.createWrapper(el); // Create Wrapper - var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; - var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; - var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 3 : el.outerWidth({margin:true}) / 3); - if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift - if (mode == 'hide') distance = distance / (times * 2); - if (mode != 'hide') times--; - - // Animate - if (mode == 'show') { // Show Bounce - var animation = {opacity: 1}; - animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance; - el.animate(animation, speed / 2, o.options.easing); - distance = distance / 2; - times--; - }; - for (var i = 0; i < times; i++) { // Bounces - var animation1 = {}, animation2 = {}; - animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance; - animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance; - el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing); - distance = (mode == 'hide') ? distance * 2 : distance / 2; - }; - if (mode == 'hide') { // Last Bounce - var animation = {opacity: 0}; - animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance; - el.animate(animation, speed / 2, o.options.easing, function(){ - el.hide(); // Hide - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(this, arguments); // Callback - }); - } else { - var animation1 = {}, animation2 = {}; - animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance; - animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance; - el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){ - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(this, arguments); // Callback - }); - }; - el.queue('fx', function() { el.dequeue(); }); - el.dequeue(); - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Clip 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Clip - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.clip = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left','height','width']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode - var direction = o.options.direction || 'vertical'; // Default direction - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper - var animate = el[0].tagName == 'IMG' ? wrapper : el; - var ref = { - size: (direction == 'vertical') ? 'height' : 'width', - position: (direction == 'vertical') ? 'top' : 'left' - }; - var distance = (direction == 'vertical') ? animate.height() : animate.width(); - if(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift - - // Animation - var animation = {}; - animation[ref.size] = mode == 'show' ? distance : 0; - animation[ref.position] = mode == 'show' ? 0 : distance / 2; - - // Animate - animate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { - if(mode == 'hide') el.hide(); // Hide - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(el[0], arguments); // Callback - el.dequeue(); - }}); - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Drop 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Drop - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.drop = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left','opacity']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode - var direction = o.options.direction || 'left'; // Default Direction - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - $.effects.createWrapper(el); // Create Wrapper - var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; - var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; - var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2); - if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift - - // Animation - var animation = {opacity: mode == 'show' ? 1 : 0}; - animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; - - // Animate - el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { - if(mode == 'hide') el.hide(); // Hide - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(this, arguments); // Callback - el.dequeue(); - }}); - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Explode 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Explode - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.explode = function(o) { - - return this.queue(function() { - - var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3; - var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3; - - o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode; - var el = $(this).show().css('visibility', 'hidden'); - var offset = el.offset(); - - //Substract the margins - not fixing the problem yet. - offset.top -= parseInt(el.css("marginTop")) || 0; - offset.left -= parseInt(el.css("marginLeft")) || 0; - - var width = el.outerWidth(true); - var height = el.outerHeight(true); - - for(var i=0;i<rows;i++) { // = - for(var j=0;j<cells;j++) { // || - el - .clone() - .appendTo('body') - .wrap('<div></div>') - .css({ - position: 'absolute', - visibility: 'visible', - left: -j*(width/cells), - top: -i*(height/rows) - }) - .parent() - .addClass('ui-effects-explode') - .css({ - position: 'absolute', - overflow: 'hidden', - width: width/cells, - height: height/rows, - left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0), - top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0), - opacity: o.options.mode == 'show' ? 0 : 1 - }).animate({ - left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)), - top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)), - opacity: o.options.mode == 'show' ? 1 : 0 - }, o.duration || 500); - } - } - - // Set a timeout, to call the callback approx. when the other animations have finished - setTimeout(function() { - - o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide(); - if(o.callback) o.callback.apply(el[0]); // Callback - el.dequeue(); - - $('div.ui-effects-explode').remove(); - - }, o.duration || 500); - - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Fold 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Fold - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.fold = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode - var size = o.options.size || 15; // Default fold size - var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value - var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2; - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper - var widthFirst = ((mode == 'show') != horizFirst); - var ref = widthFirst ? ['width', 'height'] : ['height', 'width']; - var distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()]; - var percent = /([0-9]+)%/.exec(size); - if(percent) size = parseInt(percent[1]) / 100 * distance[mode == 'hide' ? 0 : 1]; - if(mode == 'show') wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); // Shift - - // Animation - var animation1 = {}, animation2 = {}; - animation1[ref[0]] = mode == 'show' ? distance[0] : size; - animation2[ref[1]] = mode == 'show' ? distance[1] : 0; - - // Animate - wrapper.animate(animation1, duration, o.options.easing) - .animate(animation2, duration, o.options.easing, function() { - if(mode == 'hide') el.hide(); // Hide - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(el[0], arguments); // Callback - el.dequeue(); - }); - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Highlight 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Highlight - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.highlight = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['backgroundImage','backgroundColor','opacity']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode - var color = o.options.color || "#ffff99"; // Default highlight color - var oldColor = el.css("backgroundColor"); - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - el.css({backgroundImage: 'none', backgroundColor: color}); // Shift - - // Animation - var animation = {backgroundColor: oldColor }; - if (mode == "hide") animation['opacity'] = 0; - - // Animate - el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { - if(mode == "hide") el.hide(); - $.effects.restore(el, props); - if (mode == "show" && $.browser.msie) this.style.removeAttribute('filter'); - if(o.callback) o.callback.apply(this, arguments); - el.dequeue(); - }}); - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Pulsate 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Pulsate - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.pulsate = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this); - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode - var times = o.options.times || 5; // Default # of times - var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2; - - // Adjust - if (mode == 'hide') times--; - if (el.is(':hidden')) { // Show fadeIn - el.css('opacity', 0); - el.show(); // Show - el.animate({opacity: 1}, duration, o.options.easing); - times = times-2; - } - - // Animate - for (var i = 0; i < times; i++) { // Pulsate - el.animate({opacity: 0}, duration, o.options.easing).animate({opacity: 1}, duration, o.options.easing); - }; - if (mode == 'hide') { // Last Pulse - el.animate({opacity: 0}, duration, o.options.easing, function(){ - el.hide(); // Hide - if(o.callback) o.callback.apply(this, arguments); // Callback - }); - } else { - el.animate({opacity: 0}, duration, o.options.easing).animate({opacity: 1}, duration, o.options.easing, function(){ - if(o.callback) o.callback.apply(this, arguments); // Callback - }); - }; - el.queue('fx', function() { el.dequeue(); }); - el.dequeue(); - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Scale 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Scale - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.puff = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this); - - // Set options - var options = $.extend(true, {}, o.options); - var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode - var percent = parseInt(o.options.percent) || 150; // Set default puff percent - options.fade = true; // It's not a puff if it doesn't fade! :) - var original = {height: el.height(), width: el.width()}; // Save original - - // Adjust - var factor = percent / 100; - el.from = (mode == 'hide') ? original : {height: original.height * factor, width: original.width * factor}; - - // Animation - options.from = el.from; - options.percent = (mode == 'hide') ? percent : 100; - options.mode = mode; - - // Animate - el.effect('scale', options, o.duration, o.callback); - el.dequeue(); - }); - -}; - -$.effects.scale = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this); - - // Set options - var options = $.extend(true, {}, o.options); - var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode - var percent = parseInt(o.options.percent) || (parseInt(o.options.percent) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent - var direction = o.options.direction || 'both'; // Set default axis - var origin = o.options.origin; // The origin of the scaling - if (mode != 'effect') { // Set default origin and restore for show/hide - options.origin = origin || ['middle','center']; - options.restore = true; - } - var original = {height: el.height(), width: el.width()}; // Save original - el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state - - // Adjust - var factor = { // Set scaling factor - y: direction != 'horizontal' ? (percent / 100) : 1, - x: direction != 'vertical' ? (percent / 100) : 1 - }; - el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state - - if (o.options.fade) { // Fade option to support puff - if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;}; - if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;}; - }; - - // Animation - options.from = el.from; options.to = el.to; options.mode = mode; - - // Animate - el.effect('size', options, o.duration, o.callback); - el.dequeue(); - }); - -}; - -$.effects.size = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left','width','height','overflow','opacity']; - var props1 = ['position','top','left','overflow','opacity']; // Always restore - var props2 = ['width','height','overflow']; // Copy for children - var cProps = ['fontSize']; - var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom']; - var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode - var restore = o.options.restore || false; // Default restore - var scale = o.options.scale || 'both'; // Default scale mode - var origin = o.options.origin; // The origin of the sizing - var original = {height: el.height(), width: el.width()}; // Save original - el.from = o.options.from || original; // Default from state - el.to = o.options.to || original; // Default to state - // Adjust - if (origin) { // Calculate baseline shifts - var baseline = $.effects.getBaseline(origin, original); - el.from.top = (original.height - el.from.height) * baseline.y; - el.from.left = (original.width - el.from.width) * baseline.x; - el.to.top = (original.height - el.to.height) * baseline.y; - el.to.left = (original.width - el.to.width) * baseline.x; - }; - var factor = { // Set scaling factor - from: {y: el.from.height / original.height, x: el.from.width / original.width}, - to: {y: el.to.height / original.height, x: el.to.width / original.width} - }; - if (scale == 'box' || scale == 'both') { // Scale the css box - if (factor.from.y != factor.to.y) { // Vertical props scaling - props = props.concat(vProps); - el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from); - el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to); - }; - if (factor.from.x != factor.to.x) { // Horizontal props scaling - props = props.concat(hProps); - el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from); - el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to); - }; - }; - if (scale == 'content' || scale == 'both') { // Scale the content - if (factor.from.y != factor.to.y) { // Vertical props scaling - props = props.concat(cProps); - el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from); - el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to); - }; - }; - $.effects.save(el, restore ? props : props1); el.show(); // Save & Show - $.effects.createWrapper(el); // Create Wrapper - el.css('overflow','hidden').css(el.from); // Shift - - // Animate - if (scale == 'content' || scale == 'both') { // Scale the children - vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size - hProps = hProps.concat(['marginLeft','marginRight']); // Add margins - props2 = props.concat(vProps).concat(hProps); // Concat - el.find("*[width]").each(function(){ - child = $(this); - if (restore) $.effects.save(child, props2); - var c_original = {height: child.height(), width: child.width()}; // Save original - child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x}; - child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x}; - if (factor.from.y != factor.to.y) { // Vertical props scaling - child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from); - child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to); - }; - if (factor.from.x != factor.to.x) { // Horizontal props scaling - child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from); - child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to); - }; - child.css(child.from); // Shift children - child.animate(child.to, o.duration, o.options.easing, function(){ - if (restore) $.effects.restore(child, props2); // Restore children - }); // Animate children - }); - }; - - // Animate - el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { - if(mode == 'hide') el.hide(); // Hide - $.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(this, arguments); // Callback - el.dequeue(); - }}); - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Shake 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Shake - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.shake = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode - var direction = o.options.direction || 'left'; // Default direction - var distance = o.options.distance || 20; // Default distance - var times = o.options.times || 3; // Default # of times - var speed = o.duration || o.options.duration || 140; // Default speed per shake - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - $.effects.createWrapper(el); // Create Wrapper - var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; - var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; - - // Animation - var animation = {}, animation1 = {}, animation2 = {}; - animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance; - animation1[ref] = (motion == 'pos' ? '+=' : '-=') + distance * 2; - animation2[ref] = (motion == 'pos' ? '-=' : '+=') + distance * 2; - - // Animate - el.animate(animation, speed, o.options.easing); - for (var i = 1; i < times; i++) { // Shakes - el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing); - }; - el.animate(animation1, speed, o.options.easing). - animate(animation, speed / 2, o.options.easing, function(){ // Last shake - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(this, arguments); // Callback - }); - el.queue('fx', function() { el.dequeue(); }); - el.dequeue(); - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Slide 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Slide - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.slide = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this), props = ['position','top','left']; - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode - var direction = o.options.direction || 'left'; // Default Direction - - // Adjust - $.effects.save(el, props); el.show(); // Save & Show - $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper - var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; - var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; - var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true})); - if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); // Shift - - // Animation - var animation = {}; - animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; - - // Animate - el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { - if(mode == 'hide') el.hide(); // Hide - $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore - if(o.callback) o.callback.apply(this, arguments); // Callback - el.dequeue(); - }}); - - }); - -}; - -})(jQuery); -/* - * jQuery UI Effects Transfer 1.6rc6 - * - * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Transfer - * - * Depends: - * effects.core.js - */ -(function($) { - -$.effects.transfer = function(o) { - - return this.queue(function() { - - // Create element - var el = $(this); - - // Set options - var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode - var target = $(o.options.to); // Find Target - var position = el.offset(); - var transfer = $('<div class="ui-effects-transfer"></div>').appendTo(document.body); - if(o.options.className) transfer.addClass(o.options.className); - - // Set target css - transfer.addClass(o.options.className); - transfer.css({ - top: position.top, - left: position.left, - height: el.outerHeight() - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')), - width: el.outerWidth() - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth')), - position: 'absolute' - }); - - // Animation - position = target.offset(); - animation = { - top: position.top, - left: position.left, - height: target.outerHeight() - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')), - width: target.outerWidth() - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth')) - }; - - // Animate - transfer.animate(animation, o.duration, o.options.easing, function() { - transfer.remove(); // Remove div - if(o.callback) o.callback.apply(el[0], arguments); // Callback - el.dequeue(); - }); - - }); - -}; - -})(jQuery); diff --git a/projecttemplates/WebFormsRelyingParty/scripts/jquery-ui-personalized-1.6rc6.min.js b/projecttemplates/WebFormsRelyingParty/scripts/jquery-ui-personalized-1.6rc6.min.js deleted file mode 100644 index 2d97bb8..0000000 --- a/projecttemplates/WebFormsRelyingParty/scripts/jquery-ui-personalized-1.6rc6.min.js +++ /dev/null @@ -1,184 +0,0 @@ -/*
- * jQuery UI 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI
- */
(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.6rc6",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},cssCache:{},css:function(j){if(c.ui.cssCache[j]){return c.ui.cssCache[j]}var k=c('<div class="ui-gen"></div>').addClass(j).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");c.ui.cssCache[j]=!!((!(/auto|default/).test(k.css("cursor"))||(/^[1-9]/).test(k.css("height"))||(/^[1-9]/).test(k.css("width"))||!(/none/).test(k.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(k.css("backgroundColor"))));try{c("body").get(0).removeChild(k.get(0))}catch(l){}return c.ui.cssCache[j]},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=true;this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/*
- * jQuery UI Draggable 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Draggables
- *
- * Depends:
- * ui.core.js
- */
(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-draggable"));(this.options.disabled&&this.element.addClass(this.options.cssNamespace+"-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass(this.options.cssNamespace+"-draggable "+this.options.cssNamespace+"-draggable-dragging "+this.options.cssNamespace+"-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is("."+this.options.cssNamespace+"-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass(c.cssNamespace+"-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body&&a.browser.mozilla)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c)}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop()))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft()))}},_clear:function(){this.helper.removeClass(this.options.cssNamespace+"-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);if(b=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(b){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));a.extend(a.ui.draggable,{version:"1.6rc6",eventPrefix:"drag",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cssNamespace:"ui",cursor:"default",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});a.ui.plugin.add("draggable","connectToSortable",{start:function(b,d){var c=a(this).data("draggable"),e=c.options;c.sortables=[];a(e.connectToSortable).each(function(){a(typeof this=="string"?this+"":this).each(function(){if(a.data(this,"sortable")){var f=a.data(this,"sortable");c.sortables.push({instance:f,shouldRevert:f.options.revert});f._refreshItems();f._trigger("activate",b,c)}})})},stop:function(b,d){var c=a(this).data("draggable");a.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(b);this.instance.options.helper=this.instance.options._helper;if(c.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",b,c)}})},drag:function(c,f){var e=a(this).data("draggable"),b=this;var d=function(i){var n=this.offset.click.top,m=this.offset.click.left;var g=this.positionAbs.top,k=this.positionAbs.left;var j=i.height,l=i.width;var p=i.top,h=i.left;return a.ui.isOver(g+n,k+m,p,h,j,l)};a.each(e.sortables,function(g){if(d.call(e,this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(b).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return f.helper[0]};c.target=this.instance.currentItem[0];this.instance._mouseCapture(c,true);this.instance._mouseStart(c,true,true);this.instance.offset.click.top=e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;e._trigger("toSortable",c);e.dropped=this.instance.element;this.instance.fromOutside=e}if(this.instance.currentItem){this.instance._mouseDrag(c)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._mouseStop(c,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}e._trigger("fromSortable",c);e.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(c,d){var b=a("body"),e=a(this).data("draggable").options;if(b.css("cursor")){e._cursor=b.css("cursor")}b.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._cursor){a("body").css("cursor",d._cursor)}}});a.ui.plugin.add("draggable","iframeFix",{start:function(b,c){var d=a(this).data("draggable").options;a(d.iframeFix===true?"iframe":d.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop+f.scrollSpeed}else{if(d.pageY-c.overflowOffset.top<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop-f.scrollSpeed}}}if(!f.axis||f.axis!="y"){if((c.overflowOffset.left+c.scrollParent[0].offsetWidth)-d.pageX<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft+f.scrollSpeed}else{if(d.pageX-c.overflowOffset.left<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft-f.scrollSpeed}}}}else{if(!f.axis||f.axis!="x"){if(d.pageY-a(document).scrollTop()<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-f.scrollSpeed)}else{if(a(window).height()-(d.pageY-a(document).scrollTop())<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+f.scrollSpeed)}}}if(!f.axis||f.axis!="y"){if(d.pageX-a(document).scrollLeft()<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-f.scrollSpeed)}else{if(a(window).width()-(d.pageX-a(document).scrollLeft())<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+f.scrollSpeed)}}}}if(b!==false&&a.ui.ddmanager&&!f.dropBehaviour){a.ui.ddmanager.prepareOffsets(c,d)}}});a.ui.plugin.add("draggable","snap",{start:function(c,d){var b=a(this).data("draggable"),e=b.options;b.snapElements=[];a(e.snap.constructor!=String?(e.snap.items||":data(draggable)"):e.snap).each(function(){var g=a(this);var f=g.offset();if(this!=b.element[0]){b.snapElements.push({item:this,width:g.outerWidth(),height:g.outerHeight(),top:f.top,left:f.left})}})},drag:function(u,p){var g=a(this).data("draggable"),q=g.options;var y=q.snapTolerance;var x=p.absolutePosition.left,w=x+g.helperProportions.width,f=p.absolutePosition.top,e=f+g.helperProportions.height;for(var v=g.snapElements.length-1;v>=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y<x&&x<n+y&&m-y<f&&f<A+y)||(s-y<x&&x<n+y&&m-y<e&&e<A+y)||(s-y<w&&w<n+y&&m-y<f&&f<A+y)||(s-y<w&&w<n+y&&m-y<e&&e<A+y))){if(g.snapElements[v].snapping){(g.options.snap.release&&g.options.snap.release.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=false;continue}if(q.snapMode!="inner"){var c=Math.abs(m-e)<=y;var z=Math.abs(A-f)<=y;var j=Math.abs(s-w)<=y;var k=Math.abs(n-x)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m-g.helperProportions.height,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s-g.helperProportions.width}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n}).left-g.margins.left}}var h=(c||z||j||k);if(q.snapMode!="outer"){var c=Math.abs(m-f)<=y;var z=Math.abs(A-e)<=y;var j=Math.abs(s-x)<=y;var k=Math.abs(n-w)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A-g.helperProportions.height,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n-g.helperProportions.width}).left-g.margins.left}}if(!g.snapElements[v].snapping&&(c||z||j||k||h)){(g.options.snap.snap&&g.options.snap.snap.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=(c||z||j||k||h)}}});a.ui.plugin.add("draggable","stack",{start:function(b,c){var e=a(this).data("draggable").options;var d=a.makeArray(a(e.stack.group)).sort(function(g,f){return(parseInt(a(g).css("zIndex"),10)||e.stack.min)-(parseInt(a(f).css("zIndex"),10)||e.stack.min)});a(d).each(function(f){this.style.zIndex=e.stack.min+f});this[0].style.zIndex=e.stack.min+d.length}});a.ui.plugin.add("draggable","zIndex",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("zIndex")){e._zIndex=b.css("zIndex")}b.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._zIndex){a(c.helper).css("zIndex",d._zIndex)}}})})(jQuery);;/*
- * jQuery UI Resizable 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Resizables
- *
- * Depends:
- * ui.core.js
- */
(function(b){b.widget("ui.resizable",b.extend({},b.ui.mouse,{_init:function(){var d=this,h=this.options;this.element.addClass("ui-resizable");b.extend(this,{_aspectRatio:!!(h.aspectRatio),aspectRatio:h.aspectRatio,originalElement:this.element,proportionallyResize:h.proportionallyResize?[h.proportionallyResize]:[],_helper:h.helper||h.ghost||h.animate?h.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&b.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(b('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent();this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});if(b.browser.safari&&h.preventDefault){this.originalElement.css("resize","none")}this.proportionallyResize.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=h.handles||(!b(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var j=this.handles.split(",");this.handles={};for(var e=0;e<j.length;e++){var g=b.trim(j[e]),c="ui-resizable-"+g;var f=b('<div class="ui-resizable-handle '+c+'"></div>');if(/sw|se|ne|nw/.test(g)){f.css({zIndex:++h.zIndex})}if("se"==g){f.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[g]=".ui-resizable-"+g;this.element.append(f)}}this._renderAxis=function(o){o=o||this.element;for(var l in this.handles){if(this.handles[l].constructor==String){this.handles[l]=b(this.handles[l],this.element).show()}if(h.transparent){this.handles[l].css({opacity:0})}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var m=b(this.handles[l],this.element),n=0;n=/sw|ne|nw|se|n|s/.test(l)?m.outerHeight():m.outerWidth();var k=["padding",/ne|nw|n/.test(l)?"Top":/se|sw|s/.test(l)?"Bottom":/^e$/.test(l)?"Right":"Left"].join("");if(!h.transparent){o.css(k,n)}this._proportionallyResize()}if(!b(this.handles[l]).length){continue}}};this._renderAxis(this.element);this._handles=b(".ui-resizable-handle",this.element);if(h.disableSelection){this._handles.disableSelection()}this._handles.mouseover(function(){if(!d.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}d.axis=i&&i[1]?i[1]:"se"}});if(h.autoHide){this._handles.hide();b(this.element).addClass("ui-resizable-autohide").hover(function(){b(this).removeClass("ui-resizable-autohide");d._handles.show()},function(){if(!d.resizing){b(this).addClass("ui-resizable-autohide");d._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var c=function(d){b(d).removeClass("ui-resizable ui-resizable-disabled").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){c(this.element);this.wrapper.parent().append(this.originalElement.css({position:this.wrapper.css("position"),width:this.wrapper.outerWidth(),height:this.wrapper.outerHeight(),top:this.wrapper.css("top"),left:this.wrapper.css("left")})).end().remove()}c(this.originalElement)},_mouseCapture:function(d){var e=false;for(var c in this.handles){if(b(this.handles[c])[0]==d.target){e=true}}return this.options.disabled||!!e},_mouseStart:function(e){var h=this.options,d=this.element.position(),c=this.element;this.resizing=true;this.documentScroll={top:b(document).scrollTop(),left:b(document).scrollLeft()};if(c.is(".ui-draggable")||(/absolute/).test(c.css("position"))){c.css({position:"absolute",top:d.top,left:d.left})}if(b.browser.opera&&(/relative/).test(c.css("position"))){c.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var i=a(this.helper.css("left")),f=a(this.helper.css("top"));if(h.containment){i+=b(h.containment).scrollLeft()||0;f+=b(h.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:i,top:f};this.size=this._helper?{width:c.outerWidth(),height:c.outerHeight()}:{width:c.width(),height:c.height()};this.originalSize=this._helper?{width:c.outerWidth(),height:c.outerHeight()}:{width:c.width(),height:c.height()};this.originalPosition={left:i,top:f};this.sizeDiff={width:c.outerWidth()-c.width(),height:c.outerHeight()-c.height()};this.originalMousePosition={left:e.pageX,top:e.pageY};this.aspectRatio=(typeof h.aspectRatio=="number")?h.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);if(h.preserveCursor){var g=b(".ui-resizable-"+this.axis).css("cursor");b("body").css("cursor",g=="auto"?this.axis+"-resize":g)}this._propagate("start",e);return true},_mouseDrag:function(c){var f=this.helper,e=this.options,k={},n=this,h=this.originalMousePosition,l=this.axis;var p=(c.pageX-h.left)||0,m=(c.pageY-h.top)||0;var g=this._change[l];if(!g){return false}var j=g.apply(this,[c,p,m]),i=b.browser.msie&&b.browser.version<7,d=this.sizeDiff;if(this._aspectRatio||c.shiftKey){j=this._updateRatio(j,c)}j=this._respectSize(j,c);this._propagate("resize",c);f.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this.proportionallyResize.length){this._proportionallyResize()}this._updateCache(j);this._trigger("resize",c,this.ui());return false},_mouseStop:function(f){this.resizing=false;var g=this.options,k=this;if(this._helper){var e=this.proportionallyResize,c=e.length&&(/textarea/i).test(e[0].nodeName),d=c&&b.ui.hasScroll(e[0],"left")?0:k.sizeDiff.height,i=c?0:k.sizeDiff.width;var l={width:(k.size.width-i),height:(k.size.height-d)},h=(parseInt(k.element.css("left"),10)+(k.position.left-k.originalPosition.left))||null,j=(parseInt(k.element.css("top"),10)+(k.position.top-k.originalPosition.top))||null;if(!g.animate){this.element.css(b.extend(l,{top:j,left:h}))}if(this._helper&&!g.animate){this._proportionallyResize()}}if(g.preserveCursor){b("body").css("cursor","auto")}this._propagate("stop",f);if(this._helper){this.helper.remove()}return false},_updateCache:function(c){var d=this.options;this.offset=this.helper.offset();if(c.left){this.position.left=c.left}if(c.top){this.position.top=c.top}if(c.height){this.size.height=c.height}if(c.width){this.size.width=c.width}},_updateRatio:function(f,e){var g=this.options,h=this.position,d=this.size,c=this.axis;if(f.height){f.width=(d.height*this.aspectRatio)}else{if(f.width){f.height=(d.width/this.aspectRatio)}}if(c=="sw"){f.left=h.left+(d.width-f.width);f.top=null}if(c=="nw"){f.top=h.top+(d.height-f.height);f.left=h.left+(d.width-f.width)}return f},_respectSize:function(j,e){var r=function(o){return !isNaN(parseInt(o,10))};var h=this.helper,g=this.options,p=this._aspectRatio||e.shiftKey,n=this.axis,s=r(j.width)&&g.maxWidth&&(g.maxWidth<j.width),k=r(j.height)&&g.maxHeight&&(g.maxHeight<j.height),f=r(j.width)&&g.minWidth&&(g.minWidth>j.width),q=r(j.height)&&g.minHeight&&(g.minHeight>j.height);if(f){j.width=g.minWidth}if(q){j.height=g.minHeight}if(s){j.width=g.maxWidth}if(k){j.height=g.maxHeight}var d=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height;var i=/sw|nw|w/.test(n),c=/nw|ne|n/.test(n);if(f&&i){j.left=d-g.minWidth}if(s&&i){j.left=d-g.maxWidth}if(q&&c){j.top=m-g.minHeight}if(k&&c){j.top=m-g.maxHeight}var l=!j.width&&!j.height;if(l&&!j.left&&j.top){j.top=null}else{if(l&&!j.top&&j.left){j.left=null}}return j},_proportionallyResize:function(){var h=this.options;if(!this.proportionallyResize.length){return}var e=this.helper||this.element;for(var d=0;d<this.proportionallyResize.length;d++){var f=this.proportionallyResize[d];if(!this.borderDif){var c=[f.css("borderTopWidth"),f.css("borderRightWidth"),f.css("borderBottomWidth"),f.css("borderLeftWidth")],g=[f.css("paddingTop"),f.css("paddingRight"),f.css("paddingBottom"),f.css("paddingLeft")];this.borderDif=b.map(c,function(j,l){var k=parseInt(j,10)||0,m=parseInt(g[l],10)||0;return k+m})}if(b.browser.msie&&!(!(b(e).is(":hidden")||b(e).parents(":hidden").length))){continue}f.css({height:(e.height()-this.borderDif[0]-this.borderDif[2])||0,width:(e.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var d=this.element,g=this.options;this.elementOffset=d.offset();if(this._helper){this.helper=this.helper||b('<div style="overflow:hidden;"></div>');var c=b.browser.msie&&b.browser.version<7,e=(c?1:0),f=(c?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++g.zIndex});this.helper.appendTo("body");if(g.disableSelection){this.helper.disableSelection()}}else{this.helper=this.element}},_change:{e:function(e,d,c){return{width:this.originalSize.width+d}},w:function(f,d,c){var h=this.options,e=this.originalSize,g=this.originalPosition;return{left:g.left+d,width:e.width-d}},n:function(f,d,c){var h=this.options,e=this.originalSize,g=this.originalPosition;return{top:g.top+c,height:e.height-c}},s:function(e,d,c){return{height:this.originalSize.height+c}},se:function(e,d,c){return b.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,d,c]))},sw:function(e,d,c){return b.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,d,c]))},ne:function(e,d,c){return b.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,d,c]))},nw:function(e,d,c){return b.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,d,c]))}},_propagate:function(d,c){b.ui.plugin.call(this,d,[c,this.ui()]);(d!="resize"&&this._trigger(d,c,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));b.extend(b.ui.resizable,{version:"1.6rc6",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,disableSelection:true,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,preserveCursor:true,preventDefault:true,proportionallyResize:false,transparent:false,zIndex:1000}});b.ui.plugin.add("resizable","alsoResize",{start:function(d,e){var c=b(this).data("resizable"),f=c.options;_store=function(g){b(g).each(function(){b(this).data("resizable-alsoresize",{width:parseInt(b(this).width(),10),height:parseInt(b(this).height(),10),left:parseInt(b(this).css("left"),10),top:parseInt(b(this).css("top"),10)})})};if(typeof(f.alsoResize)=="object"&&!f.alsoResize.parentNode){if(f.alsoResize.length){f.alsoResize=f.alsoResize[0];_store(f.alsoResize)}else{b.each(f.alsoResize,function(g,h){_store(g)})}}else{_store(f.alsoResize)}},resize:function(e,g){var d=b(this).data("resizable"),h=d.options,f=d.originalSize,j=d.originalPosition;var i={height:(d.size.height-f.height)||0,width:(d.size.width-f.width)||0,top:(d.position.top-j.top)||0,left:(d.position.left-j.left)||0},c=function(k,l){b(k).each(function(){var o=b(this),p=b(this).data("resizable-alsoresize"),n={},m=l&&l.length?l:["width","height","top","left"];b.each(m||["width","height","top","left"],function(q,s){var r=(p[s]||0)+(i[s]||0);if(r&&r>=0){n[s]=r||null}});if(/relative/.test(o.css("position"))&&b.browser.opera){d._revertToRelativePosition=true;o.css({position:"absolute",top:"auto",left:"auto"})}o.css(n)})};if(typeof(h.alsoResize)=="object"&&!h.alsoResize.nodeType){b.each(h.alsoResize,function(k,l){c(k,l)})}else{c(h.alsoResize)}},stop:function(d,e){var c=b(this).data("resizable");if(c._revertToRelativePosition&&b.browser.opera){c._revertToRelativePosition=false;el.css({position:"relative"})}b(this).removeData("resizable-alsoresize-start")}});b.ui.plugin.add("resizable","animate",{stop:function(g,l){var m=b(this).data("resizable"),h=m.options;var f=h.proportionallyResize,c=f&&(/textarea/i).test(f.get(0).nodeName),d=c&&b.ui.hasScroll(f.get(0),"left")?0:m.sizeDiff.height,j=c?0:m.sizeDiff.width;var e={width:(m.size.width-j),height:(m.size.height-d)},i=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,k=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;m.element.animate(b.extend(e,k&&i?{top:k,left:i}:{}),{duration:h.animateDuration,easing:h.animateEasing,step:function(){var n={width:parseInt(m.element.css("width"),10),height:parseInt(m.element.css("height"),10),top:parseInt(m.element.css("top"),10),left:parseInt(m.element.css("left"),10)};if(f){f.css({width:n.width,height:n.height})}m._updateCache(n);m._propagate("resize",g)}})}});b.ui.plugin.add("resizable","containment",{start:function(d,n){var r=b(this).data("resizable"),h=r.options,j=r.element;var e=h.containment,i=(e instanceof b)?e.get(0):(/parent/.test(e))?j.parent().get(0):e;if(!i){return}r.containerElement=b(i);if(/document/.test(e)||e==document){r.containerOffset={left:0,top:0};r.containerPosition={left:0,top:0};r.parentData={element:b(document),left:0,top:0,width:b(document).width(),height:b(document).height()||document.body.parentNode.scrollHeight}}else{var l=b(i),g=[];b(["Top","Right","Left","Bottom"]).each(function(p,o){g[p]=a(l.css("padding"+o))});r.containerOffset=l.offset();r.containerPosition=l.position();r.containerSize={height:(l.innerHeight()-g[3]),width:(l.innerWidth()-g[1])};var m=r.containerOffset,c=r.containerSize.height,k=r.containerSize.width,f=(b.ui.hasScroll(i,"left")?i.scrollWidth:k),q=(b.ui.hasScroll(i)?i.scrollHeight:c);r.parentData={element:i,left:m.left,top:m.top,width:f,height:q}}},resize:function(e,l){var p=b(this).data("resizable"),g=p.options,d=p.containerSize,k=p.containerOffset,i=p.size,j=p.position,m=g._aspectRatio||e.shiftKey,c={top:0,left:0},f=p.containerElement;if(f[0]!=document&&(/static/).test(f.css("position"))){c=k}if(j.left<(p._helper?k.left:0)){p.size.width=p.size.width+(p._helper?(p.position.left-k.left):(p.position.left-c.left));if(m){p.size.height=p.size.width/g.aspectRatio}p.position.left=g.helper?k.left:0}if(j.top<(p._helper?k.top:0)){p.size.height=p.size.height+(p._helper?(p.position.top-k.top):p.position.top);if(m){p.size.width=p.size.height*g.aspectRatio}p.position.top=p._helper?k.top:0}var h=Math.abs((p._helper?p.offset.left-c.left:(p.offset.left-c.left))+p.sizeDiff.width),n=Math.abs((p._helper?p.offset.top-c.top:(p.offset.top-k.top))+p.sizeDiff.height);if(h+p.size.width>=p.parentData.width){p.size.width=p.parentData.width-h;if(m){p.size.height=p.size.width/g.aspectRatio}}if(n+p.size.height>=p.parentData.height){p.size.height=p.parentData.height-n;if(m){p.size.width=p.size.height*g.aspectRatio}}},stop:function(d,l){var n=b(this).data("resizable"),e=n.options,j=n.position,k=n.containerOffset,c=n.containerPosition,f=n.containerElement;var g=b(n.helper),p=g.offset(),m=g.outerWidth()-n.sizeDiff.width,i=g.outerHeight()-n.sizeDiff.height;if(n._helper&&!e.animate&&(/relative/).test(f.css("position"))){b(this).css({left:p.left-c.left-k.left,width:m,height:i})}if(n._helper&&!e.animate&&(/static/).test(f.css("position"))){b(this).css({left:p.left-c.left-k.left,width:m,height:i})}}});b.ui.plugin.add("resizable","ghost",{start:function(e,f){var c=b(this).data("resizable"),g=c.options,h=g.proportionallyResize,d=c.size;c.ghost=c.originalElement.clone();c.ghost.css({opacity:0.25,display:"block",position:"relative",height:d.height,width:d.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof g.ghost=="string"?g.ghost:"");c.ghost.appendTo(c.helper)},resize:function(d,e){var c=b(this).data("resizable"),f=c.options;if(c.ghost){c.ghost.css({position:"relative",height:c.size.height,width:c.size.width})}},stop:function(d,e){var c=b(this).data("resizable"),f=c.options;if(c.ghost&&c.helper){c.helper.get(0).removeChild(c.ghost.get(0))}}});b.ui.plugin.add("resizable","grid",{resize:function(c,k){var m=b(this).data("resizable"),f=m.options,i=m.size,g=m.originalSize,h=m.originalPosition,l=m.axis,j=f._aspectRatio||c.shiftKey;f.grid=typeof f.grid=="number"?[f.grid,f.grid]:f.grid;var e=Math.round((i.width-g.width)/(f.grid[0]||1))*(f.grid[0]||1),d=Math.round((i.height-g.height)/(f.grid[1]||1))*(f.grid[1]||1);if(/^(se|s|e)$/.test(l)){m.size.width=g.width+e;m.size.height=g.height+d}else{if(/^(ne)$/.test(l)){m.size.width=g.width+e;m.size.height=g.height+d;m.position.top=h.top-d}else{if(/^(sw)$/.test(l)){m.size.width=g.width+e;m.size.height=g.height+d;m.position.left=h.left-e}else{m.size.width=g.width+e;m.size.height=g.height+d;m.position.top=h.top-d;m.position.left=h.left-e}}}}});var a=function(c){return parseInt(c,10)||0}})(jQuery);;/*
- * jQuery UI Dialog 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Dialog
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- * ui.resizable.js
- */
(function(b){var a={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"};b.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var k=this,l=this.options,i=l.title||this.originalTitle||" ",d=b.ui.dialog.getTitleId(this.element),j=(this.uiDialog=b("<div/>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+l.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:l.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(m){(l.closeOnEscape&&m.keyCode&&m.keyCode==b.ui.keyCode.ESCAPE&&k.close(m))}).attr({role:"dialog","aria-labelledby":d}).mousedown(function(m){k.moveToTop(m)}),f=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(j),e=(this.uiDialogTitlebar=b("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(j),h=b('<a href="#"/>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).mousedown(function(m){m.stopPropagation()}).click(function(m){k.close(m);return false}).appendTo(e),g=(this.uiDialogTitlebarCloseText=b("<span/>")).addClass("ui-icon ui-icon-closethick").text(l.closeText).appendTo(h),c=b("<span/>").addClass("ui-dialog-title").attr("id",d).html(i).prependTo(e);e.find("*").add(e).disableSelection();(l.draggable&&b.fn.draggable&&this._makeDraggable());(l.resizable&&b.fn.resizable&&this._makeResizable());this._createButtons(l.buttons);this._isOpen=false;(l.bgiframe&&b.fn.bgiframe&&j.bgiframe());(l.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());(this.shadow&&this._destroyShadow());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(c){if(false===this._trigger("beforeclose",c)){return}(this.overlay&&this.overlay.destroy());(this.shadow&&this._destroyShadow());this.uiDialog.hide(this.options.hide).unbind("keypress.ui-dialog");this._trigger("close",c);b.ui.dialog.overlay.resize();this._isOpen=false},isOpen:function(){return this._isOpen},moveToTop:function(g,f){if((this.options.modal&&!g)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",f)}var e=this.options.zIndex,d=this.options;b(".ui-dialog:visible").each(function(){e=Math.max(e,parseInt(b(this).css("z-index"),10)||d.zIndex)});(this.overlay&&this.overlay.$el.css("z-index",++e));(this.shadow&&this.shadow.css("z-index",++e));var c={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++e);this.element.attr(c);this._trigger("focus",f)},open:function(e){if(this._isOpen){return}var d=this.options,c=this.uiDialog;this.overlay=d.modal?new b.ui.dialog.overlay(this):null;(c.next().length&&c.appendTo("body"));this._size();this._position(d.position);c.show(d.show);this.moveToTop(true,e);(d.modal&&c.bind("keypress.ui-dialog",function(h){if(h.keyCode!=b.ui.keyCode.TAB){return}var g=b(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));b([]).add(c.find(".ui-dialog-content :tabbable:first")).add(c.find(".ui-dialog-buttonpane :tabbable:first")).add(c.find(".ui-dialog-titlebar :tabbable:first")).filter(":first").focus();if(d.shadow){this._createShadow()}this._trigger("open",e);this._isOpen=true},_createButtons:function(f){var e=this,c=false,d=b("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof f=="object"&&f!==null&&b.each(f,function(){return !(c=true)}));if(c){b.each(f,function(g,h){b('<button type="button"></button>').addClass("ui-state-default ui-corner-all").text(g).click(function(){h.apply(e.element[0],arguments)}).hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")}).focus(function(){b(this).addClass("ui-state-focus")}).blur(function(){b(this).removeClass("ui-state-focus")}).appendTo(d)});d.appendTo(this.uiDialog)}},_makeDraggable:function(){var c=this,d=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content",helper:d.dragHelper,handle:".ui-dialog-titlebar",containment:"document",start:function(){(d.dragStart&&d.dragStart.apply(c.element[0],arguments));if(b.browser.msie&&b.browser.version<7&&c.shadow){c.shadow.hide()}},drag:function(){(d.drag&&d.drag.apply(c.element[0],arguments));c._refreshShadow(1)},stop:function(){(d.dragStop&&d.dragStop.apply(c.element[0],arguments));b.ui.dialog.overlay.resize();if(b.browser.msie&&b.browser.version<7&&c.shadow){c.shadow.show()}c._refreshShadow()}})},_makeResizable:function(f){f=(f===undefined?this.options.resizable:f);var c=this,e=this.options,d=typeof f=="string"?f:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,helper:e.resizeHelper,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:e.minHeight,start:function(){(e.resizeStart&&e.resizeStart.apply(c.element[0],arguments));if(b.browser.msie&&b.browser.version<7&&c.shadow){c.shadow.hide()}},resize:function(){(e.resize&&e.resize.apply(c.element[0],arguments));c._refreshShadow(1)},handles:d,stop:function(){(e.resizeStop&&e.resizeStop.apply(c.element[0],arguments));b.ui.dialog.overlay.resize();if(b.browser.msie&&b.browser.version<7&&c.shadow){c.shadow.show()}c._refreshShadow()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(h){var d=b(window),e=b(document),f=e.scrollTop(),c=e.scrollLeft(),g=f;if(b.inArray(h,["center","top","right","bottom","left"])>=0){h=[h=="right"||h=="left"?h:"center",h=="top"||h=="bottom"?h:"middle"]}if(h.constructor!=Array){h=["center","middle"]}if(h[0].constructor==Number){c+=h[0]}else{switch(h[0]){case"left":c+=0;break;case"right":c+=d.width()-this.uiDialog.outerWidth();break;default:case"center":c+=(d.width()-this.uiDialog.outerWidth())/2}}if(h[1].constructor==Number){f+=h[1]}else{switch(h[1]){case"top":f+=0;break;case"bottom":f+=d.height()-this.uiDialog.outerHeight();break;default:case"middle":f+=(d.height()-this.uiDialog.outerHeight())/2}}f=Math.max(f,g);this.uiDialog.css({top:f,left:c})},_setData:function(d,e){(a[d]&&this.uiDialog.data(a[d],e));switch(d){case"buttons":this._createButtons(e);break;case"closeText":this.uiDialogTitlebarCloseText.text(e);break;case"draggable":(e?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(e);break;case"position":this._position(e);break;case"resizable":var c=this.uiDialog,f=this.uiDialog.is(":data(resizable)");(f&&!e&&c.resizable("destroy"));(f&&typeof e=="string"&&c.resizable("option","handles",e));(f||this._makeResizable(e));break;case"title":b(".ui-dialog-title",this.uiDialogTitlebar).html(e||" ");break;case"width":this.uiDialog.width(e);break}b.widget.prototype._setData.apply(this,arguments)},_size:function(){var d=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var c=this.uiDialog.css({height:"auto",width:d.width}).height();this.element.css({minHeight:Math.max(d.minHeight-c,0),height:d.height=="auto"?"auto":d.height-c})},_createShadow:function(){this.shadow=b('<div class="ui-widget-shadow"></div>').css("position","absolute").appendTo(document.body);this._refreshShadow();return this.shadow},_refreshShadow:function(c){if(c&&b.browser.msie&&b.browser.version<7){return}var d=this.uiDialog.offset();this.shadow.css({left:d.left,top:d.top,width:this.uiDialog.outerWidth(),height:this.uiDialog.outerHeight()})},_destroyShadow:function(){this.shadow.remove();this.shadow=null}});b.extend(b.ui.dialog,{version:"1.6rc6",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",draggable:true,height:"auto",minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,shadow:true,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,getTitleId:function(c){return"ui-dialog-title-"+(c.attr("id")||++this.uuid)},overlay:function(c){this.$el=b.ui.dialog.overlay.create(c)}});b.extend(b.ui.dialog.overlay,{instances:[],events:b.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(c){return c+".dialog-overlay"}).join(" "),create:function(d){if(this.instances.length===0){setTimeout(function(){b("a, :input").bind(b.ui.dialog.overlay.events,function(){var f=false;var h=b(this).parents(".ui-dialog");if(h.length){var e=b(".ui-dialog-overlay");if(e.length){var g=parseInt(e.css("z-index"),10);e.each(function(){g=Math.max(g,parseInt(b(this).css("z-index"),10))});f=parseInt(h.css("z-index"),10)>g}else{f=true}}return f})},1);b(document).bind("keydown.dialog-overlay",function(e){(d.options.closeOnEscape&&e.keyCode&&e.keyCode==b.ui.keyCode.ESCAPE&&d.close(e))});b(window).bind("resize.dialog-overlay",b.ui.dialog.overlay.resize)}var c=b("<div></div>").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(d.options.bgiframe&&b.fn.bgiframe&&c.bgiframe());this.instances.push(c);return c},destroy:function(c){this.instances.splice(b.inArray(this.instances,c),1);if(this.instances.length===0){b("a, :input").add([document,window]).unbind(".dialog-overlay")}c.remove()},height:function(){if(b.browser.msie&&b.browser.version<7){var d=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(d<c){return b(window).height()+"px"}else{return d+"px"}}else{return b(document).height()+"px"}},width:function(){if(b.browser.msie&&b.browser.version<7){var c=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var d=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(c<d){return b(window).width()+"px"}else{return c+"px"}}else{return b(document).width()+"px"}},resize:function(){var c=b([]);b.each(b.ui.dialog.overlay.instances,function(){c=c.add(this)});c.css({width:0,height:0}).css({width:b.ui.dialog.overlay.width(),height:b.ui.dialog.overlay.height()})}});b.extend(b.ui.dialog.overlay.prototype,{destroy:function(){b.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);;/*
- * jQuery UI Effects 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/
- */
(function(d){d.effects=d.effects||{};d.extend(d.effects,{version:"1.6rc6",save:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.data("ec.storage."+h[f],g[0].style[h[f]])}}},restore:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.css(h[f],g.data("ec.storage."+h[f]))}}},setMode:function(f,g){if(g=="toggle"){g=f.is(":hidden")?"show":"hide"}return g},getBaseline:function(g,h){var i,f;switch(g[0]){case"top":i=0;break;case"middle":i=0.5;break;case"bottom":i=1;break;default:i=g[0]/h.height}switch(g[1]){case"left":f=0;break;case"center":f=0.5;break;case"right":f=1;break;default:f=g[1]/h.width}return{x:f,y:i}},createWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent()}var g={width:f.outerWidth(true),height:f.outerHeight(true),"float":f.css("float")};f.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}});function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:i.duration;h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(arguments[0].constructor==Function)){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return -(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f},easeOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return h*Math.pow(2,-10*i)*Math.sin((i*l-j)*(2*Math.PI)/k)+m+f},easeInOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l/2)==2){return f+m}if(!k){k=l*(0.3*1.5)}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}if(i<1){return -0.5*(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f}return h*Math.pow(2,-10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k)*0.5+m+f},easeInBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*(h/=j)*h*((i+1)*h-i)+f},easeOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*((h=h/j-1)*h*((i+1)*h+i)+1)+f},easeInOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}if((h/=j/2)<1){return k/2*(h*h*(((i*=(1.525))+1)*h-i))+f}return k/2*((h-=2)*h*(((i*=(1.525))+1)*h+i)+2)+f},easeInBounce:function(g,h,f,j,i){return j-d.easing.easeOutBounce(g,i-h,0,j,i)+f},easeOutBounce:function(g,h,f,j,i){if((h/=i)<(1/2.75)){return j*(7.5625*h*h)+f}else{if(h<(2/2.75)){return j*(7.5625*(h-=(1.5/2.75))*h+0.75)+f}else{if(h<(2.5/2.75)){return j*(7.5625*(h-=(2.25/2.75))*h+0.9375)+f}else{return j*(7.5625*(h-=(2.625/2.75))*h+0.984375)+f}}}},easeInOutBounce:function(g,h,f,j,i){if(h<i/2){return d.easing.easeInBounce(g,h*2,0,j,i)*0.5+f}return d.easing.easeOutBounce(g,h*2-i,0,j,i)*0.5+j*0.5+f}})})(jQuery);;/*
- * jQuery UI Effects Blind 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Blind
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.blind=function(b){return this.queue(function(){var d=a(this),c=["position","top","left"];var h=a.effects.setMode(d,b.options.mode||"hide");var g=b.options.direction||"vertical";a.effects.save(d,c);d.show();var j=a.effects.createWrapper(d).css({overflow:"hidden"});var e=(g=="vertical")?"height":"width";var i=(g=="vertical")?j.height():j.width();if(h=="show"){j.css(e,0)}var f={};f[e]=h=="show"?i:0;j.animate(f,b.duration,b.options.easing,function(){if(h=="hide"){d.hide()}a.effects.restore(d,c);a.effects.removeWrapper(d);if(b.callback){b.callback.apply(d[0],arguments)}d.dequeue()})})}})(jQuery);;/*
- * jQuery UI Effects Bounce 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Bounce
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.bounce=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"up";var c=b.options.distance||20;var d=b.options.times||5;var g=b.duration||250;if(/show|hide/.test(k)){l.push("opacity")}a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var c=b.options.distance||(f=="top"?e.outerHeight({margin:true})/3:e.outerWidth({margin:true})/3);if(k=="show"){e.css("opacity",0).css(f,p=="pos"?-c:c)}if(k=="hide"){c=c/(d*2)}if(k!="hide"){d--}if(k=="show"){var h={opacity:1};h[f]=(p=="pos"?"+=":"-=")+c;e.animate(h,g/2,b.options.easing);c=c/2;d--}for(var j=0;j<d;j++){var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing);c=(k=="hide")?c*2:c/2}if(k=="hide"){var h={opacity:0};h[f]=(p=="pos"?"-=":"+=")+c;e.animate(h,g/2,b.options.easing,function(){e.hide();a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}else{var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/*
- * jQuery UI Effects Clip 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Clip
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.clip=function(b){return this.queue(function(){var f=a(this),j=["position","top","left","height","width"];var i=a.effects.setMode(f,b.options.mode||"hide");var k=b.options.direction||"vertical";a.effects.save(f,j);f.show();var c=a.effects.createWrapper(f).css({overflow:"hidden"});var e=f[0].tagName=="IMG"?c:f;var g={size:(k=="vertical")?"height":"width",position:(k=="vertical")?"top":"left"};var d=(k=="vertical")?e.height():e.width();if(i=="show"){e.css(g.size,0);e.css(g.position,d/2)}var h={};h[g.size]=i=="show"?d:0;h[g.position]=i=="show"?0:d/2;e.animate(h,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){f.hide()}a.effects.restore(f,j);a.effects.removeWrapper(f);if(b.callback){b.callback.apply(f[0],arguments)}f.dequeue()}})})}})(jQuery);;/*
- * jQuery UI Effects Drop 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Drop
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.drop=function(b){return this.queue(function(){var e=a(this),d=["position","top","left","opacity"];var i=a.effects.setMode(e,b.options.mode||"hide");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e);var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true})/2:e.outerWidth({margin:true})/2);if(i=="show"){e.css("opacity",0).css(f,c=="pos"?-j:j)}var g={opacity:i=="show"?1:0};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/*
- * jQuery UI Effects Explode 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Explode
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.explode=function(b){return this.queue(function(){var k=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;var e=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?(a(this).is(":visible")?"hide":"show"):b.options.mode;var h=a(this).show().css("visibility","hidden");var l=h.offset();l.top-=parseInt(h.css("marginTop"))||0;l.left-=parseInt(h.css("marginLeft"))||0;var g=h.outerWidth(true);var c=h.outerHeight(true);for(var f=0;f<k;f++){for(var d=0;d<e;d++){h.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-d*(g/e),top:-f*(c/k)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/e,height:c/k,left:l.left+d*(g/e)+(b.options.mode=="show"?(d-Math.floor(e/2))*(g/e):0),top:l.top+f*(c/k)+(b.options.mode=="show"?(f-Math.floor(k/2))*(c/k):0),opacity:b.options.mode=="show"?0:1}).animate({left:l.left+d*(g/e)+(b.options.mode=="show"?0:(d-Math.floor(e/2))*(g/e)),top:l.top+f*(c/k)+(b.options.mode=="show"?0:(f-Math.floor(k/2))*(c/k)),opacity:b.options.mode=="show"?1:0},b.duration||500)}}setTimeout(function(){b.options.mode=="show"?h.css({visibility:"visible"}):h.css({visibility:"visible"}).hide();if(b.callback){b.callback.apply(h[0])}h.dequeue();a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);;/*
- * jQuery UI Effects Fold 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Fold
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.fold=function(b){return this.queue(function(){var e=a(this),k=["position","top","left"];var h=a.effects.setMode(e,b.options.mode||"hide");var o=b.options.size||15;var n=!(!b.options.horizFirst);var g=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(e,k);e.show();var d=a.effects.createWrapper(e).css({overflow:"hidden"});var i=((h=="show")!=n);var f=i?["width","height"]:["height","width"];var c=i?[d.width(),d.height()]:[d.height(),d.width()];var j=/([0-9]+)%/.exec(o);if(j){o=parseInt(j[1])/100*c[h=="hide"?0:1]}if(h=="show"){d.css(n?{height:0,width:o}:{height:o,width:0})}var m={},l={};m[f[0]]=h=="show"?c[0]:o;l[f[1]]=h=="show"?c[1]:0;d.animate(m,g,b.options.easing).animate(l,g,b.options.easing,function(){if(h=="hide"){e.hide()}a.effects.restore(e,k);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(e[0],arguments)}e.dequeue()})})}})(jQuery);;/*
- * jQuery UI Effects Highlight 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Highlight
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.highlight=function(b){return this.queue(function(){var e=a(this),d=["backgroundImage","backgroundColor","opacity"];var h=a.effects.setMode(e,b.options.mode||"show");var c=b.options.color||"#ffff99";var g=e.css("backgroundColor");a.effects.save(e,d);e.show();e.css({backgroundImage:"none",backgroundColor:c});var f={backgroundColor:g};if(h=="hide"){f.opacity=0}e.animate(f,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(h=="hide"){e.hide()}a.effects.restore(e,d);if(h=="show"&&a.browser.msie){this.style.removeAttribute("filter")}if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/*
- * jQuery UI Effects Pulsate 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Pulsate
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.pulsate=function(b){return this.queue(function(){var d=a(this);var g=a.effects.setMode(d,b.options.mode||"show");var f=b.options.times||5;var e=b.duration?b.duration/2:a.fx.speeds._default/2;if(g=="hide"){f--}if(d.is(":hidden")){d.css("opacity",0);d.show();d.animate({opacity:1},e,b.options.easing);f=f-2}for(var c=0;c<f;c++){d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing)}if(g=="hide"){d.animate({opacity:0},e,b.options.easing,function(){d.hide();if(b.callback){b.callback.apply(this,arguments)}})}else{d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing,function(){if(b.callback){b.callback.apply(this,arguments)}})}d.queue("fx",function(){d.dequeue()});d.dequeue()})}})(jQuery);;/*
- * jQuery UI Effects Scale 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Scale
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.puff=function(b){return this.queue(function(){var f=a(this);var c=a.extend(true,{},b.options);var h=a.effects.setMode(f,b.options.mode||"hide");var g=parseInt(b.options.percent)||150;c.fade=true;var e={height:f.height(),width:f.width()};var d=g/100;f.from=(h=="hide")?e:{height:e.height*d,width:e.width*d};c.from=f.from;c.percent=(h=="hide")?g:100;c.mode=h;f.effect("scale",c,b.duration,b.callback);f.dequeue()})};a.effects.scale=function(b){return this.queue(function(){var g=a(this);var d=a.extend(true,{},b.options);var j=a.effects.setMode(g,b.options.mode||"effect");var h=parseInt(b.options.percent)||(parseInt(b.options.percent)==0?0:(j=="hide"?0:100));var i=b.options.direction||"both";var c=b.options.origin;if(j!="effect"){d.origin=c||["middle","center"];d.restore=true}var f={height:g.height(),width:g.width()};g.from=b.options.from||(j=="show"?{height:0,width:0}:f);var e={y:i!="horizontal"?(h/100):1,x:i!="vertical"?(h/100):1};g.to={height:f.height*e.y,width:f.width*e.x};if(b.options.fade){if(j=="show"){g.from.opacity=0;g.to.opacity=1}if(j=="hide"){g.from.opacity=1;g.to.opacity=0}}d.from=g.from;d.to=g.to;d.mode=j;g.effect("size",d,b.duration,b.callback);g.dequeue()})};a.effects.size=function(b){return this.queue(function(){var c=a(this),n=["position","top","left","width","height","overflow","opacity"];var m=["position","top","left","overflow","opacity"];var j=["width","height","overflow"];var p=["fontSize"];var k=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var f=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];var g=a.effects.setMode(c,b.options.mode||"effect");var i=b.options.restore||false;var e=b.options.scale||"both";var o=b.options.origin;var d={height:c.height(),width:c.width()};c.from=b.options.from||d;c.to=b.options.to||d;if(o){var h=a.effects.getBaseline(o,d);c.from.top=(d.height-c.from.height)*h.y;c.from.left=(d.width-c.from.width)*h.x;c.to.top=(d.height-c.to.height)*h.y;c.to.left=(d.width-c.to.width)*h.x}var l={from:{y:c.from.height/d.height,x:c.from.width/d.width},to:{y:c.to.height/d.height,x:c.to.width/d.width}};if(e=="box"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(k);c.from=a.effects.setTransition(c,k,l.from.y,c.from);c.to=a.effects.setTransition(c,k,l.to.y,c.to)}if(l.from.x!=l.to.x){n=n.concat(f);c.from=a.effects.setTransition(c,f,l.from.x,c.from);c.to=a.effects.setTransition(c,f,l.to.x,c.to)}}if(e=="content"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(p);c.from=a.effects.setTransition(c,p,l.from.y,c.from);c.to=a.effects.setTransition(c,p,l.to.y,c.to)}}a.effects.save(c,i?n:m);c.show();a.effects.createWrapper(c);c.css("overflow","hidden").css(c.from);if(e=="content"||e=="both"){k=k.concat(["marginTop","marginBottom"]).concat(p);f=f.concat(["marginLeft","marginRight"]);j=n.concat(k).concat(f);c.find("*[width]").each(function(){child=a(this);if(i){a.effects.save(child,j)}var q={height:child.height(),width:child.width()};child.from={height:q.height*l.from.y,width:q.width*l.from.x};child.to={height:q.height*l.to.y,width:q.width*l.to.x};if(l.from.y!=l.to.y){child.from=a.effects.setTransition(child,k,l.from.y,child.from);child.to=a.effects.setTransition(child,k,l.to.y,child.to)}if(l.from.x!=l.to.x){child.from=a.effects.setTransition(child,f,l.from.x,child.from);child.to=a.effects.setTransition(child,f,l.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){if(i){a.effects.restore(child,j)}})})}c.animate(c.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(g=="hide"){c.hide()}a.effects.restore(c,i?n:m);a.effects.removeWrapper(c);if(b.callback){b.callback.apply(this,arguments)}c.dequeue()}})})}})(jQuery);;/*
- * jQuery UI Effects Shake 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Shake
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.shake=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"left";var c=b.options.distance||20;var d=b.options.times||3;var g=b.duration||b.options.duration||140;a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var h={},o={},m={};h[f]=(p=="pos"?"-=":"+=")+c;o[f]=(p=="pos"?"+=":"-=")+c*2;m[f]=(p=="pos"?"-=":"+=")+c*2;e.animate(h,g,b.options.easing);for(var j=1;j<d;j++){e.animate(o,g,b.options.easing).animate(m,g,b.options.easing)}e.animate(o,g,b.options.easing).animate(h,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}});e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/*
- * jQuery UI Effects Slide 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Slide
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.slide=function(b){return this.queue(function(){var e=a(this),d=["position","top","left"];var i=a.effects.setMode(e,b.options.mode||"show");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e).css({overflow:"hidden"});var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true}):e.outerWidth({margin:true}));if(i=="show"){e.css(f,c=="pos"?-j:j)}var g={};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/*
- * jQuery UI Effects Transfer 1.6rc6
- *
- * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Effects/Transfer
- *
- * Depends:
- * effects.core.js
- */
(function(a){a.effects.transfer=function(b){return this.queue(function(){var e=a(this);var g=a.effects.setMode(e,b.options.mode||"effect");var f=a(b.options.to);var c=e.offset();var d=a('<div class="ui-effects-transfer"></div>').appendTo(document.body);if(b.options.className){d.addClass(b.options.className)}d.addClass(b.options.className);d.css({top:c.top,left:c.left,height:e.outerHeight()-parseInt(d.css("borderTopWidth"))-parseInt(d.css("borderBottomWidth")),width:e.outerWidth()-parseInt(d.css("borderLeftWidth"))-parseInt(d.css("borderRightWidth")),position:"absolute"});c=f.offset();animation={top:c.top,left:c.left,height:f.outerHeight()-parseInt(d.css("borderTopWidth"))-parseInt(d.css("borderBottomWidth")),width:f.outerWidth()-parseInt(d.css("borderLeftWidth"))-parseInt(d.css("borderRightWidth"))};d.animate(animation,b.duration,b.options.easing,function(){d.remove();if(b.callback){b.callback.apply(e[0],arguments)}e.dequeue()})})}})(jQuery);;
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/scripts/jquery.cookie.js b/projecttemplates/WebFormsRelyingParty/scripts/jquery.cookie.js deleted file mode 100644 index 121f723..0000000 --- a/projecttemplates/WebFormsRelyingParty/scripts/jquery.cookie.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* Cookie plugin -* -* Copyright (c) 2006 Klaus Hartl (stilbuero.de) -* Dual licensed under the MIT and GPL licenses: -* http://www.opensource.org/licenses/mit-license.php -* http://www.gnu.org/licenses/gpl.html -* -*/ - -/** -* Create a cookie with the given name and value and other optional parameters. -* -* @example $.cookie('the_cookie', 'the_value'); -* @desc Set the value of a cookie. -* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); -* @desc Create a cookie with all available options. -* @example $.cookie('the_cookie', 'the_value'); -* @desc Create a session cookie. -* @example $.cookie('the_cookie', null); -* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain -* used when the cookie was set. -* -* @param String name The name of the cookie. -* @param String value The value of the cookie. -* @param Object options An object literal containing key/value pairs to provide optional cookie attributes. -* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. -* If a negative value is specified (e.g. a date in the past), the cookie will be deleted. -* If set to null or omitted, the cookie will be a session cookie and will not be retained -* when the the browser exits. -* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). -* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). -* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will -* require a secure protocol (like HTTPS). -* @type undefined -* -* @name $.cookie -* @cat Plugins/Cookie -* @author Klaus Hartl/klaus.hartl@stilbuero.de -*/ - -/** -* Get the value of a cookie with the given name. -* -* @example $.cookie('the_cookie'); -* @desc Get the value of a cookie. -* -* @param String name The name of the cookie. -* @return The value of the cookie. -* @type String -* -* @name $.cookie -* @cat Plugins/Cookie -* @author Klaus Hartl/klaus.hartl@stilbuero.de -*/ -jQuery.cookie = function(name, value, options) { - if (typeof value != 'undefined') { // name and value given, set cookie - options = options || {}; - if (value === null) { - value = ''; - options.expires = -1; - } - var expires = ''; - if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { - var date; - if (typeof options.expires == 'number') { - date = new Date(); - date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); - } else { - date = options.expires; - } - expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE - } - // CAUTION: Needed to parenthesize options.path and options.domain - // in the following expressions, otherwise they evaluate to undefined - // in the packed version for some reason... - var path = options.path ? '; path=' + (options.path) : ''; - var domain = options.domain ? '; domain=' + (options.domain) : ''; - var secure = options.secure ? '; secure' : ''; - document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); - } else { // only name given, get cookie - var cookieValue = null; - if (document.cookie && document.cookie != '') { - var cookies = document.cookie.split(';'); - for (var i = 0; i < cookies.length; i++) { - var cookie = jQuery.trim(cookies[i]); - // Does this cookie string begin with the name we want? - if (cookie.substring(0, name.length + 1) == (name + '=')) { - cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); - break; - } - } - } - return cookieValue; - } -};
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/styles/Standard.css b/projecttemplates/WebFormsRelyingParty/styles/Standard.css deleted file mode 100644 index c6afc66..0000000 --- a/projecttemplates/WebFormsRelyingParty/styles/Standard.css +++ /dev/null @@ -1,67 +0,0 @@ -body -{ - font-family: Cambria, Arial, Times New Roman; - font-size: 12pt; -} - -h1 a -{ - text-decoration: none; - color: Black; -} - -div.OpenIdButtons -{ - margin-bottom: 10px; -} - -div.OpenIdButtons span.OpenIdButton -{ - margin-left: 2px; - margin-right: 2px; - display: table; - float: left; - width: 92px; - height: 64px; - border: solid 1px lightgray; - text-align: center; - vertical-align: middle; - cursor: pointer; -} - -div.OpenIdButtons span.OpenIdButton span -{ - margin: 0; - padding: 0; - top: 50%; - display: table-cell; - vertical-align: middle; -} - -div.OpenIdButtons span.OpenIdButton object -{ - height: 0px; -} - -div.OpenIdButtons span.OpenIdButton div -{ - display: inline-block; - margin: 0; - padding: 0; -} - -div.OpenIdBox -{ - margin-top: 10px; - clear: left; -} - -ul.AuthTokens li.OpenID -{ - list-style-image: url(../images/openid_login.png); -} - -ul.AuthTokens li.InfoCard -{ - list-style-image: url(../images/infocard_23x16.png); -} diff --git a/projecttemplates/WebFormsRelyingParty/styles/loginpopup.css b/projecttemplates/WebFormsRelyingParty/styles/loginpopup.css deleted file mode 100644 index 89e1b38..0000000 --- a/projecttemplates/WebFormsRelyingParty/styles/loginpopup.css +++ /dev/null @@ -1,23 +0,0 @@ -body -{ - font-family: Verdana; - font-size: 10pt; - background-color: White; - margin: 10px; -} -/* -body > div.wrapper -{ - width: 355px; - height: 235px; -} -*/ -Div#NotMyComputerDiv -{ - display: none; -} - -.helpDoc -{ - font-size: 80%; -}
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_flat_55_999999_40x100.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_flat_55_999999_40x100.png Binary files differdeleted file mode 100644 index 6b6de7d..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_flat_55_999999_40x100.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_flat_75_aaaaaa_40x100.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_flat_75_aaaaaa_40x100.png Binary files differdeleted file mode 100644 index 5b5dab2..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_flat_75_aaaaaa_40x100.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_glass_45_0078ae_1x400.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_glass_45_0078ae_1x400.png Binary files differdeleted file mode 100644 index 3dac650..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_glass_45_0078ae_1x400.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_glass_55_f8da4e_1x400.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_glass_55_f8da4e_1x400.png Binary files differdeleted file mode 100644 index b383704..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_glass_55_f8da4e_1x400.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_glass_75_79c9ec_1x400.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_glass_75_79c9ec_1x400.png Binary files differdeleted file mode 100644 index d384e42..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_glass_75_79c9ec_1x400.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_gloss-wave_45_e14f1c_500x100.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_gloss-wave_45_e14f1c_500x100.png Binary files differdeleted file mode 100644 index b9851ba..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_gloss-wave_45_e14f1c_500x100.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_gloss-wave_50_6eac2c_500x100.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_gloss-wave_50_6eac2c_500x100.png Binary files differdeleted file mode 100644 index 76dac56..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_gloss-wave_50_6eac2c_500x100.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_gloss-wave_75_2191c0_500x100.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_gloss-wave_75_2191c0_500x100.png Binary files differdeleted file mode 100644 index eeacf69..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_gloss-wave_75_2191c0_500x100.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_inset-hard_100_fcfdfd_1x100.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_inset-hard_100_fcfdfd_1x100.png Binary files differdeleted file mode 100644 index 38c3833..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_0078ae_256x240.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_0078ae_256x240.png Binary files differdeleted file mode 100644 index 58f96f8..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_0078ae_256x240.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_056b93_256x240.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_056b93_256x240.png Binary files differdeleted file mode 100644 index 8e6103d..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_056b93_256x240.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_d8e7f3_256x240.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_d8e7f3_256x240.png Binary files differdeleted file mode 100644 index 2c8aac4..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_d8e7f3_256x240.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_e0fdff_256x240.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_e0fdff_256x240.png Binary files differdeleted file mode 100644 index d985a26..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_e0fdff_256x240.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_f5e175_256x240.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_f5e175_256x240.png Binary files differdeleted file mode 100644 index 7862520..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_f5e175_256x240.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_f7a50d_256x240.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_f7a50d_256x240.png Binary files differdeleted file mode 100644 index c5297f8..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_f7a50d_256x240.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_fcd113_256x240.png b/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_fcd113_256x240.png Binary files differdeleted file mode 100644 index 68dcff5..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/images/ui-icons_fcd113_256x240.png +++ /dev/null diff --git a/projecttemplates/WebFormsRelyingParty/theme/ui.accordion.css b/projecttemplates/WebFormsRelyingParty/theme/ui.accordion.css deleted file mode 100644 index c84ad4e..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/ui.accordion.css +++ /dev/null @@ -1,9 +0,0 @@ -/* Accordion -----------------------------------*/ -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion li {display: inline;} -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } -.ui-accordion .ui-accordion-content-active { display: block; }
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/theme/ui.all.css b/projecttemplates/WebFormsRelyingParty/theme/ui.all.css deleted file mode 100644 index 543e4c3..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/ui.all.css +++ /dev/null @@ -1,2 +0,0 @@ -@import "ui.base.css"; -@import "ui.theme.css"; diff --git a/projecttemplates/WebFormsRelyingParty/theme/ui.base.css b/projecttemplates/WebFormsRelyingParty/theme/ui.base.css deleted file mode 100644 index dadf378..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/ui.base.css +++ /dev/null @@ -1,9 +0,0 @@ -@import url("ui.core.css"); - -@import url("ui.accordion.css"); -@import url("ui.datepicker.css"); -@import url("ui.dialog.css"); -@import url("ui.progressbar.css"); -@import url("ui.resizable.css"); -@import url("ui.slider.css"); -@import url("ui.tabs.css"); diff --git a/projecttemplates/WebFormsRelyingParty/theme/ui.core.css b/projecttemplates/WebFormsRelyingParty/theme/ui.core.css deleted file mode 100644 index d832ad7..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/ui.core.css +++ /dev/null @@ -1,37 +0,0 @@ -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/theme/ui.datepicker.css b/projecttemplates/WebFormsRelyingParty/theme/ui.datepicker.css deleted file mode 100644 index 92986c9..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/ui.datepicker.css +++ /dev/null @@ -1,62 +0,0 @@ -/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:left; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/theme/ui.dialog.css b/projecttemplates/WebFormsRelyingParty/theme/ui.dialog.css deleted file mode 100644 index f10f409..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/ui.dialog.css +++ /dev/null @@ -1,13 +0,0 @@ -/* Dialog -----------------------------------*/ -.ui-dialog { position: relative; padding: .2em; width: 300px; } -.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; }
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/theme/ui.progressbar.css b/projecttemplates/WebFormsRelyingParty/theme/ui.progressbar.css deleted file mode 100644 index bc0939e..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/ui.progressbar.css +++ /dev/null @@ -1,4 +0,0 @@ -/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/theme/ui.resizable.css b/projecttemplates/WebFormsRelyingParty/theme/ui.resizable.css deleted file mode 100644 index 44efeb2..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/ui.resizable.css +++ /dev/null @@ -1,13 +0,0 @@ -/* Resizable -----------------------------------*/ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/theme/ui.slider.css b/projecttemplates/WebFormsRelyingParty/theme/ui.slider.css deleted file mode 100644 index 0792a48..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/ui.slider.css +++ /dev/null @@ -1,17 +0,0 @@ -/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: 1%; display: block; border: 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/theme/ui.tabs.css b/projecttemplates/WebFormsRelyingParty/theme/ui.tabs.css deleted file mode 100644 index 70ed3ef..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/ui.tabs.css +++ /dev/null @@ -1,9 +0,0 @@ -/* Tabs -----------------------------------*/ -.ui-tabs {padding: .2em;} -.ui-tabs .ui-tabs-nav { padding: .2em .2em 0 .2em; position: relative; } -.ui-tabs .ui-tabs-nav li { float: left; border-bottom: 0 !important; margin: 0 .2em -1px 0; padding: 0; list-style: none; } -.ui-tabs .ui-tabs-nav li a { display:block; text-decoration: none; padding: .5em 1em; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: .1em; border-bottom: 0; } -.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border: 0; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; }
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/theme/ui.theme.css b/projecttemplates/WebFormsRelyingParty/theme/ui.theme.css deleted file mode 100644 index 84f7fed..0000000 --- a/projecttemplates/WebFormsRelyingParty/theme/ui.theme.css +++ /dev/null @@ -1,243 +0,0 @@ - - -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://ui.jquery.com/themeroller/?tr=&ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=2191c0&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=75&borderColorHeader=4297d7&fcHeader=eaf5f7&iconColorHeader=d8e7f3&bgColorContent=fcfdfd&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=a6c9e2&fcContent=222222&iconColorContent=0078ae&bgColorDefault=0078ae&bgTextureDefault=02_glass.png&bgImgOpacityDefault=45&borderColorDefault=77d5f7&fcDefault=ffffff&iconColorDefault=e0fdff&bgColorHover=79c9ec&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=448dae&fcHover=026890&iconColorHover=056b93&bgColorActive=6eac2c&bgTextureActive=12_gloss_wave.png&bgImgOpacityActive=50&borderColorActive=acdd4a&fcActive=ffffff&iconColorActive=f5e175&bgColorHighlight=f8da4e&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcd113&fcHighlight=915608&iconColorHighlight=f7a50d&bgColorError=e14f1c&bgTextureError=12_gloss_wave.png&bgImgOpacityError=45&borderColorError=cd0a0a&fcError=ffffff&iconColorError=fcd113&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=75&opacityOverlay=30&bgColorShadow=999999&bgTextureShadow=01_flat.png&bgImgOpacityShadow=55&opacityShadow=45&thicknessShadow=0px&offsetTopShadow=5px&offsetLeftShadow=5px&cornerRadiusShadow=5px -*/ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } -.ui-widget-header { border: 1px solid #4297d7; background: #2191c0 url(images/ui-bg_gloss-wave_75_2191c0_500x100.png) 50% 50% repeat-x; color: #eaf5f7; font-weight: bold; } -.ui-widget-header a { color: #eaf5f7; } -.ui-widget-content { border: 1px solid #a6c9e2; background: #fcfdfd url(images/ui-bg_inset-hard_100_fcfdfd_1x100.png) 50% bottom repeat-x; color: #222222; } -.ui-widget-content a { color: #222222; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #77d5f7; background: #0078ae url(images/ui-bg_glass_45_0078ae_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; outline: none; } -.ui-state-default a { color: #ffffff; text-decoration: none; outline: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #448dae; background: #79c9ec url(images/ui-bg_glass_75_79c9ec_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #026890; outline: none; } -.ui-state-hover a { color: #026890; text-decoration: none; outline: none; } -.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #acdd4a; background: #6eac2c url(images/ui-bg_gloss-wave_50_6eac2c_500x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; outline: none; } -.ui-state-active a { color: #ffffff; outline: none; text-decoration: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcd113; background: #f8da4e url(images/ui-bg_glass_55_f8da4e_1x400.png) 50% 50% repeat-x; color: #915608; } -.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #e14f1c url(images/ui-bg_gloss-wave_45_e14f1c_500x100.png) 50% top repeat-x; color: #ffffff; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #ffffff; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_0078ae_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_0078ae_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_d8e7f3_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_e0fdff_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_056b93_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_f5e175_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_f7a50d_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_fcd113_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; } -.ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; } -.ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; } -.ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; } -.ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; } -.ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; } -.ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; } - -/* Overlays */ -.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_75_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } -.ui-widget-shadow { margin: 5px 0 0 5px; padding: 0px; background: #999999 url(images/ui-bg_flat_55_999999_40x100.png) 50% 50% repeat-x; opacity: .45;filter:Alpha(Opacity=45); -moz-border-radius: 5px; -webkit-border-radius: 5px; }
\ No newline at end of file diff --git a/projecttemplates/WebFormsRelyingParty/xrds.aspx b/projecttemplates/WebFormsRelyingParty/xrds.aspx deleted file mode 100644 index cb36eee..0000000 --- a/projecttemplates/WebFormsRelyingParty/xrds.aspx +++ /dev/null @@ -1,20 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" ContentType="application/xrds+xml" %><?xml version="1.0" encoding="UTF-8"?> -<%-- -This page is a required for relying party discovery per OpenID 2.0. -It allows Providers to call back to the relying party site to confirm the -identity that it is claiming in the realm and return_to URLs. -This page should be pointed to by the 'realm' home page, which is default.aspx. ---%> -<xrds:XRDS - xmlns:xrds="xri://$xrds" - xmlns:openid="http://openid.net/xmlns/1.0" - xmlns="xri://$xrd*($v*2.0)"> - <XRD> - <Service priority="1"> - <Type>http://specs.openid.net/auth/2.0/return_to</Type> - <%-- Every page with an OpenID login should be listed here. --%> - <URI priority="1"><%=new Uri(Request.Url, Response.ApplyAppPathModifier("~/LoginFrame.aspx"))%></URI> - <URI priority="2"><%=new Uri(Request.Url, Response.ApplyAppPathModifier("~/Members/AccountInfo.aspx"))%></URI> - </Service> - </XRD> -</xrds:XRDS> diff --git a/projecttemplates/projecttemplates.proj b/projecttemplates/projecttemplates.proj deleted file mode 100644 index 6b8605b..0000000 --- a/projecttemplates/projecttemplates.proj +++ /dev/null @@ -1,280 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))' != '' " /> - <Import Project="$(MSBuildProjectDirectory)\..\tools\DotNetOpenAuth.automated.props"/> - <Import Project="ProjectTemplates.props"/> - - <PropertyGroup> - <ProjectTemplateMaxPath Condition=" '$(ProjectTemplateMaxPath)' == '' ">10</ProjectTemplateMaxPath> - - <LayoutDependsOn> - BuildUnifiedProduct; - ResignShippingDelaySignedAssemblies; - DeploySql; - LayoutProjects; - </LayoutDependsOn> - - <!-- We don't need to build the project templates, but to make sure we're not shipping junk, - we default to building them as a validation step. --> - <LayoutDependsOn Condition=" '$(Validation)' == 'Full' "> - Validate; - $(LayoutDependsOn); - </LayoutDependsOn> - </PropertyGroup> - - <ItemGroup> - <ProjectTemplates Include="**\*.*proj" Exclude="$(MSBuildThisFile)" /> - - <ProjectReferencesToRemove Include="..\RelyingPartyDatabase\RelyingPartyDatabase.sqlproj"/> - <AssemblyReferencesToReplaceWith Include="REMOVE" /> - </ItemGroup> - - <Target Name="Validate"> - <MSBuild Projects="@(ProjectTemplates)" BuildInParallel="$(BuildInParallel)" /> - </Target> - - <Target Name="DeploySql"> - <!-- This causes the SQL script that generates the database to be deployed to the RelyingPartyLogic class library. --> - <MSBuild Projects="RelyingPartyDatabase\RelyingPartyDatabase.sqlproj" Targets="Build" BuildInParallel="$(BuildInParallel)" /> - </Target> - - <Target Name="LayoutProjects"> - <MSBuild Projects="..\src\$(ProductName)\$(ProductName).proj" Targets="Sign" BuildInParallel="$(BuildInParallel)"> - <Output TaskParameter="TargetOutputs" ItemName="SignedProductAssemblies" /> - </MSBuild> - <ItemGroup> - <UnifiedSignedProductAssembly Include="@(SignedProductAssemblies)" Condition=" '%(SignedProductAssemblies.FileName)' == '$(ProductName)' " /> - <TemplateProjects Include="**\*.csproj" Exclude="$(MSBuildThisFile)"> - <AfterTokens>$safeprojectname$</AfterTokens> - <!-- Projects can get changed after the transform+copy operation, so don't skip copying them. --> - <SkipUnchangedFiles>false</SkipUnchangedFiles> - </TemplateProjects> - <TemplateProjects> - <BeforeTokens>%(RecursiveDir)</BeforeTokens> - </TemplateProjects> - <TemplateProjectsLayout Include="@(TemplateProjects->'$(ProjectTemplatesLayoutPath)%(RecursiveDir)%(FileName)%(Extension)')"/> - - <!-- Add external libraries and their symbols --> - <ProjectTemplateLibraries Include="@(UnifiedSignedProductAssembly)" /> - <ProjectTemplateLibraries Include="@(UnifiedSignedProductAssembly->'%(SymbolPath)')" /> - <ProjectTemplateLibraries Include="@(UnifiedSignedProductAssembly->'%(XmlDocumentationFile)')" /> - <!-- ... and log4net --> - <ProjectTemplateLibraries Include="$(ProjectRoot)lib\log4net.dll" /> - <ProjectTemplateLibraries Include="$(ProjectRoot)lib\log4net.xml" /> - <ProjectTemplateLibrariesTargets Include="@(ProjectTemplateLibraries->'$(ProjectTemplatesLayoutPath)RelyingPartyLogic\lib\%(CultureDir)%(FileName)%(Extension)')"> - <ApparentSource>RelyingPartyLogic\lib\%(ProjectTemplateLibraries.CultureDir)%(FileName)%(Extension)</ApparentSource> - <ActualSource>%(Identity)</ActualSource> - </ProjectTemplateLibrariesTargets> - <ProjectTemplateLibrariesSourceExceptions Include="@(ProjectTemplateLibrariesTargets->'%(ApparentSource)')"/> - - <FixupReferenceAssemblies Include="@(ProjectTemplateLibrariesTargets)" Condition="'%(Extension)' == '.dll'" /> - <InjectedLibraryItems Include="@(ProjectTemplateLibraries->'lib\%(CultureDir)%(FileName)%(Extension)')"> - <Visible/> - <UnsignedAssemblyPath/> - <SymbolPath/> - <OriginalItemSpec/> - <MSBuildSourceProjectFile/> - <MSBuildSourceTargetName/> - <CultureDir/> - </InjectedLibraryItems> - - <VSProjectTemplates Include="**\*.vstemplate" Exclude="*.vstemplate" /> - <VSProjectTemplatesLayout Include="@(VSProjectTemplates->'$(ProjectTemplatesLayoutPath)%(RecursiveDir)%(FileName)%(Extension)')" /> - </ItemGroup> - - <Trim Inputs="@(TemplateProjects)" MetadataName="BeforeTokens" AllAfter="\"> - <Output TaskParameter="Outputs" ItemName="TemplateProjectsTransformSource" /> - </Trim> - <CopyWithTokenSubstitution SourceFiles="@(TemplateProjectsTransformSource)" DestinationFiles="@(TemplateProjectsLayout)"> - <Output TaskParameter="CopiedFiles" ItemName="CopiedProjectFiles" /> - </CopyWithTokenSubstitution> - <ChangeProjectReferenceToAssemblyReference - Projects="@(CopiedProjectFiles)" - Condition=" '%(CopiedProjectFiles.Extension)' == '.csproj' " - ProjectReferences="@(ProjectReferencesToRemove)" - References="@(AssemblyReferencesToReplaceWith)" /> - <FixupReferenceHintPaths - Projects="@(CopiedProjectFiles)" - References="@(FixupReferenceAssemblies)" - /> - <AddProjectItems - Projects="@(CopiedProjectFiles)" - Condition="'%(CopiedProjectFiles.FileName)%(CopiedProjectFiles.Extension)' == 'RelyingPartyLogic.csproj'" - Items="@(InjectedLibraryItems)" - /> - <MergeProjectWithVSTemplate - ProjectItemTypes="@(VsTemplateProjectItemTypes)" - ReplaceParametersExtensions="@(VsTemplateParameterReplaceExtensions)" - SourceTemplates="@(VSProjectTemplates)" - SourceProjects="@(TemplateProjectsLayout)" - DestinationTemplates="@(VSProjectTemplatesLayout)" - SourcePathExceptions="@(ProjectTemplateLibrariesSourceExceptions)" - MaximumRelativePathLength="$(ProjectTemplateMaxPath)" - > - <Output TaskParameter="ProjectItems" ItemName="TemplateProjectItems"/> - </MergeProjectWithVSTemplate> - </Target> - - <Target Name="Layout" DependsOnTargets="$(LayoutDependsOn)"> - <ItemGroup> - <TemplateProjectItems Condition=" '%(Transform)' == 'true' "> - <BeforeTokens>%(RecursiveDir)</BeforeTokens> - <AfterTokens>$safeprojectname$</AfterTokens> - </TemplateProjectItems> - <TemplateProjectItems> - <SkipUnchangedFiles>true</SkipUnchangedFiles> - </TemplateProjectItems> - <TemplateProjectItemsForTransformSource Include="@(TemplateProjectItems->'%(SourceFullPath)')" /> - <TemplateProjectItemsForTransformLayout Include="@(TemplateProjectItems->'%(DestinationFullPath)')" /> - <RootVsTemplateSource Include="*.vstemplate" /> - <ProjectTemplatesSource Include="@(RootVsTemplateSource)" /> - <ProjectTemplatesLayout Include="@(RootVsTemplateSource->'$(ProjectTemplatesLayoutPath)%(FileName)%(Extension)')" /> - - <!-- Include the template icon --> - <ProjectTemplatesSource Include="$(ProjectRoot)doc\logo\favicon.ico" /> - <ProjectTemplatesLayout Include="$(ProjectTemplatesLayoutPath)__TemplateIcon.ico" /> - - <TopLevelVS2010ProjectTemplates Include="@(ProjectTemplatesLayout)" Condition=" '%(Extension)' == '.vstemplate' and '%(RootDir)%(Directory)' == '$(ProjectTemplatesLayoutPath)' " /> - <VS2010ProjectTemplateZipFiles Include="@(TopLevelVS2010ProjectTemplates->'%(RootDir)%(Directory)%(FileName).zip')" /> - - <TemplateProjectItemsForTransformLayoutFixups Include="@(TemplateProjectItemsForTransformLayout)" Condition=" '%(Extension)' == '.aspx' "> - <Pattern><%@ Register Assembly="DotNetOpenAuth[^"]+"</Pattern> - <Replacement><%@ Register Assembly="DotNetOpenAuth"</Replacement> - </TemplateProjectItemsForTransformLayoutFixups> - <TemplateProjectItemsForTransformLayoutFixups Include="@(TemplateProjectItemsForTransformLayout)" Condition=" '%(Extension)' == '.xaml' "> - <Pattern>xmlns\:(.+)assembly=DotNetOpenAuth([^;"]+)</Pattern> - <Replacement>xmlns:$1assembly=DotNetOpenAuth</Replacement> - </TemplateProjectItemsForTransformLayoutFixups> - <TemplateProjectItemsForTransformLayoutFixups Include="@(TemplateProjectItemsForTransformLayout)" Condition=" '%(Extension)' == '.config' "> - <Pattern>type="DotNetOpenAuth([^,]+), DotNetOpenAuth([^"]+)"</Pattern> - <Replacement>type="DotNetOpenAuth$1, DotNetOpenAuth"</Replacement> - </TemplateProjectItemsForTransformLayoutFixups> - </ItemGroup> - - <Copy - SourceFiles="@(ProjectTemplatesSource)" - DestinationFiles="@(ProjectTemplatesLayout)" - SkipUnchangedFiles="true" /> - <CopyWithTokenSubstitution - SourceFiles="@(TemplateProjectItemsForTransformSource)" - DestinationFiles="@(TemplateProjectItemsForTransformLayout)" /> - <RegexFileReplace - Files="@(TemplateProjectItemsForTransformLayoutFixups)" - Pattern="%(Pattern)" - Replacement="%(Replacement)" /> - - <ItemGroup> - <ProjectTemplateIntendedFiles Include=" - @(ProjectTemplatesLayout); - @(TemplateProjectItemsForTransformLayout); - @(VSProjectTemplatesLayout); - @(TemplateProjectsLayout); - @(VS2010ProjectTemplateZipFiles); - " /> - <ProjectTemplateIntendedFiles Remove="@(ProjectItemShortPathAdjustments)" /> - </ItemGroup> - <Purge Directories="$(ProjectTemplatesLayoutPath)" - IntendedFiles="@(ProjectTemplateIntendedFiles)" /> - </Target> - - <Target Name="Zip" DependsOnTargets="Layout" Returns="%(VS2010ProjectTemplateContents.ZipFile)"> - <DiscoverProjectTemplates TopLevelTemplates="@(TopLevelVS2010ProjectTemplates)"> - <Output TaskParameter="ProjectTemplates" ItemName="SubVS2010Templates" /> - <Output TaskParameter="ProjectTemplateContents" ItemName="VS2010TemplateItemContents" /> - </DiscoverProjectTemplates> - - <ItemGroup> - <!-- Include in each template .zip file the top-level .vstemplate file itself. --> - <VS2010ProjectTemplateContents Include="@(TopLevelVS2010ProjectTemplates)"> - <ZipFile>$(ProjectTemplatesLayoutPath)%(FileName).zip</ZipFile> - <WorkingDirectory>$(ProjectTemplatesLayoutPath)</WorkingDirectory> - </VS2010ProjectTemplateContents> - - <!-- Now throw in all the files in each of the project-level template's directories and their children. --> - <VS2010ProjectTemplateContents Include="@(VS2010TemplateItemContents)"> - <ZipFile>$(ProjectTemplatesLayoutPath)%(VS2010TemplateItemContents.TopLevelTemplateFileName).zip</ZipFile> - <WorkingDirectory>$(ProjectTemplatesLayoutPath)</WorkingDirectory> - </VS2010ProjectTemplateContents> - - <!-- Include the template icon for each .zip file. --> - <VS2010ProjectTemplateContents Include="@(TopLevelVS2010ProjectTemplates->'$(ProjectTemplatesLayoutPath)__TemplateIcon.ico')"> - <ZipFile>$(ProjectTemplatesLayoutPath)%(TopLevelVS2010ProjectTemplates.FileName).zip</ZipFile> - <WorkingDirectory>$(ProjectTemplatesLayoutPath)</WorkingDirectory> - </VS2010ProjectTemplateContents> - - <ExtensionVsixContents Include="%(VS2010ProjectTemplateContents.ZipFile)" /> - </ItemGroup> - - <Zip - Files="@(VS2010ProjectTemplateContents)" - ZipFileName="%(VS2010ProjectTemplateContents.ZipFile)" - WorkingDirectory="%(VS2010ProjectTemplateContents.WorkingDirectory)" - ZipLevel="$(ZipLevel)" - /> - </Target> - - <Target Name="Layout2008" DependsOnTargets="Layout"> - <ItemGroup> - <ProjectTemplates2008Source Include="$(ProjectTemplatesLayoutPath)**" Exclude="$(ProjectTemplatesLayoutPath)*.zip" /> - <ProjectTemplates2008Layout Include="@(ProjectTemplates2008Source->'$(ProjectTemplates2008LayoutPath)%(RecursiveDir)%(FileName)%(Extension)')" /> - <ProjectTemplates2008Layout> - <HardLink Condition=" '%(Extension)' != '.csproj' ">true</HardLink> - </ProjectTemplates2008Layout> - - <VS2008ProjectTemplates Include="@(ProjectTemplates2008Layout)" Condition="'%(Extension)' == '.vstemplate'" /> - <TopLevelVS2008ProjectTemplates Include="@(VS2008ProjectTemplates)" Condition="'%(RootDir)%(Directory)' == '$(ProjectTemplates2008LayoutPath)'" /> - <VS2008ProjectTemplateZipFiles Include="@(TopLevelVS2008ProjectTemplates->'%(RootDir)%(Directory)%(FileName).zip')" /> - </ItemGroup> - <Message Text="VS2008ProjectTemplates: @(VS2008ProjectTemplates)" /> - - <HardLinkCopy SourceFiles="@(ProjectTemplates2008Source)" DestinationFiles="@(ProjectTemplates2008Layout)" /> - - <DowngradeProjects - Projects="@(ProjectTemplates2008Layout)" - Condition="'%(Extension)' == '.csproj'" - DowngradeMvc2ToMvc1="$(DowngradeMvc2ToMvc1)" - InPlaceDowngrade="true" - /> - - <Purge Directories="$(ProjectTemplates2008LayoutPath)" - IntendedFiles="@(ProjectTemplates2008Layout);@(VS2008ProjectTemplateZipFiles)" /> - </Target> - - <Target Name="Zip2008" DependsOnTargets="Layout2008" Returns="%(VS2008ProjectTemplateContents.ZipFile)"> - <DiscoverProjectTemplates TopLevelTemplates="@(TopLevelVS2008ProjectTemplates)"> - <Output TaskParameter="ProjectTemplates" ItemName="SubVS2008Templates" /> - <Output TaskParameter="ProjectTemplateContents" ItemName="VS2008TemplateItemContents" /> - </DiscoverProjectTemplates> - - <ItemGroup> - <!-- Include in each template .zip file the top-level .vstemplate file itself. --> - <VS2008ProjectTemplateContents Include="@(TopLevelVS2008ProjectTemplates)"> - <ZipFile>$(ProjectTemplates2008LayoutPath)%(FileName).zip</ZipFile> - <WorkingDirectory>$(ProjectTemplates2008LayoutPath)</WorkingDirectory> - </VS2008ProjectTemplateContents> - - <!-- Now throw in all the files in each of the project-level template's directories and their children. --> - <VS2008ProjectTemplateContents Include="@(VS2008TemplateItemContents)"> - <ZipFile>$(ProjectTemplates2008LayoutPath)%(VS2008TemplateItemContents.TopLevelTemplateFileName).zip</ZipFile> - <WorkingDirectory>$(ProjectTemplates2008LayoutPath)</WorkingDirectory> - </VS2008ProjectTemplateContents> - - <!-- Include the template icon for each .zip file. --> - <VS2008ProjectTemplateContents Include="@(TopLevelVS2008ProjectTemplates->'$(ProjectTemplates2008LayoutPath)__TemplateIcon.ico')"> - <ZipFile>$(ProjectTemplates2008LayoutPath)%(TopLevelVS2008ProjectTemplates.FileName).zip</ZipFile> - <WorkingDirectory>$(ProjectTemplates2008LayoutPath)</WorkingDirectory> - </VS2008ProjectTemplateContents> - </ItemGroup> - - <Zip - Files="@(VS2008ProjectTemplateContents)" - ZipFileName="%(VS2008ProjectTemplateContents.ZipFile)" - WorkingDirectory="%(VS2008ProjectTemplateContents.WorkingDirectory)" - ZipLevel="$(ZipLevel)" - /> - </Target> - - <Target Name="Build" DependsOnTargets="Zip;Zip2008" /> - - <Import Project="$(ProjectRoot)tools\DotNetOpenAuth.automated.targets"/> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " /> -</Project>
\ No newline at end of file diff --git a/projecttemplates/projecttemplates.props b/projecttemplates/projecttemplates.props deleted file mode 100644 index 2bdc859..0000000 --- a/projecttemplates/projecttemplates.props +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <!-- We use GetFullPath here because IntermediatePath may be a relative directory, and we need to do full path comparisons. --> - <ProjectTemplatesLayoutPath>$([System.IO.Path]::GetFullPath('$(IntermediatePath)projecttemplates\'))</ProjectTemplatesLayoutPath> - <ProjectTemplates2008LayoutPath>$([System.IO.Path]::GetFullPath('$(IntermediatePath)projecttemplates2008\'))</ProjectTemplates2008LayoutPath> - </PropertyGroup> -</Project>
\ No newline at end of file diff --git a/src/DotNetOpenAuth.sln b/src/DotNetOpenAuth.sln index 1387e28..9d80625 100644 --- a/src/DotNetOpenAuth.sln +++ b/src/DotNetOpenAuth.sln @@ -36,8 +36,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OAuth2", "OAuth2", "{1E2CBA EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{E9ED920D-1F83-48C0-9A4B-09CCE505FE6D}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Project Templates", "Project Templates", "{B9EB8729-4B54-4453-B089-FE6761BA3057}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Product", "Product", "{8D4236F7-C49B-49D3-BA71-6B86C9514BDE}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenID", "OpenID", "{C7EF1823-3AA7-477E-8476-28929F5C05D2}" @@ -68,17 +66,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OAuthConsumerWpf", "..\samp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenIdOfflineProvider", "..\samples\OpenIdOfflineProvider\OpenIdOfflineProvider.csproj", "{5C65603B-235F-47E6-B536-06385C60DE7F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebFormsRelyingParty", "..\projecttemplates\WebFormsRelyingParty\WebFormsRelyingParty.csproj", "{A78F8FC6-7B03-4230-BE41-761E400D6810}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RelyingPartyLogic", "..\projecttemplates\RelyingPartyLogic\RelyingPartyLogic.csproj", "{17932639-1F50-48AF-B0A5-E2BF832F82CC}" - ProjectSection(ProjectDependencies) = postProject - {08A938B6-EBBD-4036-880E-CE7BA2D14510} = {08A938B6-EBBD-4036-880E-CE7BA2D14510} - EndProjectSection -EndProject -Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "RelyingPartyDatabase", "..\projecttemplates\RelyingPartyDatabase\RelyingPartyDatabase.sqlproj", "{08A938B6-EBBD-4036-880E-CE7BA2D14510}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcRelyingParty", "..\projecttemplates\MvcRelyingParty\MvcRelyingParty.csproj", "{152B7BAB-E884-4A59-8067-440971A682B3}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenIdWebRingSsoRelyingParty", "..\samples\OpenIdWebRingSsoRelyingParty\OpenIdWebRingSsoRelyingParty.csproj", "{B64A1E7E-6A15-4B91-AF13-7D48F7DA5942}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenIdWebRingSsoProvider", "..\samples\OpenIdWebRingSsoProvider\OpenIdWebRingSsoProvider.csproj", "{0B4EB2A8-283D-48FB-BCD0-85B8DFFE05E4}" @@ -204,28 +191,6 @@ Global {5C65603B-235F-47E6-B536-06385C60DE7F}.Debug|Any CPU.Build.0 = Debug|Any CPU {5C65603B-235F-47E6-B536-06385C60DE7F}.Release|Any CPU.ActiveCfg = Release|Any CPU {5C65603B-235F-47E6-B536-06385C60DE7F}.Release|Any CPU.Build.0 = Release|Any CPU - {A78F8FC6-7B03-4230-BE41-761E400D6810}.CodeAnalysis|Any CPU.ActiveCfg = Debug|Any CPU - {A78F8FC6-7B03-4230-BE41-761E400D6810}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A78F8FC6-7B03-4230-BE41-761E400D6810}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A78F8FC6-7B03-4230-BE41-761E400D6810}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A78F8FC6-7B03-4230-BE41-761E400D6810}.Release|Any CPU.Build.0 = Release|Any CPU - {17932639-1F50-48AF-B0A5-E2BF832F82CC}.CodeAnalysis|Any CPU.ActiveCfg = Debug|Any CPU - {17932639-1F50-48AF-B0A5-E2BF832F82CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {17932639-1F50-48AF-B0A5-E2BF832F82CC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {17932639-1F50-48AF-B0A5-E2BF832F82CC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {17932639-1F50-48AF-B0A5-E2BF832F82CC}.Release|Any CPU.Build.0 = Release|Any CPU - {08A938B6-EBBD-4036-880E-CE7BA2D14510}.CodeAnalysis|Any CPU.ActiveCfg = Debug|Any CPU - {08A938B6-EBBD-4036-880E-CE7BA2D14510}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {08A938B6-EBBD-4036-880E-CE7BA2D14510}.Debug|Any CPU.Build.0 = Debug|Any CPU - {08A938B6-EBBD-4036-880E-CE7BA2D14510}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {08A938B6-EBBD-4036-880E-CE7BA2D14510}.Release|Any CPU.ActiveCfg = Release|Any CPU - {08A938B6-EBBD-4036-880E-CE7BA2D14510}.Release|Any CPU.Build.0 = Release|Any CPU - {08A938B6-EBBD-4036-880E-CE7BA2D14510}.Release|Any CPU.Deploy.0 = Release|Any CPU - {152B7BAB-E884-4A59-8067-440971A682B3}.CodeAnalysis|Any CPU.ActiveCfg = Debug|Any CPU - {152B7BAB-E884-4A59-8067-440971A682B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {152B7BAB-E884-4A59-8067-440971A682B3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {152B7BAB-E884-4A59-8067-440971A682B3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {152B7BAB-E884-4A59-8067-440971A682B3}.Release|Any CPU.Build.0 = Release|Any CPU {B64A1E7E-6A15-4B91-AF13-7D48F7DA5942}.CodeAnalysis|Any CPU.ActiveCfg = Debug|Any CPU {B64A1E7E-6A15-4B91-AF13-7D48F7DA5942}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B64A1E7E-6A15-4B91-AF13-7D48F7DA5942}.Debug|Any CPU.Build.0 = Debug|Any CPU @@ -450,10 +415,6 @@ Global {C78E8235-1D46-43EB-A912-80B522C4E9AE} = {1E2CBAA5-60A3-4AED-912E-541F5753CDC6} {58A3721F-5B5C-4CA7-BE39-91640B5B4924} = {1E2CBAA5-60A3-4AED-912E-541F5753CDC6} {5C65603B-235F-47E6-B536-06385C60DE7F} = {E9ED920D-1F83-48C0-9A4B-09CCE505FE6D} - {A78F8FC6-7B03-4230-BE41-761E400D6810} = {B9EB8729-4B54-4453-B089-FE6761BA3057} - {17932639-1F50-48AF-B0A5-E2BF832F82CC} = {B9EB8729-4B54-4453-B089-FE6761BA3057} - {08A938B6-EBBD-4036-880E-CE7BA2D14510} = {B9EB8729-4B54-4453-B089-FE6761BA3057} - {152B7BAB-E884-4A59-8067-440971A682B3} = {B9EB8729-4B54-4453-B089-FE6761BA3057} {C7EF1823-3AA7-477E-8476-28929F5C05D2} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE} {9AF74F53-10F5-49A2-B747-87B97CD559D3} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE} {529B4262-6B5A-4EF9-BD3B-1D29A2597B67} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE} diff --git a/tools/drop.proj b/tools/drop.proj index ea03d89..5c0c26e 100644 --- a/tools/drop.proj +++ b/tools/drop.proj @@ -3,10 +3,6 @@ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))' != '' " /> <Import Project="$(MSBuildProjectDirectory)\DotNetOpenAuth.automated.props"/> - <PropertyGroup> - <BuildProjectTemplates>false</BuildProjectTemplates> - </PropertyGroup> - <Target Name="LayoutDependencies"> <MSBuild Projects="$(ProjectRoot)src\$(ProductName)\$(ProductName).proj" Properties="TargetFrameworkVersion=v4.5" @@ -23,9 +19,6 @@ <!-- Note that we use an MSBuild task for these dependencies rather than individual DependsOnTargets entries so that these builds can be executed in parallel. --> <ItemGroup> - <ProjectsToBuild Include="$(ProjectRoot)vsix\vsix.proj" Condition=" '$(BuildProjectTemplates)' == 'true' "> - <Properties>TargetFrameworkVersion=v4.5</Properties> - </ProjectsToBuild> <ProjectsToBuild Include="$(ProjectRoot)samples\samples.proj"> <Properties>TargetFrameworkVersion=v4.5</Properties> </ProjectsToBuild> @@ -43,7 +36,6 @@ <PropertyGroup> <DropBin45Directory>$(DropDirectory)Bin-net4.5\</DropBin45Directory> <DropLibDirectory>$(DropDirectory)Lib\</DropLibDirectory> - <DropProjectTemplatesDirectory>$(DropDirectory)Project Templates\</DropProjectTemplatesDirectory> <DropSamplesDirectory>$(DropDirectory)Samples\</DropSamplesDirectory> <DropSpecsDirectory>$(DropDirectory)Specs\</DropSpecsDirectory> </PropertyGroup> @@ -51,13 +43,10 @@ <RedistributableFiles Include="@(DropLayoutDependencies)"> <Package>DotNetOpenAuth project templates</Package> </RedistributableFiles> - <ExtensionVsix Include="@(DropLayoutDependencies)" Condition=" '%(DropLayoutDependencies.MSBuildSourceProjectFile)' == '$(ProjectRoot)vsix\vsix.proj' " /> - <ProjectTemplatesVsi Include="@(DropLayoutDependencies)" Condition=" '%(DropLayoutDependencies.MSBuildSourceProjectFile)' == '$(ProjectRoot)vsi\vsi.proj' " /> <DropDirectories Include=" $(DropDirectory); $(DropBin45Directory); $(DropLibDirectory); - $(DropProjectTemplatesDirectory); $(DropSamplesDirectory); $(DropSpecsDirectory); " /> @@ -80,8 +69,6 @@ <DropSatelliteSourceFiles> <CultureDir>$([System.IO.Path]::GetDirectoryName('$([System.IO.Path]::GetDirectoryName('%(RecursiveDir)'))'))\</CultureDir> </DropSatelliteSourceFiles> - <DropProjectTemplatesSourceFiles Include="@(ProjectTemplatesVsi)" /> - <DropVsixSourceFiles Include="@(ExtensionVsix)" Condition=" '%(ExtensionVsix.IncludeInDrop)' == 'true' " /> <ExcludedDropSamplesSourceFiles Include=" $(ProjectRoot)**\obj\**; @@ -115,8 +102,6 @@ <DropFiles Include="@(DropSourceFiles->'$(DropDirectory)%(RecursiveDir)%(FileName)%(Extension)')"/> <DropBin45Files Include="@(DropBin45SourceFiles->'$(DropBin45Directory)%(RecursiveDir)%(FileName)%(Extension)')"/> <DropSatelliteFiles Include="@(DropSatelliteSourceFiles->'$(DropBinDirectory)%(CultureDir)%(FileName)%(Extension)')" /> - <DropProjectTemplatesFiles Include="@(DropProjectTemplatesSourceFiles->'$(DropProjectTemplatesDirectory)%(FileName)%(Extension)')" /> - <DropVsixFiles Include="@(DropVsixSourceFiles->'$(DropProjectTemplatesDirectory)%(FileName)%(Extension)')" /> <DropSamplesFiles Include="@(DropSamplesSourceFiles->'$(DropSamplesDirectory)%(RecursiveDir)%(FileName)%(Extension)')"/> <DropSamplesRefreshFiles Include="@(DropSamplesRefreshSourceFiles->'$(DropSamplesDirectory)%(RecursiveDir)%(FileName).refresh')"/> <DropSamplesToolsProjects Include="$(DropSamplesDirectory)OpenIdOfflineProvider\OpenIdOfflineProvider.csproj" /> @@ -126,8 +111,6 @@ @(DropSourceFiles); @(DropBin45SourceFiles); @(DropSatelliteSourceFiles); - @(DropProjectTemplatesSourceFiles); - @(DropVsixSourceFiles); @(DropSamplesSourceFiles); @(DropSamplesRefreshSourceFiles); @(DropDocSourceFiles); @@ -138,8 +121,6 @@ @(DropFiles); @(DropBin45Files); @(DropSatelliteFiles); - @(DropProjectTemplatesFiles); - @(DropVsixFiles); @(DropSamplesFiles); @(DropSamplesRefreshFiles); @(DropDocFiles); diff --git a/vsi/DotNetOpenAuth Starter Kits.vscontent b/vsi/DotNetOpenAuth Starter Kits.vscontent deleted file mode 100644 index 320e491..0000000 --- a/vsi/DotNetOpenAuth Starter Kits.vscontent +++ /dev/null @@ -1,26 +0,0 @@ -<VSContent xmlns="http://schemas.microsoft.com/developer/vscontent/2005"> - <Content> - <FileName>WebFormsRelyingParty.zip</FileName> - <DisplayName>ASP.NET OpenID-InfoCard RP</DisplayName> - <Description>An ASP.NET web forms web site that accepts OpenID and InfoCard logins</Description> - <FileContentType>VSTemplate</FileContentType> - <ContentVersion>2.0</ContentVersion> - <Attributes> - <Attribute name="ProjectType" value="Visual C#"/> - <Attribute name="ProjectSubType" value="Web"/> - <Attribute name="TemplateType" value="Project"/> - </Attributes> - </Content> - <Content> - <FileName>MvcRelyingParty.zip</FileName> - <DisplayName>ASP.NET MVC OpenID-InfoCard RP</DisplayName> - <Description>An ASP.NET MVC web site that accepts OpenID logins</Description> - <FileContentType>VSTemplate</FileContentType> - <ContentVersion>2.0</ContentVersion> - <Attributes> - <Attribute name="ProjectType" value="Visual C#"/> - <Attribute name="ProjectSubType" value="Web"/> - <Attribute name="TemplateType" value="Project"/> - </Attributes> - </Content> -</VSContent>
\ No newline at end of file diff --git a/vsi/vsi.proj b/vsi/vsi.proj deleted file mode 100644 index 683ea51..0000000 --- a/vsi/vsi.proj +++ /dev/null @@ -1,57 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))' != '' " /> - <Import Project="$(MSBuildProjectDirectory)\..\tools\DotNetOpenAuth.automated.props"/> - <Import Project="..\projecttemplates\ProjectTemplates.props"/> - - <PropertyGroup> - <ProjectTemplatesVsiDirectory>$(IntermediatePath)vsi\</ProjectTemplatesVsiDirectory> - </PropertyGroup> - - <ItemGroup> - <DirectoriesToClean Include="$(ProjectTemplatesLayoutPath)" /> - <ProjectTemplates Include="$(ProjectRoot)projecttemplates\**\*.*proj" /> - </ItemGroup> - - <Target Name="Build" Returns="@(RedistributableFiles)"> - <MSBuild Projects="..\projecttemplates\projecttemplates.proj" Targets="Zip2008" BuildInParallel="$(BuildInParallel)"> - <Output TaskParameter="TargetOutputs" ItemName="ProjectTemplate2008ZipSource"/> - </MSBuild> - - <PropertyGroup> - <ProjectTemplatesVsi>$(DropsRoot)$(ProductName) SDK-$(BuildVersion)-vs2008.vsi</ProjectTemplatesVsi> - </PropertyGroup> - <ItemGroup> - <RedistributableFiles Include="$(ProjectTemplatesVsi)"> - <Platform>Visual Studio 2008, .NET $(TargetFrameworkVersion)</Platform> - </RedistributableFiles> - <VsiTransformSource Include="*.vscontent"> - <BeforeTokens>$version$</BeforeTokens> - <AfterTokens>$(BuildVersion)</AfterTokens> - <SkipUnchangedFiles>false</SkipUnchangedFiles> - </VsiTransformSource> - <VsiTransformLayout Include="@(VsiTransformSource->'$(ProjectTemplatesVsiDirectory)%(RecursiveDir)%(FileName)%(Extension)')" /> - - <ProjectTemplate2008ZipSource> - <HardLink>true</HardLink> - </ProjectTemplate2008ZipSource> - <ProjectTemplate2008ZipTargets Include="@(ProjectTemplate2008ZipSource->'$(ProjectTemplatesVsiDirectory)%(FileName)%(Extension)')" /> - <ProjectTemplateVsiContents Include=" - @(VsiTransformLayout); - @(ProjectTemplate2008ZipTargets); - " /> - </ItemGroup> - - <CopyWithTokenSubstitution SourceFiles="@(VsiTransformSource)" DestinationFiles="@(VsiTransformLayout)" /> - <HardLinkCopy SourceFiles="@(ProjectTemplate2008ZipSource)" DestinationFiles="@(ProjectTemplate2008ZipTargets)" /> - - <Zip - Files="@(ProjectTemplateVsiContents)" - ZipFileName="$(ProjectTemplatesVsi)" - WorkingDirectory="$(ProjectTemplatesVsiDirectory)" - ZipLevel="$(ZipLevel)" - /> - </Target> - - <Import Project="$(ProjectRoot)tools\DotNetOpenAuth.automated.targets"/> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " /> -</Project>
\ No newline at end of file diff --git a/vsix/VSIXProject_large.png b/vsix/VSIXProject_large.png Binary files differdeleted file mode 100644 index 442b986..0000000 --- a/vsix/VSIXProject_large.png +++ /dev/null diff --git a/vsix/VSIXProject_small.png b/vsix/VSIXProject_small.png Binary files differdeleted file mode 100644 index 5789dfa..0000000 --- a/vsix/VSIXProject_small.png +++ /dev/null diff --git a/vsix/[Content_Types].xml b/vsix/[Content_Types].xml deleted file mode 100644 index be86ffd..0000000 --- a/vsix/[Content_Types].xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"> - <Default Extension="png" ContentType="application/octet-stream" /> - <Default Extension="txt" ContentType="text/plain" /> - <Default Extension="vsixmanifest" ContentType="text/xml" /> - <Default Extension="zip" ContentType="application/zip" /> - <Default Extension="pkgdef" ContentType="text/plain" /> -</Types>
\ No newline at end of file diff --git a/vsix/extension.vsixmanifest b/vsix/extension.vsixmanifest deleted file mode 100644 index fca91df..0000000 --- a/vsix/extension.vsixmanifest +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0"?> -<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010"> - <Identifier Id="DotNetOpenAuth.d2122791-8de4-4d3b-a414-7563c9a8cd6e"> - <Name>DotNetOpenAuth SDK</Name> - <Author>DotNetOpenAuth</Author> - <Version>$version$</Version> - <Description>Resources for developing applications that use OpenID, OAuth, and InfoCard.</Description> - <Locale>1033</Locale> - <License>LICENSE.txt</License> - <GettingStartedGuide>http://www.dotnetopenauth.net/ProjectTemplateGettingStarted</GettingStartedGuide> - <Icon>VSIXProject_small.png</Icon> - <PreviewImage>VSIXProject_large.png</PreviewImage> - <InstalledByMsi>false</InstalledByMsi> - <SupportedProducts> - <VisualStudio Version="10.0"> - <Edition>Pro</Edition> - <Edition>Premium</Edition> - <Edition>Ultimate</Edition> - </VisualStudio> - <VisualStudio Version="11.0"> - <Edition>Pro</Edition> - <Edition>Premium</Edition> - <Edition>Ultimate</Edition> - </VisualStudio> - </SupportedProducts> - <SupportedFrameworkRuntimeEdition MinVersion="3.5" MaxVersion="4.5" /> - </Identifier> - <References /> - <Content> - <ProjectTemplate>PT</ProjectTemplate> - </Content> -</Vsix> diff --git a/vsix/vsix.proj b/vsix/vsix.proj deleted file mode 100644 index d966bce..0000000 --- a/vsix/vsix.proj +++ /dev/null @@ -1,135 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.props))' != '' " /> - <Import Project="$(MSBuildProjectDirectory)\..\tools\DotNetOpenAuth.automated.props"/> - <Import Project="..\projecttemplates\ProjectTemplates.props"/> - - <PropertyGroup> - <ExtensionVsixLayoutDirectory>$(IntermediatePath)vsix\</ExtensionVsixLayoutDirectory> - <ProjectTemplateSubdirectory>$(ExtensionVsixLayoutDirectory)PT\CSharp\Web\</ProjectTemplateSubdirectory> - </PropertyGroup> - - <Target Name="Layout"> - <MSBuild Projects="..\projecttemplates\projecttemplates.proj" Targets="Zip" BuildInParallel="$(BuildInParallel)"> - <Output TaskParameter="TargetOutputs" ItemName="ProjectTemplateZipSource"/> - </MSBuild> - - <ItemGroup> - <ProjectTemplateZipSource> - <HardLink>true</HardLink> - </ProjectTemplateZipSource> - <ProjectTemplateZipTargets Include="@(ProjectTemplateZipSource->'$(ProjectTemplateSubdirectory)%(FileName)%(Extension)')" /> - - <ExtensionVsixTransformSource Include=" - $(ProjectRoot)vsix\extension.vsixmanifest; - $(ProjectRoot)LICENSE.txt; - "> - <BeforeTokens>$version$</BeforeTokens> - <AfterTokens>$(BuildVersion)</AfterTokens> - <SkipUnchangedFiles>false</SkipUnchangedFiles> - </ExtensionVsixTransformSource> - <ExtensionVsixTransformLayout Include="@(ExtensionVsixTransformSource->'$(ExtensionVsixLayoutDirectory)%(RecursiveDir)%(FileName)%(Extension)')" /> - - <ExtensionVsixSources Include=" - $(ProjectRoot)vsix\*; - " Exclude=" - $(ProjectRoot)vsix\extension.vsixmanifest; - $(ProjectRoot)vsix\$(MSBuildThisFile); - "> - <SkipUnchangedFiles>true</SkipUnchangedFiles> - </ExtensionVsixSources> - <ExtensionVsixTargets Include="@(ExtensionVsixSources->'$(ExtensionVsixLayoutDirectory)%(FileName)%(Extension)')" /> - - <ExtensionVsixContents Include=" - @(ExtensionVsixTargets); - @(ExtensionVsixTransformLayout); - @(ProjectTemplateZipTargets); - "/> - </ItemGroup> - - <CopyWithTokenSubstitution SourceFiles="@(ExtensionVsixTransformSource)" DestinationFiles="@(ExtensionVsixTransformLayout)" /> - <Copy SourceFiles="@(ExtensionVsixSources)" DestinationFiles="@(ExtensionVsixTargets)" SkipUnchangedFiles="true" /> - <HardLinkCopy SourceFiles="@(ProjectTemplateZipSource)" DestinationFiles="@(ProjectTemplateZipTargets)" /> - <Purge Directories="$(ExtensionVsixLayoutDirectory)" IntendedFiles="@(ExtensionVsixContents)" /> - </Target> - - <Target Name="VSGalleryVsixLayout" DependsOnTargets="Layout"> - <!-- Build individual VSIX files for each project template for the Visual Studio Gallery, - which only allows one project template per VSIX. --> - <ItemGroup> - <VSGalleryVsixRawSources Include="$(ExtensionVsixLayoutDirectory)*" - Exclude="$(ExtensionVsixLayoutDirectory)*.vsixmanifest"> - <VSGalleryVsix>$(DropsRoot)$(ProductName) %(ProjectTemplateZipTargets.FileName)-$(BuildVersion)-vs2010.vsix</VSGalleryVsix> - <TopLevelTemplate>%(ProjectTemplateZipTargets.FileName)</TopLevelTemplate> - </VSGalleryVsixRawSources> - <VSGalleryVsixSources Include="@(VSGalleryVsixRawSources)"> - <TargetPath>$(IntermediatePath)%(TopLevelTemplate).vsix\%(FileName)%(Extension)</TargetPath> - </VSGalleryVsixSources> - - <VSGalleryVsixZipSources Include="$(ExtensionVsixLayoutDirectory)**\*.zip" /> - <VSGalleryVsixSources Include="@(VSGalleryVsixZipSources)"> - <TopLevelTemplate>%(FileName)</TopLevelTemplate> - <VSGalleryVsix>$(DropsRoot)$(ProductName) %(FileName)-$(BuildVersion)-vs2010.vsix</VSGalleryVsix> - <!-- The A in the path below used to be %(FileName), but to fit inside MAX_PATH when VS expands, we shorten it. --> - <TargetPath>$(IntermediatePath)%(FileName).vsix\%(RecursiveDir)A%(Extension)</TargetPath> - </VSGalleryVsixSources> - - <VSGalleryVsixSources Include="@(ProjectTemplateZipTargets->'$(ProjectRoot)projecttemplates\%(FileName).vsixmanifest')"> - <VSGalleryVsix>$(DropsRoot)$(ProductName) %(ProjectTemplateZipTargets.FileName)-$(BuildVersion)-vs2010.vsix</VSGalleryVsix> - <TopLevelTemplate>%(ProjectTemplateZipTargets.FileName)</TopLevelTemplate> - <TargetPath>$(IntermediatePath)%(ProjectTemplateZipTargets.FileName).vsix\extension.vsixmanifest</TargetPath> - <Transform>true</Transform> - <BeforeTokens>$version$</BeforeTokens> - <AfterTokens>$(BuildVersion)</AfterTokens> - <SkipUnchangedFiles>false</SkipUnchangedFiles> - </VSGalleryVsixSources> - - <VSGalleryVsixTargets Include="@(VSGalleryVsixSources->'%(TargetPath)')"> - <WorkingDirectory>$(IntermediatePath)%(TopLevelTemplate).vsix</WorkingDirectory> - </VSGalleryVsixTargets> - <VSGalleryVsixPathsToPurge Include="@(ProjectTemplateZipTargets->'$(IntermediatePath)%(FileName).vsix')"/> - </ItemGroup> - - <HardLinkCopy - SourceFiles="@(VSGalleryVsixSources)" - DestinationFiles="%(VSGalleryVsixSources.TargetPath)" - Condition=" '%(VSGalleryVsixSources.Transform)' != 'true' "/> - <CopyWithTokenSubstitution - SourceFiles="@(VSGalleryVsixSources)" - DestinationFiles="%(VSGalleryVsixSources.TargetPath)" - Condition=" '%(VSGalleryVsixSources.Transform)' == 'true' "/> - <Purge - Directories="@(VSGalleryVsixPathsToPurge)" - IntendedFiles="@(VSGalleryVsixTargets)" /> - </Target> - - <Target Name="Build" DependsOnTargets="Layout;VSGalleryVsixLayout" Returns="@(GeneratedVsix)"> - <PropertyGroup> - <ExtensionVsix>$(DropsRoot)$(ProductName) SDK-$(BuildVersion)-vs2010.vsix</ExtensionVsix> - </PropertyGroup> - <ItemGroup> - <GeneratedVsix Include="$(ExtensionVsix)"> - <IncludeInDrop>true</IncludeInDrop> - </GeneratedVsix> - <GeneratedVsix Include="%(VSGalleryVsixTargets.VSGalleryVsix)"> - <VSGallery>true</VSGallery> - </GeneratedVsix> - </ItemGroup> - - <Zip - Files="@(ExtensionVsixContents)" - ZipFileName="$(ExtensionVsix)" - WorkingDirectory="$(ExtensionVsixLayoutDirectory)" - ZipLevel="$(ZipLevel)" - /> - - <Zip - Files="@(VSGalleryVsixTargets)" - ZipFileName="%(VSGalleryVsixTargets.VSGalleryVsix)" - WorkingDirectory="%(VSGalleryVsixTargets.WorkingDirectory)" - ZipLevel="$(ZipLevel)" - /> - </Target> - - <Import Project="$(ProjectRoot)tools\DotNetOpenAuth.automated.targets"/> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " /> -</Project>
\ No newline at end of file |