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
| search: _.debounce(function(e) { | |
| var self = this, | |
| $noResults = this.$('.empty-state'), | |
| $loading = this.$('.loading-state'), | |
| contacts = Mast.data.contacts, | |
| value = $.trim(e.currentTarget.value), | |
| data; | |
| if (value.length < 1) { | |
| self.collection.reset(); |
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() { | |
| // Attach to namespaced window object | |
| window.ioffice = window.ioffice || {}; | |
| ioffice.collections = ioffice.collections || {}; | |
| ioffice.collections.contacts = Backbone.Collection.extend({ | |
| model: Backbone.Model, | |
| getContacts: function(filter, cb) { |
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
| self.reset(_.map(_.filter(contacts, function(contact) { | |
| return contact.emails && contact.emails.length; | |
| }), function(contact) { | |
| var name = contact.name, | |
| email; | |
| email = _.findWhere(contact.emails, {'type': 'work'}) || contact.emails[0]; | |
| return { | |
| firstName: name.givenName || '', |
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 PhonegapContactStore = function(){}; | |
| _.extend(PhonegapContactStore.prototype,{ | |
| create: $.noop, | |
| update: $.noop, | |
| find: function(data, cb) { | |
| // If we are not on device with contacts just return callback | |
| if (typeof ContactFindOptions === "undefined") { | |
| if (cb) cb(); | |
| return; |
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
| search: function(e) { | |
| var $input = this.$('input[name="contact"]'), | |
| self = this; | |
| $input.addClass('loading'); | |
| _.debounce(function(e) { | |
| var $emptySearch = self.$('.empty-search'), | |
| $noRecentGuests = self.$('no-recent-guests'), | |
| users = self.users, |
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
| digestXHR: function(xhr) { | |
| return xhr.status + ' ' + xhr.statusText + '\nResponse text: ' + (xhr.responseText.length > 0 ? xhr.responseText : 'No response.'); | |
| } |
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 tacoApp = angular.module('tacoApp', ['TacoModel', 'hmTouchevents']); | |
| // Index: http://localhost/views/taco/index.html | |
| tacoApp.controller('IndexCtrl', function ($scope, TacoRestangular) { | |
| // This will be populated with Restangular | |
| $scope.tacos = []; |
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
| // The contents of individual model .js files will be concatenated into dist/models.js | |
| (function() { | |
| // Protects views where angular is not loaded from errors | |
| if ( typeof angular == 'undefined' ) { | |
| return; | |
| }; | |
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
| module.exports = function(grunt) { | |
| 'use strict'; | |
| grunt.loadNpmTasks('grunt-sails-linker'); | |
| // Project configuration. | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| copy: { | |
| dev: { | |
| 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
| ;(function($, window, document, undefined) { | |
| var pluginName = 'AutoComplete', | |
| defaults = { | |
| list: '.auto-complete-list', | |
| cancel: '.auto-complete-cancel', | |
| itemSelector: '.auto-complete-item', | |
| dataId: 'auto-val-set', | |
| valueAttr: 'name', | |
| valueId: 'id', |