Skip to content

Commit

Permalink
fixed window variables to function variables.
Browse files Browse the repository at this point in the history
fixed window variables to function variables.
- convert all window variable to function variables.
  • Loading branch information
aukgit committed Aug 10, 2015
1 parent 530c85d commit 2a72f60
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 15 deletions.
Binary file modified SampleServerApp/SampleApp/SampleApp/bin/SampleApp.dll
Binary file not shown.
Binary file modified SampleServerApp/SampleApp/SampleApp/bin/SampleApp.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified SampleServerApp/SampleApp/SampleApp/obj/Debug/SampleApp.dll
Binary file not shown.
Binary file modified SampleServerApp/SampleApp/SampleApp/obj/Debug/SampleApp.pdb
Binary file not shown.
2 changes: 1 addition & 1 deletion project.sln.DotSettings.user
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/Housekeeping/Bookmarks/NumberedBookmarks/=Bookmark4/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/Housekeeping/Bookmarks/NumberedBookmarks/=Bookmark4/Coords/@EntryValue">(Doc Ln 149 Col 44)</s:String>
<s:String x:Key="/Default/Housekeeping/Bookmarks/NumberedBookmarks/=Bookmark4/Coords/@EntryValue">(Doc Ln 153 Col 44)</s:String>
<s:String x:Key="/Default/Housekeeping/Bookmarks/NumberedBookmarks/=Bookmark4/FileId/@EntryValue">4C2EABB3-1A97-4385-88DF-1E94436C128E/d:src/d:Content/d:Scripts/f:jquery.server-validate.js</s:String>
<s:String x:Key="/Default/Housekeeping/Bookmarks/NumberedBookmarks/=Bookmark4/Owner/@EntryValue">NumberedBookmarkManager</s:String></wpf:ResourceDictionary>
28 changes: 17 additions & 11 deletions src/Content/Scripts/jquery.server-validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,23 @@
};

// The actual plugin constructor
function plugin($divElement) {
function plugin($divElement, settings, additionalFields) {
/// <summary>
/// Process the div element and
/// </summary>
/// <param name="element"></param>
/// <returns type=""></returns>
this.$element = $divElement;
this._name = pluginName;
this.settings = settings;
this.additionalFields = additionalFields;

this.init($divElement);
}

function processAdditionalFields($elementContainer) {
function processAdditionalFields($elementContainer, additionalFields) {
var addFields = [];
var selectors = window.settings.selectors.additionalFields;
var selectors = additionalFields;
for (var i = 0; i < selectors.length; i++) {
var selector = selectors[i];
var $element = $elementContainer.find(selector);
Expand All @@ -123,6 +126,7 @@
// Avoid Plugin.prototype conflicts
$.extend(plugin.prototype, {
isDebugging: false,
additionalFields : [],
isEmpty: function (variable) {
return variable === null || variable === undefined || variable.length === 0;
},
Expand All @@ -132,7 +136,7 @@
}
},
getSettings: function () {
return window.settings;
return this.settings;
},
isMultipleRequestAllowed: function () {
return this.getSettings().multipleRequests;
Expand Down Expand Up @@ -286,7 +290,7 @@
}
},
concatAdditionalFields: function ($input) {
var addFields = window.additionalFields.slice();
var addFields = this.additionalFields.slice();
var fields = {
name: $input.attr("name"),
value: $input.val()
Expand Down Expand Up @@ -700,18 +704,20 @@
/// <returns type=""></returns>
var $elementContainer = this;
$selfContainer = this;
var settings;
var additionalFields;
if ($elementContainer.isInit !== true) {
window.settings = $.extend({}, defaults, options);
var selectors = window.settings.selectors;
window.$divContainers = $elementContainer.find(selectors.divContainer);
window.additionalFields = processAdditionalFields($elementContainer);
settings = $.extend({}, defaults, options);
var selectors = settings.selectors;
$divContainers = $elementContainer.find(selectors.divContainer);
additionalFields = processAdditionalFields($elementContainer, selectors.additionalFields);
}

var $containers = window.$divContainers;
var $containers = $divContainers;

for (var i = 0; i < $containers.length; i++) {
var $divElement = $($containers[i]);
new plugin($divElement, options);
new plugin($divElement, settings, additionalFields);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/Content/Scripts/jquery.server-validate.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Content/Scripts/jquery.server-validate.min.js.map

Large diffs are not rendered by default.

0 comments on commit 2a72f60

Please sign in to comment.