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 () { | |
var root = $(document.getElementsByTagName('body')); | |
var watchers = []; | |
var f = function (element) { | |
if (element.data().hasOwnProperty('$scope')) { | |
angular.forEach(element.data().$scope.$$watchers, function (watcher) { | |
watchers.push(watcher); | |
}); | |
} |
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
angular | |
.module('app.core') | |
.factory('cranker', cranker); | |
cranker.$inject = ['$http', '$log', '$q']; | |
function cranker($http, $log, $q) { | |
var data; | |
return { | |
go: function () { |
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 gulp = require('gulp'); | |
var $ = require('gulp-load-plugins')({ lazy: true }); | |
gulp.task('serve-dev', function () { | |
log(process.argv); | |
var nodeOptions = { | |
script: './src/server/app.js', | |
delayTime: 1, | |
env: { | |
'PORT': 8001, |
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
'use strict'; | |
class DashboardController { | |
static $inject: Array<string> = ['$q', 'dataservice', 'logger']; | |
constructor(private $q: ng.IQService, | |
private dataservice: app.core.IDataService, | |
private logger: blocks.logger.Logger) { | |
var promises = [this.getMessageCount(), this.getPeople()]; | |
this.$q.all(promises).then(function () { | |
logger.info('Activated Dashboard View'); |
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'], |
OlderNewer