Permalink
Browse files

Version 1.1, updated for ASP.NET 4.

  • Loading branch information...
1 parent 1cc0540 commit 0196c97f10278c2fbbf68df165b32ba699ce6f0b @Encosia committed Apr 15, 2010
Showing with 97 additions and 32 deletions.
  1. +48 −3 PostBackRitalin.csproj
  2. +36 −20 PostBackRitalin.js
  3. +7 −3 PostBackRitalin.min.js
  4. +3 −3 PostBackRitalin.sln
  5. +3 −3 Properties/AssemblyInfo.cs
View
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,9 +10,30 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PostBackRitalin</RootNamespace>
<AssemblyName>PostBackRitalin</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Nonshipping>true</Nonshipping>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <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>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ <TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -22,6 +43,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -30,14 +52,15 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
- <Reference Include="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
@@ -53,6 +76,28 @@
<ItemGroup>
<EmbeddedResource Include="PostBackRitalin.min.js" />
</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.VisualBasic.PowerPacks.10.0">
+ <Visible>False</Visible>
+ <ProductName>Microsoft Visual Basic PowerPacks 10.0</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>
<Import Project="$(MSBuildBinPath)\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.
View
@@ -19,11 +19,15 @@
};
PostBackRitalin.prototype = {
- _isMonitoredRequest: function(panelID) {
+ _isMonitoredRequest: function (panelID) {
if (this._monitoredUpdatePanels === null) {
return true;
}
+ if (panelID === null) {
+ return false;
+ }
+
for (var i = 0; i < this._monitoredUpdatePanels.length; i++) {
if (panelID.match(this._monitoredUpdatePanels[i].UpdatePanelID) !== null) {
return true;
@@ -33,19 +37,39 @@ PostBackRitalin.prototype = {
return false;
},
- _isDisableAllElementsPanel: function(panelID) {
+ _isDisableAllElementsPanel: function (panelID) {
if (this._monitoredUpdatePanels === null) {
return false;
}
+ if (panelID === null) {
+ return false;
+ }
+
for (var i = 0; i < this._monitoredUpdatePanels.length; i++) {
if (panelID.match(this._monitoredUpdatePanels[i].UpdatePanelID) !== null) {
return this._monitoredUpdatePanels[i].DisableAllElements;
}
}
},
- get_waitText: function(panelID) {
+ _findContainingPanel: function (el) {
+ // If the element is null, we're at the top of the DOM and haven't found it.
+ if (el === null || this._monitoredUpdatePanels === null)
+ return null;
+
+ if (el.id) {
+ for (var i = 0; i < this._monitoredUpdatePanels.length; i++) {
+ if (el.id.match(this._monitoredUpdatePanels[i].UpdatePanelID) !== null) {
+ return this._monitoredUpdatePanels[i].UpdatePanelID;
+ }
+ }
+ }
+
+ return this._findContainingPanel(el.parentNode);
+ },
+
+ get_waitText: function (panelID) {
if (this._monitoredUpdatePanels) {
for (var i = 0; i < this._monitoredUpdatePanels.length; i++) {
if (panelID.match(this._monitoredUpdatePanels[i].UpdatePanelID) !== null) {
@@ -61,7 +85,7 @@ PostBackRitalin.prototype = {
return null;
},
- get_waitImage: function(panelID) {
+ get_waitImage: function (panelID) {
if (this._monitoredUpdatePanels) {
for (var i = 0; i < this._monitoredUpdatePanels.length; i++) {
if (panelID.match(this._monitoredUpdatePanels[i].UpdatePanelID) !== null) {
@@ -77,7 +101,7 @@ PostBackRitalin.prototype = {
return null;
},
- _disableAllElements: function(panelID) {
+ _disableAllElements: function (panelID) {
var panel = $get(panelID);
if (panel !== null) {
@@ -103,20 +127,11 @@ PostBackRitalin.prototype = {
}
},
- _parseSendingPanel: function(SenderString) {
- // Grab just the sending UpdatePanel's ID.
- var tmp = SenderString.split('|')[0];
-
- // Replace any $ characters with underscores.
- tmp = tmp.replace(/\$/g, '_');
-
- return tmp;
- },
-
- _beginRequest: function(sender, args) {
- var sendingPanel = this._parseSendingPanel(sender._postBackSettings.panelID);
+ _beginRequest: function (sender, args) {
var element = args.get_postBackElement();
+ var sendingPanel = this._findContainingPanel(element);
+
if (element !== null && this._isMonitoredRequest(sendingPanel)) {
if (element.type == 'submit' || element.type == 'button') {
element.disabled = true;
@@ -158,9 +173,10 @@ PostBackRitalin.prototype = {
}
},
- _endRequest: function(sender, args) {
+ _endRequest: function (sender, args) {
var element = sender._postBackSettings.sourceElement;
- var sendingPanel = this._parseSendingPanel(sender._postBackSettings.panelID);
+
+ var sendingPanel = this._findContainingPanel(element);
// Check to make sure the item hasn't been removed during the postback.
if (element !== null && this._isMonitoredRequest(sendingPanel)) {
@@ -187,7 +203,7 @@ PostBackRitalin.prototype = {
}
},
- _initialize: function() {
+ _initialize: function () {
this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
this._beginRequestHandler = Function.createDelegate(this, this._beginRequest);
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,11 +1,11 @@

-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostBackRitalin", "PostBackRitalin.csproj", "{C92CD4C3-7271-4AE6-8654-7734725F247F}"
EndProject
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "PostBackRitalinTest", "..\..\Visual Studio Websites\PostBackRitalinTest\", "{A5B95E5E-E0F8-41D4-900C-25A6EF3F258E}"
ProjectSection(WebsiteProperties) = preProject
- TargetFramework = "3.5"
+ TargetFrameworkMoniker = ".NETFramework,Version%3Dv3.5"
ProjectReferences = "{C92CD4C3-7271-4AE6-8654-7734725F247F}|PostBackRitalin.dll;"
Debug.AspNetCompiler.VirtualPath = "/PostBackRitalinTest"
Debug.AspNetCompiler.PhysicalPath = "..\..\Visual Studio Websites\PostBackRitalinTest\"
@@ -11,7 +11,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Encosia")]
[assembly: AssemblyProduct("PostBack Ritalin")]
-[assembly: AssemblyCopyright("Copyright © 2008")]
+[assembly: AssemblyCopyright("Copyright © 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -33,8 +33,8 @@
// 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")]
-[assembly: AssemblyFileVersion("1.0.0")]
+[assembly: AssemblyVersion("1.1.0")]
+[assembly: AssemblyFileVersion("1.1.0")]
[assembly: WebResource("PostBackRitalin.PostBackRitalin.js", "application/x-javascript")]
[assembly: WebResource("PostBackRitalin.PostBackRitalin.min.js", "application/x-javascript")]

0 comments on commit 0196c97

Please sign in to comment.