This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my.router = (function () { | |
// Client-side routes | |
Sammy(function () { | |
this.get('#:folder', function () { | |
amplify.request({ // This would instead call the data service, not amplify | |
resourceId: "getFolder", | |
data: { folder: this.params.folder }, | |
success: my.webmailVM.displayFolderCallback, // I don't like that it calls the VM. | |
error: function () { | |
toastR.error('oops!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Page | |
Inherits="ViewPage<GenericPresentationModel<object>>" | |
Language="C#" | |
MasterPageFile="~/Views/Shared/Site.master" %> | |
<asp:Content runat="server" ContentPlaceHolderID="ViewHead"> | |
<% | |
Bundles.Reference("Content/New/Styles/App.less"); | |
Bundles.Reference("Content/New/Scripts"); | |
Bundles.AddPageData("accountData", Model.Model); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Attendance = function () { | |
var self = this; | |
self.datacontext = datacontext; | |
self.sessionId = ko.observable(); | |
self.personId = ko.observable(); | |
// id is string compound key {personId,sessionId} like "3,10" | |
self.id = ko.computed({ | |
read: function () { | |
return attendanceMakeId(self.personId(), self.sessionId()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requirejs([ | |
// 3rd party libraries | |
'json2', | |
'jquery', | |
'underscore', | |
'moment', | |
'sammy', | |
'amplify', | |
'ko', | |
'toastr', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['ko'], function(ko) { | |
// (function (ko) { | |
ko.DirtyFlag = function (objectToTrack, isInitiallyDirty, hashFunction) { | |
hashFunction = hashFunction || ko.toJSON; | |
var | |
_objectToTrack = objectToTrack, | |
_lastCleanState = ko.observable(hashFunction(_objectToTrack)), | |
_isInitiallyDirty = ko.observable(isInitiallyDirty), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requirejs.config({ | |
// script default location | |
baseUrl: 'scripts/app', | |
// shim in the libs that don't know define.amd (excluding extensions) | |
shim: { | |
'amplify': { deps: [], exports: 'amplify' }, | |
// jquery 1.7.x understands define; no shim needed. | |
'jquery.ui': ['jquery'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
// Establish the root object, `window` in the browser, or `global` on the server. | |
var root = this; | |
requirejs.config( | |
{ | |
baseUrl: 'scripts/app', /* script default location */ | |
} | |
); | |
registerNonAmdLibs(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EFRepository<T> : IRepository<T> where T : class | |
{ | |
public EFRepository(DbContext dbContext) | |
{ | |
if (dbContext == null) | |
throw new ArgumentNullException("dbContext"); | |
DbContext = dbContext; | |
DbSet = DbContext.Set<T>(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define('model.attendance', | |
['ko'], | |
function (ko) { | |
var attendanceMakeId = function (personId, sessionId) { | |
return (personId + ',' + sessionId); | |
}; | |
var Attendance = function () { | |
var self = this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
saveCmd = ko.asyncCommand({ | |
execute: function (complete) { | |
if (canEditSession()) { | |
setTimeout(function() { | |
$.when(datacontext.sessions.updateData(session())) | |
.always(complete); | |
}, 3000); | |
return; | |
} |
OlderNewer