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
| var path = require("path"); | |
| module.exports = function(grunt) { | |
| grunt.initConfig({ | |
| less: { | |
| options: { | |
| yuicompress : true | |
| }, | |
| desktop : { | |
| files: { |
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
| var i, len, list, main, item; | |
| var onItemClicked = function (e) { | |
| var i = 0, len = devices.length; | |
| for(i = 0; i < len; i++) { | |
| if(devices[i].name === e.target.innerText) { | |
| devices[i].status = (devices[i].status === 'in') ? 'out' : 'in'; | |
| console.log(devices[i].status); | |
| } |
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
| var Queue = function () { | |
| this.initialize.apply(this, arguments); | |
| }; | |
| var p = Queue.prototype; | |
| p.initialize = function () { | |
| _.bindAll(this, ['check']); | |
| this.items = []; |
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
| var Item = function (obj) { | |
| this.children = []; | |
| _.extend(this, obj); | |
| }; | |
| var p = Item.prototype; | |
| p.add = function (obj) { | |
| this.children.push(new Item(obj)); | |
| return _.last(this.children); |
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
| function (number, country) { | |
| var req, valid = $.Deferred(); | |
| req = $.ajax({ | |
| type : 'GET', | |
| url : '/api/v3/validation-url', | |
| dataType : 'json', | |
| data : { | |
| phonenumber : number, | |
| countryid : country |
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
| define(['backbone', 'dummy/models/DummyModel'], function (Backbone, DummyModel) { | |
| var Collection = Backbone.Collection.extend({ | |
| url : '/dummies', | |
| model : DummyModel | |
| }); | |
| return Collection; | |
| }); |
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
| (function (global) { | |
| var Blueprint = function () { | |
| }; | |
| var p = Blueprint.prototype; | |
| p.generate = function (api) { | |
| var obj = {}, template = this.template(api); |
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
| var Url = function (url) { | |
| this._url = url; | |
| }; | |
| _.extend(Url.prototype, { | |
| /* more prescriptive methods */ | |
| }); | |
| var methods = ['forEach', 'each', 'map', 'find', 'detect', 'filter', | |
| 'select', 'reject', 'every', 'all', 'some', 'any', 'include', |
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
| /** | |
| * Initialization could be broken down into swappable blocks (which could be turned on or off). | |
| * Point is, the init sequence is more controllable if it's broken out into phases/functions. | |
| * | |
| * This is how it's done within Marionette: | |
| * https://github.com/marionettejs/backbone.marionette/blob/master/src/marionette.application.js | |
| * | |
| * http://jsfiddle.net/agoftkng/5/ | |
| */ | |
| var App = function() { |
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
| (function(root, factory) { | |
| if (typeof define === 'function' && define.amd) { | |
| define(function() { | |
| return (root.Logger = factory()); | |
| }); | |
| } else if (typeof exports === 'object') { | |
| module.exports = factory(); | |
| } else { | |
| root.Logger = factory(); | |
| } |
OlderNewer