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 __extends = require('dotmvc/lib/util/extends'); | |
var __mixin = require('dotmvc/lib/util/mixin'); | |
var KendoChart = require('./KendoChart.js'); | |
var KendoColumnSparkline = require('./KendoColumnSparkline.js'); | |
// Configs | |
var SeriesDefaults = require('./config/SeriesDefaults.js'); | |
var AxisDefaults = require('./config/AxisDefaults.js'); | |
var CategoryAxis = require('./config/CategoryAxis.js'); | |
var Tooltip = require('./config/Tooltip.js'); |
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
// in the listening view (could be HeroWidgetContainer.js or any view) | |
// 'someView' could be DashboardView, Footprint, or any View obj | |
this.listenTo(someView, 'walkthroughEvent1', this.startWalkthrough); | |
// in someView (that will be emitting events) | |
this.trigger('walkthroughEvent1'); | |
// if you need to stop listening to an obj's event | |
this.stopListening(someView, 'walkthroughEvent1'); |
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 $ = require('jquery'); | |
var Q = require('q'); | |
var moment = require('moment'); | |
// iCal date parser | |
// -------------------------------------- | |
function ICalDateParser(d) | |
{ | |
this._date = d; | |
this.parsedDate = null; |
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 normalize(array, field, max) | |
{ | |
var highValue = getHighValue(array, field); | |
var divisor = highValue / max; | |
return array.map(function(x) { | |
x[field] = x[field] / divisor; | |
return x; | |
}); | |
} |
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
// ------------------------------------- | |
// Box View Model | |
module.exports = Box; | |
/** | |
* Box view model | |
* @property {object} position A list of spacial coordinates | |
* @property {number} width | |
* @property {number} height | |
* @constructor |
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
Package Management | |
npm | |
https://www.npmjs.org/ | |
need to add a package? | |
npm install underscore --save | |
bam | |
Bundling require, module.exports, and other node-isms down to browser-usable JS | |
Browserify |
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
/** | |
* Set up container view | |
* Set up container subviews | |
*/ | |
StreamController.prototype.start = function() | |
{ | |
this.container = this.setupCommunityStream(); | |
this.setupHeader(); | |
this.setupNavigationBar(); |
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
module.exports = CSTransport; | |
var Promise = require('bluebird'); | |
var HttpTransport = require('http-transport'); | |
var jsonpClient = require('jsonp-client'); | |
var path = require('path'); | |
var urlUtil = require('url'); | |
function CSTransport() | |
{ |
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
/** | |
* Display loading indicator while view model data is being synced | |
* Set up container view and its subviews | |
* Fade in container | |
* @return {Promise} | |
*/ | |
StreamController.prototype.start = function() | |
{ | |
this.container = this.setupCommunityStream(); | |
this.loadingIndicator = this.setupLoadingIndicator(); |
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
/** | |
* @param {GainNode} gainAmount | |
*/ | |
_turnMusicUp(gainAmount) | |
{ | |
var music = this.sound.getCurrentMusic(); | |
var currentGain = this.sound.getGainValue(music); | |
this.sound.fadeIn(music, 1000, currentGain, gainAmount); | |
} |
OlderNewer