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
/* Reused elements */ | |
.button | |
background: url('../img/buttons.png') | |
display : block | |
height : 32px | |
text-indent : -9999px | |
width : 130px | |
&.download | |
background-position: -162px 0 |
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
/** | |
* QUESTION MAINTENANCE OPERATIONS | |
* | |
* This object contains the code to handle question maintenance. That includes, but is | |
* not limited to, switching to view administrative vs applicant questions, updating the | |
* qualification status of a given question, and selecting a new question to add. | |
* | |
*/ | |
SM.adminQuestions = { | |
init : function(){ |
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
// the app uses javascript only for effects and the tiniest bit of data manipulation, so a | |
// full-stack framework doesn't necessarily make sense. I'm really looking to organize all | |
// of the effects we're doing throughout the app. | |
var NS = {}; | |
NS.controllerName = { | |
init : function(){ | |
this.doDomBindings(); |
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
// create a master object | |
var myObj = {}; | |
myObj.nestedObj = {}; | |
// create a nested object | |
myObj.nestedObj = { | |
myReturns : { | |
first : 'foo', | |
second : 'bar' |
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 myObj = {}; | |
myObj.nestedObj = { | |
myReturns : { | |
first : 'foo', | |
second : 'bar' | |
}, | |
myCaller : function(){ |
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
//used to have | |
var someObjOld = { | |
int1 : {}, | |
int2 : {}, | |
int3 : { function(){ this.int4(); }}, | |
int4 : {} | |
}; | |
// now have | |
var someObj = { |
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 someObj = { | |
// wtf? 2 names? | |
myFunc : function myAlias(){ | |
// deep nesting | |
// deep nesting | |
// deep nesting | |
// deep nesting | |
// oh no, i need to call myself! |
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 _generateGroupId = function randGen(){ | |
// 2. newid is reset | |
var newId = Math.floor(Math.random() * 10); | |
if( _(myArray).include(newId) ){ | |
// 1. you're sent back to the top of the function | |
randGen.apply( this ); | |
} else { | |
myArray.push( newId ); | |
// 3. a new id is explicitly returned. if you log here, you will get the new value |
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
// run this first on the console | |
var script= document.createElement('script'); | |
script.src= 'https://raw.github.com/documentcloud/underscore/master/underscore-min.js'; | |
document.head.appendChild(script); | |
// then run this | |
var someObj = { | |
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
$openDocument.click(function(e){ | |
e.preventDefault(); | |
this.showDocument( $(this) ); | |
}.bind(this)); |