Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danbeam/961018 to your computer and use it in GitHub Desktop.
Save danbeam/961018 to your computer and use it in GitHub Desktop.
smugmug-immediate-object.js
({
'window' : this,
'position' : 'UI Engineer',
'location' : 'SmugMug',
'website' : 'http://smugmug.com/jobs',
'skills' : [ 'javascript', 'css', 'web standards', 'object oriented programming', 'php' ],
'benefits' : {
'awesomeTeam' : true,
'technicalCEO' : true,
'microManagement' : false,
'onSiteChef' : true,
'onSiteTrainer' : true,
'cadillacHealthcare' : true,
'closedMinded' : false,
'useOldTech' : false
},
'apply' : function (yourEmail, resume) {
// You can't just use send(), here, you have to use this.send
// This is changed to {job} when declared inside an object literal
// http://www.nczonline.net/blog/2010/01/26/answering-baranovskiys-javascript-quiz/ Example #5
this.send(yourEmail, 'jobs@smugmug.com', 'I saw SmugMug at JSConf!', resume);
},
'send' : function (from, to, subject, body) {
var link = 'mailto:' + this.window.escape(to)
+ '&subject=' + this.window.encodeURIComponent(subject)
+ '&body=' + this.window.encodeURIComponent(body);
this.window.location.href = link; // wasn't working for me, P.S.
}
}).apply('dan@danbeam.org', 'http://danbeam.org/resume');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment