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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>name</key> | |
| <string>Railscasts</string> | |
| <key>settings</key> | |
| <array> | |
| <dict> | |
| <key>settings</key> |
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 Button = function(id) { | |
| this.id = id; | |
| this.$context = $(id); | |
| this.$context.on('click', $.proxy(this.handleClick, this)); | |
| } | |
| Button.prototype.changeAction = function(action) { | |
| this.action = action; | |
| } | |
| Button.prototype.handleClick = function() { | |
| this.action(); |
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
| script(type="text/html", id="modal-service-selection") | |
| .modal-service-selection.modal-centered.modal.stretch.hide.fade | |
| .modal-header | |
| a.button-close(data-dismiss='modal') | |
| img(src="../img/icons/latest/icon-exit.png") | |
| h3 You have selected | |
| span.emphasize {{ service.name }} | |
| p Please select the subcategory that fits your needs: | |
| .modal-body | |
| ul.l-horizontal.clearfix.reservation-entries |
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
| // Optimized version of classical inheritance | |
| // Proxy constructor is stored in a closure which is | |
| // returned from a self executing function. | |
| var inherit = (function() { | |
| var F = function() {}; | |
| return function(C, P) { | |
| F.prototype = P.prototype; | |
| C.prototype = new F(); | |
| C._super = P.prototype; | |
| C.prototype.constructor = C; |
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() { | |
| var klass = function(Parent, props) { | |
| var Child, F, i; | |
| // 1. | |
| // new constructor | |
| Child = function() { | |
| // Call the super class constructor | |
| if (Child._super && Child._super.hasOwnProperty('_construct')) { |
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 Parent1 = function() { | |
| this.name = 'foo'; | |
| } | |
| var Parent2 = function() { | |
| this.age = '21'; | |
| } | |
| var Child = function() { | |
| Parent1.apply(this, arguments); |
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
| add = function(amount) { | |
| return function(callback) { | |
| return function() { | |
| var value; | |
| value = callback.apply(this, arguments); | |
| return value + amount; | |
| }; | |
| }; | |
| }; |
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
| add(1) \ | |
| multiply(2) \ | |
| -> | |
| 1 |
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 validator = new Validator(); | |
| validator.decorate('hasName', { length: 5 }); | |
| validator.decorate('hasAge', { minimum: 21 }); | |
| validator.decorate('hasZipCode'); | |
| validator.validate({}); // some form data. in this case just an anonymous object | |
| console.log(validator.errors); |
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 Validator () { | |
| this.errors = []; | |
| this.decoratorsList = []; | |
| } | |
| Validator.prototype.decorate = function(name, args) { | |
| this.decoratorsList.push({ name: name, args: args }); | |
| }; | |
| Validator.decorators = {}; |