Skip to content

Commit

Permalink
new modifications : Hashset, inputtracker, before and after execution…
Browse files Browse the repository at this point in the history
… methods.

new modifications : Hashset, inputtracker, before and after execution
methods.
  • Loading branch information
aukgit committed Apr 25, 2016
1 parent efc8dc9 commit 82f9db3
Show file tree
Hide file tree
Showing 20 changed files with 1,107 additions and 312 deletions.
59 changes: 37 additions & 22 deletions JavaScript file order.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
"~/JavaScript-Mvc-framework\byId.js",
"~/Content/Scripts/FrontEnd/jquery.blockUI.js",
"~/Content/Scripts/jquery.blockUI.js",

"~/JavaScript-Mvc-framework/extensions/ajax.js",
"~/JavaScript-Mvc-framework/extensions/clone.js",
"~/JavaScript-Mvc-framework/extensions/constants.js",
"~/JavaScript-Mvc-framework/Prototype/Array.js",

"~/JavaScript-Mvc-framework/extensions/initialize.js",
"~/JavaScript-Mvc-framework/extensions/modal.js",
"~/JavaScript-Mvc-framework/extensions/pagination.js",
"~/JavaScript-Mvc-framework/extensions/regularExp.js",
"~/JavaScript-Mvc-framework/extensions/selectors.js",
"~/JavaScript-Mvc-framework/extensions/spinner.js",
"~/JavaScript-Mvc-framework/extensions/urls.js",
"~/JavaScript-Mvc-framework/controllers/controllers.js",
//"~/JavaScript-Mvc-framework/controllers/homeController.js",
"~/JavaScript-Mvc-framework/areas/admin/controllers/NavItemsController.js",
"~/JavaScript-Mvc-framework/controllers/initialize.js",
"~/JavaScript-Mvc-framework/jQueryExtend.js",
"~/JavaScript-Mvc-framework/jQueryExtend.fn.js",
"~/JavaScript-Mvc-framework/app.config.js",
"~/JavaScript-Mvc-framework/app.js",
"~/JavaScript-Mvc-framework/app.initializeMethods.js",
"~/JavaScript-Mvc-framework/app.run.js"
"~/JavaScript-Mvc-framework/app.js",
"~/JavaScript-Mvc-framework/app.executeBefore.js",
"~/JavaScript-Mvc-framework/app.executeAfter.js",
"~/JavaScript-Mvc-framework/jQueryCaching.js",
"~/JavaScript-Mvc-framework/attachInitialize.js",

"~/JavaScript-Mvc-framework/schema/schema.js",
"~/JavaScript-Mvc-framework/schema/hashset.js",
"~/JavaScript-Mvc-framework/schema/url.js",

"~/JavaScript-Mvc-framework/extensions/ajax.js",
"~/JavaScript-Mvc-framework/extensions/hiddenContainer.js",
"~/JavaScript-Mvc-framework/extensions/clone.js",
"~/JavaScript-Mvc-framework/extensions/constants.js",
"~/JavaScript-Mvc-framework/extensions/initialize.js",
"~/JavaScript-Mvc-framework/extensions/inputChangeTracker.js",
"~/JavaScript-Mvc-framework/extensions/modal.js",
"~/JavaScript-Mvc-framework/extensions/pagination.js",
"~/JavaScript-Mvc-framework/extensions/regularExp.js",
"~/JavaScript-Mvc-framework/extensions/selectors.js",
"~/JavaScript-Mvc-framework/extensions/spinner.js",
"~/JavaScript-Mvc-framework/extensions/urls.js",

"~/JavaScript-Mvc-framework/controllers/controllers.js",
"~/JavaScript-Mvc-framework/controllers/initialize.js",
"~/JavaScript-Mvc-framework/controllers/AppController.js",

"~/JavaScript-Mvc-framework/areas/admin/controllers/NavItemsController.js",

"~/JavaScript-Mvc-framework/jQueryExtend.js",
"~/JavaScript-Mvc-framework/jQueryExtend.fn.js",
"~/JavaScript-Mvc-framework/app.config.js",
"~/JavaScript-Mvc-framework/app.global.js",

