Stackedit/js/main.js

36 lines
1.0 KiB
JavaScript
Raw Normal View History

2013-04-05 17:44:10 +00:00
// RequireJS configuration
2013-04-02 18:42:47 +00:00
requirejs.config({
2013-04-07 15:22:13 +00:00
waitSeconds: 0,
2013-04-02 18:42:47 +00:00
shim: {
'jquery-ui': ['jquery'],
'bootstrap': ['jquery'],
'jgrowl': ['jquery'],
'layout': ['jquery-ui'],
2013-04-15 16:19:47 +00:00
'Markdown.Extra': ['Markdown.Converter', 'prettify'],
2013-04-27 00:15:21 +00:00
'Markdown.Editor': ['Markdown.Extra']
2013-04-02 18:42:47 +00:00
}
});
2013-04-05 17:44:10 +00:00
2013-05-12 00:48:25 +00:00
var load = requirejs.load;
requirejs.load = function (context, moduleId, url) {
// MathJax configuration
if(url.indexOf("MathJax.js") !== -1) {
url += "?config=TeX-AMS_HTML";
}
return load(context, moduleId, url);
};
2013-04-21 00:07:27 +00:00
require(["jquery", "file-manager", "synchronizer", "publisher"], function($) {
2013-03-24 19:42:15 +00:00
$(function() {
2013-04-10 18:14:59 +00:00
// If browser has detected a new application cache.
2013-04-14 21:21:49 +00:00
if (window.applicationCache) {
window.applicationCache.addEventListener('updateready', function(e) {
if(window.applicationCache.status === window.applicationCache.UPDATEREADY) {
window.applicationCache.swapCache();
window.location.reload();
}
}, false);
}
2013-03-24 19:42:15 +00:00
});
2013-04-02 18:42:47 +00:00
});