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 app = express(); | |
| //CORS middleware | |
| var allowCrossDomain = function(req, res, next) { | |
| res.header('Access-Control-Allow-Origin', '*'); | |
| res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); | |
| res.header('Access-Control-Allow-Headers', 'Content-Type'); | |
| next(); | |
| }; |
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) { | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| watch : { | |
| options: { | |
| livereload: true | |
| }, | |
| less : { | |
| tasks : 'less:development', |
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
| ko.extenders.resettable = (target, option) -> | |
| if option | |
| original = ko.utils.unwrapObservable(option.initialValue) ? '' | |
| if $.isArray(original) | |
| copiedOriginal = $.extend(true, [], original) | |
| else if typeof original is 'object' | |
| copiedOriginal = $.extend(true, {}, original) | |
| else | |
| copiedOriginal = original |
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
| require.config({ | |
| baseUrl: './javascripts', | |
| paths: { | |
| jquery : '../components/jquery/jquery', | |
| domReady : '../components/requirejs-domready/domReady', | |
| underscore : '../components/underscore/underscore', | |
| backbone : '../components/backbone/backbone', | |
| marionette : '../components/marionette/lib/backbone.marionette', | |
| handlebars : '../components/handlebars.js/dist/handlebars', | |
| hbs : '../components/require-handlebars-plugin/hbs', |
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
| _.templateSettings = { | |
| interpolate : /\{\{\=(.+?)\}\}/g, | |
| evaluate : /\{\{(.+?)\}\}/g | |
| }; |
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
| class NewsItem | |
| constructor : (itemText) -> | |
| @content = ko.observable(itemText) | |
| class NewsViewModel | |
| constructor : -> | |
| @items = ko.observableArray() | |
| @itemText = ko.observable() | |
| addItem : -> |
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) { | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| watch : { | |
| tasks : 'coffee', | |
| files : ['**/*.coffee'] | |
| }, | |
| coffee: { |
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
| <a href=''>Home</a> | |
| <a href='about'>About</a> |
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
| class AboutModel extends Backbone.Model | |
| defaults: | |
| firstName: 'Hyojung' | |
| class HomeView extends Backbone.View | |
| initialize: -> | |
| @render() | |
| render: -> | |
| templateContent = $('#home-template').html() |
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
| require([ | |
| 'bootstrap' | |
| ], | |
| function (bootstrap) { | |
| } | |
| ); | |
| }) |