"~/JavaScript-Mvc-framework/app.run.js"
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/// <reference path="../../../app.js" />
/// <reference path="../../../app.run.js" />
/// <reference path="../../../byId.js" />
/// <reference path="D:\Working\GitHub\WereViewProject\WereViewApp\Content/Scripts/jquery-2.1.4.js" />
/// <reference path="D:\Working\GitHub\WereViewProject\WeReviewApp\Content/Scripts/jquery-2.1.4.js" />
/// <reference path="../../../extensions/inputChangeTracker.js" />
/// <reference path="../../../ProtoType/Array.js" />
/// <reference path="../../../extensions/spinner.js" />
Expand Down Expand Up @@ -63,6 +63,7 @@ $.app.controllers.navItemsController = {

// bind events
self.bindEvents.saveOrderButtonClick(urlSchema.SaveOrder);
self.bindEvents.onBlurInputs($allInputs, urlSchema.SaveOrder);



Expand All @@ -71,6 +72,20 @@ $.app.controllers.navItemsController = {
},

bindEvents: {
onBlurInputs: function ($allInputs) {
var self = $.app.controllers.navItemsController,
tracker = self.prop.tracker;
$allInputs.on('blur', function () {
var $input = $(this),
$tr = $input.parent().parent().parent();
console.log($tr);
if (tracker.isChanged($input)) {
$tr.addClass("changed-row");
} else {
$tr.removeClass("changed-row");
}
});
},
saveOrderButtonClick: function(saveingUrl) {
var $saveBtn = $.byId("save-order-btn");
var self = $.app.controllers.navItemsController,
Expand All @@ -84,10 +99,11 @@ $.app.controllers.navItemsController = {
for (var i = 0; i < ids.length; i++) {
var id = ids[i],
$form = $.byId(formIdFormat + id);
formArray[i] = $form.serializeArray();
formArray[i] = $.serializeToJson($form);
}
return formArray;
return JSON.stringify(formArray);
}

$saveBtn.click(function(e) {
e.preventDefault();
// changed inputs ids array, only contains id values.
Expand All @@ -98,7 +114,8 @@ $.app.controllers.navItemsController = {
method: "POST", // by default "GET"
url: saveingUrl,
data: data, // PlainObject or String or Array
dataType: "JSON" //, // "Text" , "HTML", "xml", "script"
dataType: "JSON", //, // "Text" , "HTML", "xml", "script"
contentType: "application/json", // must add this line for server json submit
}).done(function (response) {
if (isInTestingMode) {
console.log(response);
Expand Down
11 changes: 9 additions & 2 deletions JavaScript-Mvc-Framework/app.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; $.app = $.app || {};
/// <reference path="extensions/hiddenContainer.js" />
; $.app = $.app || {};
; $.app.config = {
/**
* app configuration settings.
Expand All @@ -9,6 +10,12 @@
/// <summary>
/// Setup all configuration.
/// </summary>

var app = $.app;
var classes = [
app.hiddenContainer,
app.spinner,
$.jQueryCaching
];
$.executeArrayOfInitilizeMethods(classes);
}
};
39 changes: 39 additions & 0 deletions JavaScript-Mvc-Framework/app.executeAfter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/// <reference path="byId.js" />
/// <reference path="D:\Working (SSD)\GitHub\WereViewProject\WereViewApp\Content/Scripts/toastr.js" />
/// <reference path="D:\Working (SSD)\GitHub\WereViewProject\WereViewApp\Content/Scripts/jquery-2.1.4.js" />
/// <reference path="D:\Working (SSD)\GitHub\WereViewProject\WereViewApp\Content/Scripts/jquery.blockUI.js" />
/// <reference path="D:\Working (SSD)\GitHub\WereViewProject\WereViewApp\Content/Scripts/jquery-2.1.4.intellisense.js" />
/// <reference path="app.global.js" />
; $.app = $.app || {};
/**
* method which runs after all the initialization is done.
*/
$.app.executeAfter = {
/**
* method which runs after all the initialization is done.
* @returns {}
*/
documentSpinnerHide: function () {
$.app.global.documentFullSpinnerHide();
var timer = setTimeout(function () {
$.app.global.documentFullSpinnerHide();
clearTimeout(timer);
}, 2500);
},
captureAnchorAndShowSpinner: function () {
var $anchors = $.findCached("a:link");
$anchors.click(function (e) {
var $link = $(this),
href = $link.attr("href");
if (!$.isEmpty(href)) {
var startsWith = href[0];
if (startsWith !== "#") {
e.preventDefault();
$.app.global.documentFullSpinnerShow("... Please Wait ...");
window.location = $link.attr("href");
}
}
});
},

};
Loading

0 comments on commit 82f9db3

Please sign in to comment.