Merge pull request #601 from redhog/master

Bugfix for document.domain, and added initialization hook
pull/591/merge
John McLear 2012-04-05 16:38:40 -07:00
commit 5b87a2b1bb
5 changed files with 30 additions and 3 deletions

1
.gitignore vendored
View File

@ -11,3 +11,4 @@ bin/convertSettings.json
src/static/js/jquery.js
npm-debug.log
*.DS_Store
.ep_initialized

View File

@ -98,6 +98,28 @@ if (exports.isClient) {
};
} else {
exports.callInit = function (cb) {
var hooks = require("./hooks");
async.map(
Object.keys(exports.plugins),
function (plugin_name, cb) {
var plugin = exports.plugins[plugin_name];
fs.stat(path.normalize(path.join(plugin.package.path, ".ep_initialized")), function (err, stats) {
if (err) {
async.waterfall([
function (cb) { fs.writeFile(path.normalize(path.join(plugin.package.path, ".ep_initialized")), 'done', cb); },
function (cb) { hooks.aCallAll("init_" + plugin_name, {}, cb); },
cb,
]);
} else {
cb();
}
});
},
function () { cb(); }
);
}
exports.update = function (cb) {
exports.getPackages(function (er, packages) {
var parts = [];
@ -109,11 +131,12 @@ exports.update = function (cb) {
exports.loadPlugin(packages, plugin_name, plugins, parts, cb);
},
function (err) {
exports.plugins = plugins;
if (err) cb(err);
exports.plugins = plugins;
exports.parts = exports.sortParts(parts);
exports.hooks = exports.extractHooks(exports.parts, "hooks");
exports.loaded = true;
cb(err);
exports.loaded = true;
exports.callInit(cb);
}
);
});

View File

@ -130,6 +130,7 @@
<script src="static/custom/index.js"></script>
<script>
document.domain = document.domain;
function go2Name()
{
var padname = document.getElementById("padname").value;

View File

@ -280,6 +280,7 @@
<script type="text/javascript" src="../javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define"></script>
<% } %>
<script type="text/javascript">
document.domain = document.domain;
var clientVars = {};
(function () {
<% if (settings.minify) { %>

View File

@ -203,6 +203,7 @@
<script type="text/javascript" src="../../../javascripts/lib/ep_etherpad-lite/static/js/timeslider.js?callback=require.define"></script>
<script type="text/javascript" src="../../../static/custom/timeslider.js"></script>
<script type="text/javascript" >
document.domain = document.domain;
var clientVars = {};
(function () {
require.setRootURI("../../../javascripts/src");