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
let youtubeRedirectUrl = 'http://www.yoursite.com/oauth/youtube/redirect-callback' | |
if(process.env.NODE_ENV === 'development'){ | |
youtubeRedirectUrl = 'http://localhost:3000/oauth/youtube/redirect-callback' | |
} | |
module.exports = { | |
sessionSecret: 'cookieMonster7482', | |
youTubeOAuth: { | |
clientID:'221782448762-5svpitibr4rhfq7tvs422egniceb2m8d.apps.googleusercontent.com', |
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
let initGameBoard = function(){ | |
let arr = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","x"] | |
return _.chunk( _.shuffle(arr),4 ) | |
} | |
function printGameBoard(board){ | |
let boardHtml = board.map((rowVals)=> rowVals.map( (colVal)=> { | |
return `<div id="${colVal}">${colVal}</div>` |
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
// Which HTML element is the target of the event | |
function mouseTarget(e) { | |
var targ; | |
if (!e) var e = window.event; | |
if (e.target) targ = e.target; | |
else if (e.srcElement) targ = e.srcElement; | |
if (targ.nodeType == 3) // defeat Safari bug | |
targ = targ.parentNode; | |
return targ; | |
} |
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
import Backbone from 'backbone' | |
import $ from 'jquery' | |
export const UserModel = Backbone.Model.extend({ | |
initialize: function(){ | |
}, | |
urlRoot: '/api/users', | |
idAttribute: '_id' | |
}) |
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
const AppRouter = Backbone.Router.extend({ | |
//(1) | |
_currentViewInstance: null, | |
//(2a) this will undelegate the event-listeners | |
// from the 'zombie view' | |
_destroyZombieView: function(){ | |
console.log(this._currentViewInstance) |
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
const React = require('react') | |
const HomeView = require('./component-homeview.js') | |
const ACTIONS = require('./actions.js') | |
const STORE = require('./store.js') | |
const AppViewController = React.createClass({ | |
getInitialState: function(){ | |
let startingState = {} | |
return startingState | |
}, |
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
const Backbone = require('backbone') | |
// const AppViewController = require('backbone') | |
const AppRouter = Backbone.Router.extend({ | |
routes: { | |
"*" : "renderCatchAll" | |
}, | |
renderCatchAll: function(){ | |
document.querySelector('#app-container').innerHTML = "<h1>YOLO</h1>" |
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
const Backbone = require('backbone'); | |
// import STORE from '../store/store.js'; | |
// import toastr from 'toastr' | |
const { UserModel, TodoModel, TodoCollection } = require('UserModel') | |
const ACTIONS = { | |
fetchTodoCollection: function(queryObj){ | |
}, |
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
export const STORE = { | |
_data: { | |
shoutOutList: [], | |
shownRatingType: 'PG', | |
currentNavRoute: '' | |
}, | |
getStoreData: function(){ | |
return this._data | |
}, |
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
const DivContainerComponent = React.createClass({ | |
render: function(){ | |
return ( | |
<div className={this.props.containerClassName || ""}> | |
{this.props.dataList.map((elData, i)=>{ | |
return React.cloneElement(this.props.children, {data: elData, key: `${(new Date()).getTime()}-${i}`}) | |
})} | |
</div> | |
) | |
} |