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([ | |
'backbone', | |
'lodash' | |
], | |
function(Backbone, _) { | |
'use strict'; | |
/** | |
* Sheet Model | |
*/ | |
return Backbone.Model.extend({ |
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([ | |
'jquery', | |
'backbone', | |
'lodash', | |
'handlebars', | |
'listjs' | |
], | |
function($, Backbone, _, Handlebars, List) { | |
'use strict'; | |
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
require({ | |
paths: { | |
jquery: '//code.jquery.com/jquery-2.0.3.min', | |
lodash: '//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash', | |
backbone: '//cdn.jsdelivr.net/backbonejs/1.0.0/backbone-min', | |
handlebars: '//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.min', | |
listjs: '//cdnjs.cloudflare.com/ajax/libs/list.js/1.0.2/list.min' | |
}, | |
shim: { |
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 person = { shoeSize: 43, name: 'nekman' }; | |
Object.observe(person, function(changes) { | |
var change = changes[0]; | |
console.log('Changed property "%s" from %s to %s.', | |
change.name, | |
change.oldValue, | |
change.object[change.name] | |
); | |
}); |
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
$.ajax({ | |
url: 'http://api.flickr.com/services/feeds/photos_public.gne?format=json&jsoncallback=?', | |
dataType: 'jsonp' | |
}).then(function(data) { | |
console.log(data); | |
}); |
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
jsonp('//api.flickr.com/services/feeds/photos_public.gne?format=json&jsoncallback=?') | |
.then(function(data) { console.log('flickr', data); }) | |
.catch(function(err) { console.log(err); }); | |
jsonp('//api.stackexchange.com/2.2/info?site=stackoverflow') | |
.then(function(data) { console.log('stackoverflow', data); }) | |
.catch(function(err) { console.log(err); }); |
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 toYQL(url) { | |
var yqlUrl = 'http://query.yahooapis.com/v1/public/yql?q=', | |
query = 'select * from json where url="{url}"'.replace('{url}', url); | |
return yqlUrl + encodeURIComponent(query) + '&format=json'; | |
} |
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 toYQL(url) { | |
var yqlUrl = 'http://query.yahooapis.com/v1/public/yql?q=', | |
query = 'select * from json where url="{url}"'.replace('{url}', url); | |
return yqlUrl + encodeURIComponent(query) + '&format=json'; | |
} | |
function getCORSRequest(method, url) { | |
return new Promise(function(resolve, reject) { |
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 keys(object, deep) { | |
'use strict'; | |
var keys = []; | |
function isObject(obj) { | |
var type = typeof obj; | |
return type === 'function' || type === 'object' && !!obj; | |
} |
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 dependencies = [ | |
'myApp/model/Session', | |
'myApp/services/Authenticator', | |
'myApp/controllers/LoginController' | |
]; | |
define( dependencies, function( Session, Authenticator, LoginController ) |
OlderNewer