Last active
August 29, 2015 13:55
-
-
Save morganney/8757713 to your computer and use it in GitHub Desktop.
Gister Module Interface Snippet.
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
/* | |
* Note that this module assumes support for | |
* MutationObservers and Promises. | |
* A polyfill for Promises is most likely needed. | |
*/ | |
define(['jquery'], function($) { | |
var Gister = { | |
fetch: function(gistid) { | |
// Promise returning JSONP method to fetch Gists. | |
}, | |
embedGists: function(dataAttrName) { | |
// Our MutationObserver callback to actually embed the Gists. | |
}, | |
addGistCss: function addCss(filename) { | |
// Append the CSS file from GitHub to <head>. | |
addCss = function(){/* But only once! */}; | |
} | |
// Possibly more methods ... | |
}; | |
return Gister; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment