This file contains hidden or 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
ko.bindingHandlers.number = { | |
update: function(element, valueAccessor, allBindingsAccessor) { | |
var value = ko.utils.unwrapObservable(valueAccessor()), | |
precision = ko.utils.unwrapObservable(allBindingsAccessor().precision) || ko.bindingHandlers.number.defaultPrecision, | |
format = '###,###,###,###.' + '0'.repeat(precision) + ';(###,###,###,###.' + '0'.repeat(precision) + ')', | |
formattedValue = kendo.toString(parseFloat(value, 10), format); | |
ko.bindingHandlers.text.update(element, function() { return formattedValue; }); | |
}, | |
defaultPrecision: 0 |
This file contains hidden or 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
ko.bindingHandlers.kendoDataBar = { | |
init: function (element, valueAccessor, | |
allBindingsAccessor, viewModel, bindingContext) { | |
var data = ko.computed(function() { | |
var field = ko.utils.unwrapObservable(valueAccessor().field), | |
comparisons = ko.utils.unwrapObservable(valueAccessor().comparisons), | |
numerator = 0, | |
max = 0, | |
sum = 0, | |
values = [], |
This file contains hidden or 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
ko.kendo.bindingFactory.createBinding({ | |
name: 'kendoChart', | |
watch: { | |
data: function (value) { | |
ko.kendo.setDataSource(this, value); | |
}, | |
options: function (value) { | |
//unwrap observables from the options object | |
var jsonOptions = ko.toJSON(value); | |
//convert the unwrapped json to a plain object |
This file contains hidden or 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
ko.kendo.bindingFactory.createBinding({ | |
name: 'kendoSparkline', | |
bindingName: 'kendoSparkline', | |
watch: { | |
data: function(value) { | |
ko.kendo.setDataSource(this, value); | |
} | |
} | |
}); |
This file contains hidden or 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
if (!Array.prototype.filter) { | |
Array.prototype.filter = function(fun/*, thisArg*/) { | |
'use strict'; | |
if (this === void 0 || this === null) { | |
throw new TypeError(); | |
} | |
var t = Object(this); | |
var len = t.length >>> 0; |
This file contains hidden or 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
if (!String.prototype.repeat) { | |
String.prototype.repeat = function(count) { | |
'use strict'; | |
if (this == null) { | |
throw new TypeError('can\'t convert ' + this + ' to object'); | |
} | |
var str = '' + this; | |
count = +count; | |
if (count != count) { | |
count = 0; |
This file contains hidden or 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
/*global define, Mocha*/ | |
/** | |
Provides simplified Gherkin style syntax for Mocha tests by extending the functions in the standard 'BDD' interface. | |
** See {@link http://mochajs.org/#bdd-interface} for Mocha documentation. | |
** Feature and Scenario act as a wrapper for 'describe' | |
** Given, When, Then, But & And act as a wrapper for 'it' | |
** Feature, Scenario, Given, When, Then, But & And functions are capitalised as otherwise some of them would conflict with CoffeeScript keywords. | |
@module bdd-feature | |
@author Matt Barker |
This file contains hidden or 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
namespace ServiceLayer | |
{ | |
using System; | |
using System.Collections.ObjectModel; | |
using System.ServiceModel; | |
using System.ServiceModel.Channels; | |
using System.ServiceModel.Description; | |
using LAI.Data.Controllers.Mappers; | |
/// <summary> |
This file contains hidden or 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
/*global describe , it, expect*/ | |
describe('Array', function () { | |
'use strict'; | |
describe('.push()', function () { | |
it('should append a value', function () { | |
var arr = []; | |
arr.push('foo'); |
This file contains hidden or 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
using System.Collections; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Linq; | |
using Newtonsoft.Json; | |
/// <summary> | |
/// Represents the data service. | |
/// </summary> | |
public class DataService |