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 View = Backbone.View.extend({ | |
}); | |
var myView = new View(); |
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 View = Backbone.View.extend({ | |
render: function() { | |
var template = _.template($('#template').html(), {name:'Tan Nguyen'}); | |
this.$el.html(template); | |
} | |
}); | |
var myView = new View(); | |
var object = {}; |
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 User = Backbone.Model.extend({ | |
defaults: { | |
name: "Unknown", | |
age: 50, | |
company: "Unknow" | |
}, | |
validate: function(attrs){ | |
if (attrs.age > 150 || attrs.age < 0) { | |
return "Are you a human???"; | |
} |
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 SomeClass() { | |
} | |
var sl = new SomeClass(); |
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 SomeClass() { | |
} | |
var sl = new SomeClass(); |
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
l.prototype.routeSpace = function (a, b) { | |
var c = b[0]; | |
return c === undefined ? this.getValues(a) : (typeof c == "number" && (c = Array.prototype.slice.call(b)), this.setValues(a, c)) | |
}, l.prototype.setValues = function (a, b) { | |
return this.space = a, this.convs = {}, this.convs[a] = b, this | |
}, l.prototype.getValues = function (a) { | |
var b = this.convs[a]; | |
if (!b) { | |
var c = this.space, | |
d = this.convs[c]; |
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
l.prototype.routeSpace = function (a, b) { | |
var c = b[0]; | |
return c === undefined ? this.getValues(a) : (typeof c == "number" && (c = Array.prototype.slice.call(b)), this.setValues(a, c)) | |
}, l.prototype.setValues = function (a, b) { | |
return this.space = a, this.convs = {}, this.convs[a] = b, this | |
}, l.prototype.getValues = function (a) { | |
var b = this.convs[a]; | |
if (!b) { | |
var c = this.space, | |
d = this.convs[c]; |
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
e.preventDefault(); | |
var doc = e.delegateTarget; | |
var selection = window.getSelection(); | |
if (!selection.rangeCount) return; | |
var range = selection.getRangeAt(0); | |
var content = $(range.cloneContents()).text(); |
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
e.preventDefault(); | |
var doc = e.delegateTarget; | |
var selection = window.getSelection(); | |
if (!selection.rangeCount) return; | |
var range = selection.getRangeAt(0); | |
var content = $(range.cloneContents()).text(); |
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
e.preventDefault(); | |
var doc = e.delegateTarget; | |
var selection = window.getSelection(); | |
if (!selection.rangeCount) return; | |
var range = selection.getRangeAt(0); | |
var content = $(range.cloneContents()).text(); |