Merge branch 'master' into timeslider-realtimeupdate+readonly-pads
Conflicts: src/node/handler/PadMessageHandler.js src/static/css/pad.css src/templates/pad.html
This commit is contained in:
commit
15a7d24450
|
@ -4,17 +4,17 @@
|
||||||
|
|
||||||
if(process.argv.length != 3)
|
if(process.argv.length != 3)
|
||||||
{
|
{
|
||||||
console.error("Use: node checkPad.js $PADID");
|
console.error("Use: node bin/checkPad.js $PADID");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
//get the padID
|
//get the padID
|
||||||
var padId = process.argv[2];
|
var padId = process.argv[2];
|
||||||
|
|
||||||
//initalize the database
|
//initalize the database
|
||||||
var log4js = require("log4js");
|
var log4js = require("../src/node_modules/log4js");
|
||||||
log4js.setGlobalLogLevel("INFO");
|
log4js.setGlobalLogLevel("INFO");
|
||||||
var async = require("async");
|
var async = require("../src/node_modules/async");
|
||||||
var db = require('../node/db/DB');
|
var db = require('../src/node/db/DB');
|
||||||
|
|
||||||
var Changeset = require("ep_etherpad-lite/static/js/Changeset");
|
var Changeset = require("ep_etherpad-lite/static/js/Changeset");
|
||||||
var padManager;
|
var padManager;
|
||||||
|
@ -28,7 +28,7 @@ async.series([
|
||||||
//get the pad
|
//get the pad
|
||||||
function (callback)
|
function (callback)
|
||||||
{
|
{
|
||||||
padManager = require('../node/db/PadManager');
|
padManager = require('../src/node/db/PadManager');
|
||||||
|
|
||||||
padManager.doesPadExists(padId, function(err, exists)
|
padManager.doesPadExists(padId, function(err, exists)
|
||||||
{
|
{
|
||||||
|
|
|
@ -431,7 +431,7 @@ exports.setPassword = function(padID, password, callback)
|
||||||
if(ERR(err, callback)) return;
|
if(ERR(err, callback)) return;
|
||||||
|
|
||||||
//set the password
|
//set the password
|
||||||
pad.setPassword(password);
|
pad.setPassword(password == "" ? null : password);
|
||||||
|
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
|
|
|
@ -29,12 +29,12 @@ var randomString = require('ep_etherpad-lite/static/js/pad_utils').randomString;
|
||||||
var apikey = null;
|
var apikey = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
apikey = fs.readFileSync("../APIKEY.txt","utf8");
|
apikey = fs.readFileSync("./APIKEY.txt","utf8");
|
||||||
}
|
}
|
||||||
catch(e)
|
catch(e)
|
||||||
{
|
{
|
||||||
apikey = randomString(32);
|
apikey = randomString(32);
|
||||||
fs.writeFileSync("../APIKEY.txt",apikey,"utf8");
|
fs.writeFileSync("./APIKEY.txt",apikey,"utf8");
|
||||||
}
|
}
|
||||||
|
|
||||||
//a list of all functions
|
//a list of all functions
|
||||||
|
|
|
@ -196,6 +196,6 @@ exports.doImport = function(req, res, padId)
|
||||||
ERR(err);
|
ERR(err);
|
||||||
|
|
||||||
//close the connection
|
//close the connection
|
||||||
res.send("<script>document.domain = document.domain; var impexp = window.top.require('/pad_impexp').padimpexp.handleFrameCall('" + status + "'); </script>", 200);
|
res.send("<script type='text/javascript' src='/static/js/jquery.js'></script><script> if ( (!$.browser.msie) && (!($.browser.mozilla && $.browser.version.indexOf(\"1.8.\") == 0)) ){document.domain = document.domain;}var impexp = window.top.require('/pad_impexp').padimpexp.handleFrameCall('" + status + "');</script>", 200);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/usr/bin/env node
|
||||||
/**
|
/**
|
||||||
* This module is started with bin/run.sh. It sets up a Express HTTP and a Socket.IO Server.
|
* This module is started with bin/run.sh. It sets up a Express HTTP and a Socket.IO Server.
|
||||||
* Static file Requests are answered directly from this module, Socket.IO messages are passed
|
* Static file Requests are answered directly from this module, Socket.IO messages are passed
|
||||||
|
@ -65,9 +66,9 @@ async.waterfall([
|
||||||
plugins.update,
|
plugins.update,
|
||||||
|
|
||||||
function (callback) {
|
function (callback) {
|
||||||
console.log("Installed plugins: " + plugins.formatPlugins());
|
console.info("Installed plugins: " + plugins.formatPlugins());
|
||||||
console.log("Installed parts:\n" + plugins.formatParts());
|
console.debug("Installed parts:\n" + plugins.formatParts());
|
||||||
console.log("Installed hooks:\n" + plugins.formatHooks());
|
console.debug("Installed hooks:\n" + plugins.formatHooks());
|
||||||
callback();
|
callback();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -88,12 +89,12 @@ async.waterfall([
|
||||||
|
|
||||||
//let the server listen
|
//let the server listen
|
||||||
app.listen(settings.port, settings.ip);
|
app.listen(settings.port, settings.ip);
|
||||||
console.log("Server is listening at " + settings.ip + ":" + settings.port);
|
console.log("You can access your Etherpad-Lite instance at http://" + settings.ip + ":" + settings.port + "/");
|
||||||
if(!_.isEmpty(settings.users)){
|
if(!_.isEmpty(settings.users)){
|
||||||
console.log("Plugin admin page listening at " + settings.ip + ":" + settings.port + "/admin/plugins");
|
console.log("The plugin admin page is at http://" + settings.ip + ":" + settings.port + "/admin/plugins");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
console.log("Admin username and password not set in settings.json. To access admin please uncomment and edit 'users' in settings.json");
|
console.warn("Admin username and password not set in settings.json. To access admin please uncomment and edit 'users' in settings.json");
|
||||||
}
|
}
|
||||||
callback(null);
|
callback(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,513 +0,0 @@
|
||||||
/**
|
|
||||||
* This Module manages all /minified/* requests. It controls the
|
|
||||||
* minification && compression of Javascript and CSS.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 2011 Peter 'Pita' Martischka (Primary Technology Ltd)
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS-IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
var ERR = require("async-stacktrace");
|
|
||||||
var settings = require('./Settings');
|
|
||||||
var async = require('async');
|
|
||||||
var fs = require('fs');
|
|
||||||
var cleanCSS = require('clean-css');
|
|
||||||
var jsp = require("uglify-js").parser;
|
|
||||||
var pro = require("uglify-js").uglify;
|
|
||||||
var path = require('path');
|
|
||||||
var RequireKernel = require('require-kernel');
|
|
||||||
var server = require('../server');
|
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
var ROOT_DIR = path.normalize(__dirname + "/../" );
|
|
||||||
var JS_DIR = ROOT_DIR + '../static/js/';
|
|
||||||
var CSS_DIR = ROOT_DIR + '../static/css/';
|
|
||||||
var CACHE_DIR = path.join(settings.root, 'var');
|
|
||||||
=======
|
|
||||||
var ROOT_DIR = path.normalize(__dirname + "/../../static/");
|
|
||||||
>>>>>>> pita
|
|
||||||
var TAR_PATH = path.join(__dirname, 'tar.json');
|
|
||||||
var tar = JSON.parse(fs.readFileSync(TAR_PATH, 'utf8'));
|
|
||||||
|
|
||||||
// Rewrite tar to include modules with no extensions and proper rooted paths.
|
|
||||||
exports.tar = {};
|
|
||||||
for (var key in tar) {
|
|
||||||
exports.tar['/' + key] =
|
|
||||||
tar[key].map(function (p) {return '/' + p}).concat(
|
|
||||||
tar[key].map(function (p) {return '/' + p.replace(/\.js$/, '')})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* creates the minifed javascript for the given minified name
|
|
||||||
* @param req the Express request
|
|
||||||
* @param res the Express response
|
|
||||||
*/
|
|
||||||
exports.minify = function(req, res, next)
|
|
||||||
{
|
|
||||||
<<<<<<< HEAD
|
|
||||||
var jsFilename = req.params[0];
|
|
||||||
|
|
||||||
//choose the js files we need
|
|
||||||
var jsFiles = undefined;
|
|
||||||
if (Object.prototype.hasOwnProperty.call(tar, jsFilename)) {
|
|
||||||
jsFiles = tar[jsFilename];
|
|
||||||
} else {
|
|
||||||
/* Not in tar list, but try anyways, if it fails, pass to `next`.
|
|
||||||
Actually try, not check in filesystem here because
|
|
||||||
we don't want to duplicate the require.resolve() handling
|
|
||||||
*/
|
|
||||||
jsFiles = [jsFilename];
|
|
||||||
}
|
|
||||||
_handle(req, res, jsFilename, jsFiles, function (err) {
|
|
||||||
console.log("Unable to load minified file " + jsFilename + ": " + err.toString());
|
|
||||||
/* Throw away error and generate a 404, not 500 */
|
|
||||||
next();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function _handle(req, res, jsFilename, jsFiles, next) {
|
|
||||||
res.header("Content-Type","text/javascript");
|
|
||||||
|
|
||||||
var cacheName = CACHE_DIR + "/minified_" + jsFilename.replace(/\//g, "_");
|
|
||||||
|
|
||||||
//minifying is enabled
|
|
||||||
if(settings.minify)
|
|
||||||
{
|
|
||||||
var result = undefined;
|
|
||||||
var latestModification = 0;
|
|
||||||
|
|
||||||
async.series([
|
|
||||||
//find out the highest modification date
|
|
||||||
function(callback)
|
|
||||||
{
|
|
||||||
var folders2check = [CSS_DIR, JS_DIR];
|
|
||||||
|
|
||||||
//go trough this two folders
|
|
||||||
async.forEach(folders2check, function(path, callback)
|
|
||||||
{
|
|
||||||
//read the files in the folder
|
|
||||||
fs.readdir(path, function(err, files)
|
|
||||||
{
|
|
||||||
if(ERR(err, callback)) return;
|
|
||||||
|
|
||||||
//we wanna check the directory itself for changes too
|
|
||||||
files.push(".");
|
|
||||||
|
|
||||||
//go trough all files in this folder
|
|
||||||
async.forEach(files, function(filename, callback)
|
|
||||||
{
|
|
||||||
//get the stat data of this file
|
|
||||||
fs.stat(path + "/" + filename, function(err, stats)
|
|
||||||
{
|
|
||||||
if(ERR(err, callback)) return;
|
|
||||||
|
|
||||||
//get the modification time
|
|
||||||
var modificationTime = stats.mtime.getTime();
|
|
||||||
|
|
||||||
//compare the modification time to the highest found
|
|
||||||
if(modificationTime > latestModification)
|
|
||||||
{
|
|
||||||
latestModification = modificationTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
}, callback);
|
|
||||||
});
|
|
||||||
}, callback);
|
|
||||||
},
|
|
||||||
function(callback)
|
|
||||||
{
|
|
||||||
//check the modification time of the minified js
|
|
||||||
fs.stat(cacheName, function(err, stats)
|
|
||||||
{
|
|
||||||
if(err && err.code != "ENOENT")
|
|
||||||
{
|
|
||||||
ERR(err, callback);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//there is no minfied file or there new changes since this file was generated, so continue generating this file
|
|
||||||
if((err && err.code == "ENOENT") || stats.mtime.getTime() < latestModification)
|
|
||||||
{
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
//the minified file is still up to date, stop minifying
|
|
||||||
else
|
|
||||||
{
|
|
||||||
callback("stop");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//load all js files
|
|
||||||
function (callback)
|
|
||||||
{
|
|
||||||
var values = [];
|
|
||||||
tarCode(
|
|
||||||
jsFiles
|
|
||||||
, function (content) {values.push(content)}
|
|
||||||
, function (err) {
|
|
||||||
if(ERR(err, next)) return;
|
|
||||||
|
|
||||||
result = values.join('');
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//put all together and write it into a file
|
|
||||||
function(callback)
|
|
||||||
{
|
|
||||||
async.parallel([
|
|
||||||
//write the results plain in a file
|
|
||||||
function(callback)
|
|
||||||
{
|
|
||||||
fs.writeFile(cacheName, result, "utf8", callback);
|
|
||||||
},
|
|
||||||
//write the results compressed in a file
|
|
||||||
function(callback)
|
|
||||||
{
|
|
||||||
zlib.gzip(result, function(err, compressedResult){
|
|
||||||
//weird gzip bug that returns 0 instead of null if everything is ok
|
|
||||||
err = err === 0 ? null : err;
|
|
||||||
|
|
||||||
if(ERR(err, callback)) return;
|
|
||||||
|
|
||||||
fs.writeFile(cacheName + ".gz", compressedResult, callback);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
],callback);
|
|
||||||
}
|
|
||||||
], function(err)
|
|
||||||
{
|
|
||||||
if(err && err != "stop")
|
|
||||||
{
|
|
||||||
if(ERR(err)) return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//check if gzip is supported by this browser
|
|
||||||
var gzipSupport = req.header('Accept-Encoding', '').indexOf('gzip') != -1;
|
|
||||||
|
|
||||||
var pathStr;
|
|
||||||
if(gzipSupport && os.type().indexOf("Windows") == -1)
|
|
||||||
{
|
|
||||||
pathStr = path.normalize(cacheName + ".gz");
|
|
||||||
res.header('Content-Encoding', 'gzip');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pathStr = path.normalize(cacheName);
|
|
||||||
}
|
|
||||||
|
|
||||||
res.sendfile(pathStr, { maxAge: server.maxAge });
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//minifying is disabled, so put the files together in one file
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tarCode(
|
|
||||||
jsFiles
|
|
||||||
, function (content) {res.write(content)}
|
|
||||||
, function (err) {
|
|
||||||
if(ERR(err, next)) return;
|
|
||||||
=======
|
|
||||||
var filename = req.params['filename'];
|
|
||||||
|
|
||||||
// No relative paths, especially if they may go up the file hierarchy.
|
|
||||||
filename = path.normalize(path.join(ROOT_DIR, filename));
|
|
||||||
if (filename.indexOf(ROOT_DIR) == 0) {
|
|
||||||
filename = filename.slice(ROOT_DIR.length);
|
|
||||||
filename = filename.replace(/\\/g, '/'); // Windows (safe generally?)
|
|
||||||
} else {
|
|
||||||
res.writeHead(404, {});
|
|
||||||
res.end();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// What content type should this be?
|
|
||||||
// TODO: This should use a MIME module.
|
|
||||||
var contentType;
|
|
||||||
if (filename.match(/\.js$/)) {
|
|
||||||
contentType = "text/javascript";
|
|
||||||
} else if (filename.match(/\.css$/)) {
|
|
||||||
contentType = "text/css";
|
|
||||||
} else if (filename.match(/\.html$/)) {
|
|
||||||
contentType = "text/html";
|
|
||||||
} else if (filename.match(/\.txt$/)) {
|
|
||||||
contentType = "text/plain";
|
|
||||||
} else if (filename.match(/\.png$/)) {
|
|
||||||
contentType = "image/png";
|
|
||||||
} else if (filename.match(/\.gif$/)) {
|
|
||||||
contentType = "image/gif";
|
|
||||||
} else if (filename.match(/\.ico$/)) {
|
|
||||||
contentType = "image/x-icon";
|
|
||||||
} else {
|
|
||||||
contentType = "application/octet-stream";
|
|
||||||
}
|
|
||||||
|
|
||||||
statFile(filename, function (error, date, exists) {
|
|
||||||
if (date) {
|
|
||||||
date = new Date(date);
|
|
||||||
res.setHeader('last-modified', date.toUTCString());
|
|
||||||
res.setHeader('date', (new Date()).toUTCString());
|
|
||||||
if (server.maxAge) {
|
|
||||||
var expiresDate = new Date((new Date()).getTime()+server.maxAge*1000);
|
|
||||||
res.setHeader('expires', expiresDate.toUTCString());
|
|
||||||
res.setHeader('cache-control', 'max-age=' + server.maxAge);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (error) {
|
|
||||||
res.writeHead(500, {});
|
|
||||||
>>>>>>> pita
|
|
||||||
res.end();
|
|
||||||
} else if (!exists) {
|
|
||||||
res.writeHead(404, {});
|
|
||||||
res.end();
|
|
||||||
} else if (new Date(req.headers['if-modified-since']) >= date) {
|
|
||||||
res.writeHead(304, {});
|
|
||||||
res.end();
|
|
||||||
} else {
|
|
||||||
if (req.method == 'HEAD') {
|
|
||||||
res.header("Content-Type", contentType);
|
|
||||||
res.writeHead(200, {});
|
|
||||||
res.end();
|
|
||||||
} else if (req.method == 'GET') {
|
|
||||||
getFileCompressed(filename, contentType, function (error, content) {
|
|
||||||
if(ERR(error)) return;
|
|
||||||
res.header("Content-Type", contentType);
|
|
||||||
res.writeHead(200, {});
|
|
||||||
res.write(content);
|
|
||||||
res.end();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
res.writeHead(405, {'allow': 'HEAD, GET'});
|
|
||||||
res.end();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// find all includes in ace.js and embed them.
|
|
||||||
function getAceFile(callback) {
|
|
||||||
fs.readFile(ROOT_DIR + 'js/ace.js', "utf8", function(err, data) {
|
|
||||||
if(ERR(err, callback)) return;
|
|
||||||
|
|
||||||
// Find all includes in ace.js and embed them
|
|
||||||
var founds = data.match(/\$\$INCLUDE_[a-zA-Z_]+\("[^"]*"\)/gi);
|
|
||||||
if (!settings.minify) {
|
|
||||||
founds = [];
|
|
||||||
}
|
|
||||||
// Always include the require kernel.
|
|
||||||
founds.push('$$INCLUDE_JS("../static/js/require-kernel.js")');
|
|
||||||
|
|
||||||
data += ';\n';
|
|
||||||
data += 'Ace2Editor.EMBEDED = Ace2Editor.EMBEDED || {};\n';
|
|
||||||
|
|
||||||
// Request the contents of the included file on the server-side and write
|
|
||||||
// them into the file.
|
|
||||||
async.forEach(founds, function (item, callback) {
|
|
||||||
var filename = item.match(/"([^"]*)"/)[1];
|
|
||||||
var request = require('request');
|
|
||||||
|
|
||||||
var baseURI = 'http://localhost:' + settings.port
|
|
||||||
|
|
||||||
request(baseURI + path.normalize(path.join('/static/', filename)), function (error, response, body) {
|
|
||||||
if (!error && response.statusCode == 200) {
|
|
||||||
data += 'Ace2Editor.EMBEDED[' + JSON.stringify(filename) + '] = '
|
|
||||||
+ JSON.stringify(body || '') + ';\n';
|
|
||||||
} else {
|
|
||||||
// Silence?
|
|
||||||
}
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
}, function(error) {
|
|
||||||
callback(error, data);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for the existance of the file and get the last modification date.
|
|
||||||
function statFile(filename, callback) {
|
|
||||||
if (filename == 'js/ace.js') {
|
|
||||||
// Sometimes static assets are inlined into this file, so we have to stat
|
|
||||||
// everything.
|
|
||||||
lastModifiedDateOfEverything(function (error, date) {
|
|
||||||
callback(error, date, !error);
|
|
||||||
});
|
|
||||||
} else if (filename == 'js/require-kernel.js') {
|
|
||||||
callback(null, requireLastModified(), true);
|
|
||||||
} else {
|
|
||||||
fs.stat(ROOT_DIR + filename, function (error, stats) {
|
|
||||||
if (error) {
|
|
||||||
if (error.code == "ENOENT") {
|
|
||||||
// Stat the directory instead.
|
|
||||||
fs.stat(path.dirname(ROOT_DIR + filename), function (error, stats) {
|
|
||||||
if (error) {
|
|
||||||
if (error.code == "ENOENT") {
|
|
||||||
callback(null, null, false);
|
|
||||||
} else {
|
|
||||||
callback(error);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
callback(null, stats.mtime.getTime(), false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
callback(error);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
callback(null, stats.mtime.getTime(), true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function lastModifiedDateOfEverything(callback) {
|
|
||||||
var folders2check = [ROOT_DIR + 'js/', ROOT_DIR + 'css/'];
|
|
||||||
var latestModification = 0;
|
|
||||||
//go trough this two folders
|
|
||||||
async.forEach(folders2check, function(path, callback)
|
|
||||||
{
|
|
||||||
//read the files in the folder
|
|
||||||
fs.readdir(path, function(err, files)
|
|
||||||
{
|
|
||||||
if(ERR(err, callback)) return;
|
|
||||||
|
|
||||||
//we wanna check the directory itself for changes too
|
|
||||||
files.push(".");
|
|
||||||
|
|
||||||
//go trough all files in this folder
|
|
||||||
async.forEach(files, function(filename, callback)
|
|
||||||
{
|
|
||||||
//get the stat data of this file
|
|
||||||
fs.stat(path + "/" + filename, function(err, stats)
|
|
||||||
{
|
|
||||||
if(ERR(err, callback)) return;
|
|
||||||
|
|
||||||
//get the modification time
|
|
||||||
var modificationTime = stats.mtime.getTime();
|
|
||||||
|
|
||||||
//compare the modification time to the highest found
|
|
||||||
if(modificationTime > latestModification)
|
|
||||||
{
|
|
||||||
latestModification = modificationTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
}, callback);
|
|
||||||
});
|
|
||||||
}, function () {
|
|
||||||
callback(null, latestModification);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// This should be provided by the module, but until then, just use startup
|
|
||||||
// time.
|
|
||||||
var _requireLastModified = new Date();
|
|
||||||
function requireLastModified() {
|
|
||||||
return _requireLastModified.toUTCString();
|
|
||||||
}
|
|
||||||
function requireDefinition() {
|
|
||||||
return 'var require = ' + RequireKernel.kernelSource + ';\n';
|
|
||||||
}
|
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
function tarCode(jsFiles, write, callback) {
|
|
||||||
write('require.define({');
|
|
||||||
var initialEntry = true;
|
|
||||||
async.forEach(jsFiles, function (filename, callback){
|
|
||||||
var path;
|
|
||||||
var srcPath;
|
|
||||||
if (filename.indexOf('plugins/') == 0) {
|
|
||||||
srcPath = filename.substring('plugins/'.length);
|
|
||||||
path = require.resolve(srcPath);
|
|
||||||
} else {
|
|
||||||
srcPath = '/' + filename;
|
|
||||||
path = JS_DIR + filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
srcPath = JSON.stringify(srcPath);
|
|
||||||
var srcPathAbbv = JSON.stringify(srcPath.replace(/\.js$/, ''));
|
|
||||||
|
|
||||||
if (filename == 'ace.js') {
|
|
||||||
getAceFile(handleFile);
|
|
||||||
} else {
|
|
||||||
fs.readFile(path, "utf8", handleFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleFile(err, data) {
|
|
||||||
if(ERR(err, callback)) return;
|
|
||||||
|
|
||||||
if (!initialEntry) {
|
|
||||||
write('\n,');
|
|
||||||
} else {
|
|
||||||
initialEntry = false;
|
|
||||||
}
|
|
||||||
write(srcPath + ': ')
|
|
||||||
data = '(function (require, exports, module) {' + data + '})';
|
|
||||||
=======
|
|
||||||
function getFileCompressed(filename, contentType, callback) {
|
|
||||||
getFile(filename, function (error, content) {
|
|
||||||
if (error || !content) {
|
|
||||||
callback(error, content);
|
|
||||||
} else {
|
|
||||||
>>>>>>> pita
|
|
||||||
if (settings.minify) {
|
|
||||||
if (contentType == 'text/javascript') {
|
|
||||||
try {
|
|
||||||
content = compressJS([content]);
|
|
||||||
} catch (error) {
|
|
||||||
// silence
|
|
||||||
}
|
|
||||||
} else if (contentType == 'text/css') {
|
|
||||||
content = compressCSS([content]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
callback(null, content);
|
|
||||||
}
|
|
||||||
<<<<<<< HEAD
|
|
||||||
}, function (err) {
|
|
||||||
if(ERR(err, callback)) return;
|
|
||||||
write('});\n');
|
|
||||||
callback();
|
|
||||||
=======
|
|
||||||
>>>>>>> pita
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getFile(filename, callback) {
|
|
||||||
if (filename == 'js/ace.js') {
|
|
||||||
getAceFile(callback);
|
|
||||||
} else if (filename == 'js/require-kernel.js') {
|
|
||||||
callback(undefined, requireDefinition());
|
|
||||||
} else {
|
|
||||||
fs.readFile(ROOT_DIR + filename, callback);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function compressJS(values)
|
|
||||||
{
|
|
||||||
var complete = values.join("\n");
|
|
||||||
var ast = jsp.parse(complete); // parse code and get the initial AST
|
|
||||||
ast = pro.ast_mangle(ast); // get a new AST with mangled names
|
|
||||||
ast = pro.ast_squeeze(ast); // get an AST with compression optimizations
|
|
||||||
return pro.gen_code(ast); // compressed code here
|
|
||||||
}
|
|
||||||
|
|
||||||
function compressCSS(values)
|
|
||||||
{
|
|
||||||
var complete = values.join("\n");
|
|
||||||
return cleanCSS.process(complete);
|
|
||||||
}
|
|
|
@ -44,7 +44,7 @@ exports.dbType = "dirty";
|
||||||
/**
|
/**
|
||||||
* This setting is passed with dbType to ueberDB to set up the database
|
* This setting is passed with dbType to ueberDB to set up the database
|
||||||
*/
|
*/
|
||||||
exports.dbSettings = { "filename" : path.join(exports.root, "var/dirty.db") };
|
exports.dbSettings = { "filename" : path.join(exports.root, "dirty.db") };
|
||||||
/**
|
/**
|
||||||
* The default Text of a new pad
|
* The default Text of a new pad
|
||||||
*/
|
*/
|
||||||
|
@ -106,9 +106,15 @@ if (settingsFilename.charAt(0) != '/') {
|
||||||
settingsFilename = path.normalize(path.join(root, settingsFilename));
|
settingsFilename = path.normalize(path.join(root, settingsFilename));
|
||||||
}
|
}
|
||||||
|
|
||||||
//read the settings sync
|
var settingsStr
|
||||||
var settingsStr = fs.readFileSync(settingsFilename).toString();
|
try{
|
||||||
|
//read the settings sync
|
||||||
|
settingsStr = fs.readFileSync(settingsFilename).toString();
|
||||||
|
} catch(e){
|
||||||
|
console.warn('No settings file found. Using defaults.');
|
||||||
|
settingsStr = '{}';
|
||||||
|
}
|
||||||
|
|
||||||
//remove all comments
|
//remove all comments
|
||||||
settingsStr = settingsStr.replace(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/gm,"").replace(/#.*/g,"").replace(/\/\/.*/g,"");
|
settingsStr = settingsStr.replace(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/gm,"").replace(/#.*/g,"").replace(/\/\/.*/g,"");
|
||||||
|
|
||||||
|
@ -146,3 +152,7 @@ for(var i in settings)
|
||||||
console.warn("This setting doesn't exist or it was removed");
|
console.warn("This setting doesn't exist or it was removed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(exports.dbType === "dirty"){
|
||||||
|
console.warn("DirtyDB is used. This is fine for testing but not recommended for production.")
|
||||||
|
}
|
||||||
|
|
|
@ -73,6 +73,9 @@ CachingMiddleware.prototype = new function () {
|
||||||
var _headers = {};
|
var _headers = {};
|
||||||
old_res.setHeader = res.setHeader;
|
old_res.setHeader = res.setHeader;
|
||||||
res.setHeader = function (key, value) {
|
res.setHeader = function (key, value) {
|
||||||
|
// Don't set cookies, see issue #707
|
||||||
|
if (key.toLowerCase() === 'set-cookie') return;
|
||||||
|
|
||||||
_headers[key.toLowerCase()] = value;
|
_headers[key.toLowerCase()] = value;
|
||||||
old_res.setHeader.call(res, key, value);
|
old_res.setHeader.call(res, key, value);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,13 +1,7 @@
|
||||||
{
|
{
|
||||||
"pad.js": [
|
"pad.js": [
|
||||||
"jquery.js"
|
"pad.js"
|
||||||
, "underscore.js"
|
|
||||||
, "security.js"
|
|
||||||
, "pad.js"
|
|
||||||
, "ace2_common.js"
|
|
||||||
, "pad_utils.js"
|
, "pad_utils.js"
|
||||||
, "undo-xpopup.js"
|
|
||||||
, "json2.js"
|
|
||||||
, "pad_cookie.js"
|
, "pad_cookie.js"
|
||||||
, "pad_editor.js"
|
, "pad_editor.js"
|
||||||
, "pad_editbar.js"
|
, "pad_editbar.js"
|
||||||
|
@ -24,14 +18,9 @@
|
||||||
, "farbtastic.js"
|
, "farbtastic.js"
|
||||||
]
|
]
|
||||||
, "timeslider.js": [
|
, "timeslider.js": [
|
||||||
"jquery.js"
|
"timeslider.js"
|
||||||
, "underscore.js"
|
|
||||||
, "security.js"
|
|
||||||
, "undo-xpopup.js"
|
|
||||||
, "json2.js"
|
|
||||||
, "colorutils.js"
|
, "colorutils.js"
|
||||||
, "draggable.js"
|
, "draggable.js"
|
||||||
, "ace2_common.js"
|
|
||||||
, "pad_utils.js"
|
, "pad_utils.js"
|
||||||
, "pad_cookie.js"
|
, "pad_cookie.js"
|
||||||
, "pad_editor.js"
|
, "pad_editor.js"
|
||||||
|
@ -48,16 +37,12 @@
|
||||||
, "broadcast.js"
|
, "broadcast.js"
|
||||||
, "broadcast_slider.js"
|
, "broadcast_slider.js"
|
||||||
, "broadcast_revisions.js"
|
, "broadcast_revisions.js"
|
||||||
, "timeslider.js"
|
|
||||||
]
|
]
|
||||||
, "ace2_inner.js": [
|
, "ace2_inner.js": [
|
||||||
"ace2_common.js"
|
"ace2_inner.js"
|
||||||
, "underscore.js"
|
|
||||||
, "rjquery.js"
|
|
||||||
, "AttributePool.js"
|
, "AttributePool.js"
|
||||||
, "Changeset.js"
|
, "Changeset.js"
|
||||||
, "ChangesetUtils.js"
|
, "ChangesetUtils.js"
|
||||||
, "security.js"
|
|
||||||
, "skiplist.js"
|
, "skiplist.js"
|
||||||
, "virtual_lines.js"
|
, "virtual_lines.js"
|
||||||
, "cssmanager.js"
|
, "cssmanager.js"
|
||||||
|
@ -68,6 +53,17 @@
|
||||||
, "linestylefilter.js"
|
, "linestylefilter.js"
|
||||||
, "domline.js"
|
, "domline.js"
|
||||||
, "AttributeManager.js"
|
, "AttributeManager.js"
|
||||||
, "ace2_inner.js"
|
]
|
||||||
|
, "ace2_common.js": [
|
||||||
|
"ace2_common.js"
|
||||||
|
, "jquery.js"
|
||||||
|
, "rjquery.js"
|
||||||
|
, "underscore.js"
|
||||||
|
, "security.js"
|
||||||
|
, "json2.js"
|
||||||
|
, "pluginfw/plugins.js"
|
||||||
|
, "pluginfw/hooks.js"
|
||||||
|
, "pluginfw/async.js"
|
||||||
|
, "pluginfw/parent_require.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,11 +10,11 @@
|
||||||
"name": "Robin Buse" }
|
"name": "Robin Buse" }
|
||||||
],
|
],
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"yajsml" : "1.1.2",
|
"yajsml" : "1.1.3",
|
||||||
"request" : "2.9.100",
|
"request" : "2.9.100",
|
||||||
"require-kernel" : "1.0.5",
|
"require-kernel" : "1.0.5",
|
||||||
"resolve" : "0.2.1",
|
"resolve" : "0.2.1",
|
||||||
"socket.io" : "0.8.7",
|
"socket.io" : "0.9.6",
|
||||||
"ueberDB" : "0.1.7",
|
"ueberDB" : "0.1.7",
|
||||||
"async" : "0.1.18",
|
"async" : "0.1.18",
|
||||||
"express" : "2.5.8",
|
"express" : "2.5.8",
|
||||||
|
@ -32,6 +32,7 @@
|
||||||
"semver" : "1.0.13",
|
"semver" : "1.0.13",
|
||||||
"underscore" : "1.3.1"
|
"underscore" : "1.3.1"
|
||||||
},
|
},
|
||||||
|
"bin": { "etherpad-lite": "./node/server.js" },
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jshint" : "*"
|
"jshint" : "*"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
height: 100%;
|
|
||||||
color: #333;
|
color: #333;
|
||||||
font: 14px helvetica, sans-serif;
|
font: 14px helvetica, sans-serif;
|
||||||
background: #ddd;
|
background: #ddd;
|
||||||
|
@ -26,7 +25,7 @@ h1 {
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
.seperator {
|
.separator {
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
background: #aaa;
|
background: #aaa;
|
||||||
|
|
|
@ -5,6 +5,13 @@
|
||||||
html { cursor: text; } /* in Safari, produces text cursor for whole doc (inc. below body) */
|
html { cursor: text; } /* in Safari, produces text cursor for whole doc (inc. below body) */
|
||||||
span { cursor: auto; }
|
span { cursor: auto; }
|
||||||
|
|
||||||
|
::selection {
|
||||||
|
background: #acf;
|
||||||
|
}
|
||||||
|
::-moz-selection {
|
||||||
|
background: #acf;
|
||||||
|
}
|
||||||
|
|
||||||
a { cursor: pointer !important; }
|
a { cursor: pointer !important; }
|
||||||
|
|
||||||
ul, ol, li {
|
ul, ol, li {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -177,19 +177,18 @@ require.setGlobalKeyPath("require");\n\
|
||||||
}
|
}
|
||||||
function pushScriptsTo(buffer) {
|
function pushScriptsTo(buffer) {
|
||||||
/* Folling is for packaging regular expression. */
|
/* Folling is for packaging regular expression. */
|
||||||
/* $$INCLUDE_JS("../javascripts/src/ace2_inner.js?callback=require.define"); */
|
/* $$INCLUDE_JS("../javascripts/lib/ep_etherpad-lite/static/js/ace2_inner.js?callback=require.define"); */
|
||||||
var ACE_SOURCE = '../javascripts/src/ace2_inner.js?callback=require.define';
|
/* $$INCLUDE_JS("../javascripts/lib/ep_etherpad-lite/static/js/ace2_common.js?callback=require.define"); */
|
||||||
|
var ACE_SOURCE = '../javascripts/lib/ep_etherpad-lite/static/js/ace2_inner.js?callback=require.define';
|
||||||
|
var ACE_COMMON = '../javascripts/lib/ep_etherpad-lite/static/js/ace2_common.js?callback=require.define';
|
||||||
if (Ace2Editor.EMBEDED && Ace2Editor.EMBEDED[ACE_SOURCE]) {
|
if (Ace2Editor.EMBEDED && Ace2Editor.EMBEDED[ACE_SOURCE]) {
|
||||||
buffer.push('<script type="text/javascript">');
|
buffer.push('<script type="text/javascript">');
|
||||||
buffer.push(Ace2Editor.EMBEDED[ACE_SOURCE]);
|
buffer.push(Ace2Editor.EMBEDED[ACE_SOURCE]);
|
||||||
buffer.push('require("ep_etherpad-lite/static/js/ace2_inner");');
|
buffer.push(Ace2Editor.EMBEDED[ACE_COMMON]);
|
||||||
buffer.push('<\/script>');
|
buffer.push('<\/script>');
|
||||||
} else {
|
} else {
|
||||||
file = ACE_SOURCE;
|
|
||||||
buffer.push('<script type="application/javascript" src="' + ACE_SOURCE + '"><\/script>');
|
buffer.push('<script type="application/javascript" src="' + ACE_SOURCE + '"><\/script>');
|
||||||
buffer.push('<script type="text/javascript">');
|
buffer.push('<script type="application/javascript" src="' + ACE_COMMON + '"><\/script>');
|
||||||
buffer.push('require("ep_etherpad-lite/static/js/ace2_inner");');
|
|
||||||
buffer.push('<\/script>');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function pushStyleTagsFor(buffer, files) {
|
function pushStyleTagsFor(buffer, files) {
|
||||||
|
@ -239,20 +238,11 @@ require.setGlobalKeyPath("require");\n\
|
||||||
|
|
||||||
iframeHTML.push(doctype);
|
iframeHTML.push(doctype);
|
||||||
iframeHTML.push("<html><head>");
|
iframeHTML.push("<html><head>");
|
||||||
iframeHTML.push('<script type="text/javascript" src="../static/js/jquery.js"></script>');
|
|
||||||
|
|
||||||
hooks.callAll("aceInitInnerdocbodyHead", {
|
hooks.callAll("aceInitInnerdocbodyHead", {
|
||||||
iframeHTML: iframeHTML
|
iframeHTML: iframeHTML
|
||||||
});
|
});
|
||||||
|
|
||||||
// For compatability's sake transform in and out.
|
|
||||||
for (var i = 0, ii = iframeHTML.length; i < ii; i++) {
|
|
||||||
iframeHTML[i] = JSON.stringify(iframeHTML[i]);
|
|
||||||
}
|
|
||||||
for (var i = 0, ii = iframeHTML.length; i < ii; i++) {
|
|
||||||
iframeHTML[i] = JSON.parse(iframeHTML[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// calls to these functions ($$INCLUDE_...) are replaced when this file is processed
|
// calls to these functions ($$INCLUDE_...) are replaced when this file is processed
|
||||||
// and compressed, putting the compressed code from the named file directly into the
|
// and compressed, putting the compressed code from the named file directly into the
|
||||||
// source here.
|
// source here.
|
||||||
|
@ -269,23 +259,22 @@ require.setGlobalKeyPath("require");\n\
|
||||||
pushStyleTagsFor(iframeHTML, includedCSS);
|
pushStyleTagsFor(iframeHTML, includedCSS);
|
||||||
|
|
||||||
var includedJS = [];
|
var includedJS = [];
|
||||||
var $$INCLUDE_JS = function(filename) {includedJS.push(filename)};
|
|
||||||
pushRequireScriptTo(iframeHTML);
|
pushRequireScriptTo(iframeHTML);
|
||||||
|
pushScriptsTo(iframeHTML);
|
||||||
|
|
||||||
// Inject my plugins into my child.
|
// Inject my plugins into my child.
|
||||||
iframeHTML.push('\
|
iframeHTML.push('\
|
||||||
<script type="text/javascript">\
|
<script type="text/javascript">\
|
||||||
parent_req = require("./pluginfw/parent_require.js");\
|
parent_req = require("ep_etherpad-lite/static/js/pluginfw/parent_require");\
|
||||||
parent_req.getRequirementFromParent(require, "ep_etherpad-lite/static/js/pluginfw/hooks");\
|
parent_req.getRequirementFromParent(require, "ep_etherpad-lite/static/js/pluginfw/hooks");\
|
||||||
parent_req.getRequirementFromParent(require, "ep_etherpad-lite/static/js/pluginfw/plugins");\
|
parent_req.getRequirementFromParent(require, "ep_etherpad-lite/static/js/pluginfw/plugins");\
|
||||||
parent_req.getRequirementFromParent(require, "./pluginfw/hooks");\
|
|
||||||
parent_req.getRequirementFromParent(require, "./pluginfw/plugins");\
|
|
||||||
require.define("/plugins", null);\n\
|
|
||||||
require.define("/plugins.js", function (require, exports, module) {\
|
|
||||||
module.exports = require("ep_etherpad-lite/static/js/plugins");\
|
|
||||||
});\
|
|
||||||
</script>\
|
</script>\
|
||||||
');
|
');
|
||||||
pushScriptsTo(iframeHTML);
|
|
||||||
|
iframeHTML.push('<script type="text/javascript">');
|
||||||
|
iframeHTML.push('$ = jQuery = require("ep_etherpad-lite/static/js/rjquery").jQuery; // Expose jQuery #HACK');
|
||||||
|
iframeHTML.push('require("ep_etherpad-lite/static/js/ace2_inner");');
|
||||||
|
iframeHTML.push('<\/script>');
|
||||||
|
|
||||||
iframeHTML.push('<style type="text/css" title="dynamicsyntax"></style>');
|
iframeHTML.push('<style type="text/css" title="dynamicsyntax"></style>');
|
||||||
iframeHTML.push('</head><body id="innerdocbody" class="syntax" spellcheck="false"> </body></html>');
|
iframeHTML.push('</head><body id="innerdocbody" class="syntax" spellcheck="false"> </body></html>');
|
||||||
|
|
|
@ -166,12 +166,10 @@ function Ace2Inner(){
|
||||||
}
|
}
|
||||||
|
|
||||||
var dynamicCSS = null;
|
var dynamicCSS = null;
|
||||||
var dynamicCSSTop = null;
|
|
||||||
|
|
||||||
function initDynamicCSS()
|
function initDynamicCSS()
|
||||||
{
|
{
|
||||||
dynamicCSS = makeCSSManager("dynamicsyntax");
|
dynamicCSS = makeCSSManager("dynamicsyntax");
|
||||||
dynamicCSSTop = makeCSSManager("dynamicsyntax", true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var changesetTracker = makeChangesetTracker(scheduler, rep.apool, {
|
var changesetTracker = makeChangesetTracker(scheduler, rep.apool, {
|
||||||
|
@ -214,7 +212,6 @@ function Ace2Inner(){
|
||||||
if (dynamicCSS)
|
if (dynamicCSS)
|
||||||
{
|
{
|
||||||
dynamicCSS.removeSelectorStyle(getAuthorColorClassSelector(getAuthorClassName(author)));
|
dynamicCSS.removeSelectorStyle(getAuthorColorClassSelector(getAuthorClassName(author)));
|
||||||
dynamicCSSTop.removeSelectorStyle(getAuthorColorClassSelector(getAuthorClassName(author)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -232,23 +229,18 @@ function Ace2Inner(){
|
||||||
|
|
||||||
var authorStyle = dynamicCSS.selectorStyle(getAuthorColorClassSelector(
|
var authorStyle = dynamicCSS.selectorStyle(getAuthorColorClassSelector(
|
||||||
getAuthorClassName(author)));
|
getAuthorClassName(author)));
|
||||||
var authorStyleTop = dynamicCSSTop.selectorStyle(getAuthorColorClassSelector(
|
|
||||||
getAuthorClassName(author)));
|
|
||||||
var anchorStyle = dynamicCSS.selectorStyle(getAuthorColorClassSelector(
|
var anchorStyle = dynamicCSS.selectorStyle(getAuthorColorClassSelector(
|
||||||
getAuthorClassName(author))+' > a')
|
getAuthorClassName(author))+' > a')
|
||||||
|
|
||||||
// author color
|
// author color
|
||||||
authorStyle.backgroundColor = bgcolor;
|
authorStyle.backgroundColor = bgcolor;
|
||||||
authorStyleTop.backgroundColor = bgcolor;
|
|
||||||
|
|
||||||
// text contrast
|
// text contrast
|
||||||
if(colorutils.luminosity(colorutils.css2triple(bgcolor)) < 0.5)
|
if(colorutils.luminosity(colorutils.css2triple(bgcolor)) < 0.5)
|
||||||
{
|
{
|
||||||
authorStyle.color = '#ffffff';
|
authorStyle.color = '#ffffff';
|
||||||
authorStyleTop.color = '#ffffff';
|
|
||||||
}else{
|
}else{
|
||||||
authorStyle.color = null;
|
authorStyle.color = null;
|
||||||
authorStyleTop.color = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// anchor text contrast
|
// anchor text contrast
|
||||||
|
@ -3749,24 +3741,6 @@ function Ace2Inner(){
|
||||||
setSelection(selection);
|
setSelection(selection);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRepHTML()
|
|
||||||
{
|
|
||||||
return _.map(rep.lines.slice(), function(entry)
|
|
||||||
{
|
|
||||||
var text = entry.text;
|
|
||||||
var content;
|
|
||||||
if (text.length === 0)
|
|
||||||
{
|
|
||||||
content = '<span style="color: #aaa">--</span>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
content = htmlPrettyEscape(text);
|
|
||||||
}
|
|
||||||
return '<div><code>' + content + '</div></code>';
|
|
||||||
}).join('');
|
|
||||||
}
|
|
||||||
|
|
||||||
function nodeMaxIndex(nd)
|
function nodeMaxIndex(nd)
|
||||||
{
|
{
|
||||||
if (isNodeText(nd)) return nd.nodeValue.length;
|
if (isNodeText(nd)) return nd.nodeValue.length;
|
||||||
|
|
|
@ -1,5 +1,16 @@
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
var socket = io.connect().of("/pluginfw/installer");
|
|
||||||
|
var socket,
|
||||||
|
loc = document.location,
|
||||||
|
port = loc.port == "" ? (loc.protocol == "https:" ? 443 : 80) : loc.port,
|
||||||
|
url = loc.protocol + "//" + loc.hostname + ":" + port + "/",
|
||||||
|
pathComponents = location.pathname.split('/'),
|
||||||
|
// Strip admin/plugins
|
||||||
|
baseURL = pathComponents.slice(0,pathComponents.length-2).join('/') + '/',
|
||||||
|
resource = baseURL.substring(1) + "socket.io";
|
||||||
|
|
||||||
|
//connect
|
||||||
|
socket = io.connect(url, {resource : resource}).of("/pluginfw/installer");
|
||||||
|
|
||||||
$('.search-results').data('query', {
|
$('.search-results').data('query', {
|
||||||
pattern: '',
|
pattern: '',
|
||||||
|
|
|
@ -189,95 +189,15 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
|
||||||
|
|
||||||
function setUpSocket()
|
function setUpSocket()
|
||||||
{
|
{
|
||||||
//oldSocketId = String(Math.floor(Math.random()*1e12));
|
|
||||||
//socketId = String(Math.floor(Math.random()*1e12));
|
|
||||||
/*socket = new io.Socket();
|
|
||||||
socket.connect();*/
|
|
||||||
|
|
||||||
//socket.on('connect', function(){
|
|
||||||
hiccupCount = 0;
|
hiccupCount = 0;
|
||||||
setChannelState("CONNECTED");
|
setChannelState("CONNECTED");
|
||||||
/*var msg = { type:"CLIENT_READY", roomType:'padpage',
|
|
||||||
roomName:'padpage/'+globalPadId,
|
|
||||||
data: {
|
|
||||||
lastRev:rev,
|
|
||||||
userInfo:userSet[userId],
|
|
||||||
stats: getStats() } };
|
|
||||||
if (oldSocketId) {
|
|
||||||
msg.data.isReconnectOf = oldSocketId;
|
|
||||||
msg.data.isCommitPending = (state == "COMMITTING");
|
|
||||||
}
|
|
||||||
sendMessage(msg);*/
|
|
||||||
doDeferredActions();
|
doDeferredActions();
|
||||||
|
|
||||||
initialStartConnectTime = +new Date();
|
initialStartConnectTime = +new Date();
|
||||||
// });
|
|
||||||
/*socket.on('message', function(obj){
|
|
||||||
if(window.console)
|
|
||||||
console.log(obj);
|
|
||||||
handleMessageFromServer(obj);
|
|
||||||
});*/
|
|
||||||
|
|
||||||
/*var success = false;
|
|
||||||
callCatchingErrors("setUpSocket", function() {
|
|
||||||
appLevelDisconnectReason = null;
|
|
||||||
|
|
||||||
var oldSocketId = socketId;
|
|
||||||
socketId = String(Math.floor(Math.random()*1e12));
|
|
||||||
socket = new WebSocket(socketId);
|
|
||||||
socket.onmessage = wrapRecordingErrors("socket.onmessage", handleMessageFromServer);
|
|
||||||
socket.onclosed = wrapRecordingErrors("socket.onclosed", handleSocketClosed);
|
|
||||||
socket.onopen = wrapRecordingErrors("socket.onopen", function() {
|
|
||||||
hiccupCount = 0;
|
|
||||||
setChannelState("CONNECTED");
|
|
||||||
var msg = { type:"CLIENT_READY", roomType:'padpage',
|
|
||||||
roomName:'padpage/'+globalPadId,
|
|
||||||
data: {
|
|
||||||
lastRev:rev,
|
|
||||||
userInfo:userSet[userId],
|
|
||||||
stats: getStats() } };
|
|
||||||
if (oldSocketId) {
|
|
||||||
msg.data.isReconnectOf = oldSocketId;
|
|
||||||
msg.data.isCommitPending = (state == "COMMITTING");
|
|
||||||
}
|
|
||||||
sendMessage(msg);
|
|
||||||
doDeferredActions();
|
|
||||||
});
|
|
||||||
socket.onhiccup = wrapRecordingErrors("socket.onhiccup", handleCometHiccup);
|
|
||||||
socket.onlogmessage = dmesg;
|
|
||||||
socket.connect();
|
|
||||||
success = true;
|
|
||||||
});
|
|
||||||
if (success) {
|
|
||||||
initialStartConnectTime = +new Date();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
abandonConnection("initsocketfail");
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var hiccupCount = 0;
|
var hiccupCount = 0;
|
||||||
|
|
||||||
function handleCometHiccup(params)
|
|
||||||
{
|
|
||||||
dmesg("HICCUP (connected:" + ( !! params.connected) + ")");
|
|
||||||
var connectedNow = params.connected;
|
|
||||||
if (!connectedNow)
|
|
||||||
{
|
|
||||||
hiccupCount++;
|
|
||||||
// skip first "cut off from server" notification
|
|
||||||
if (hiccupCount > 1)
|
|
||||||
{
|
|
||||||
setChannelState("RECONNECTING");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
hiccupCount = 0;
|
|
||||||
setChannelState("CONNECTED");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function sendMessage(msg)
|
function sendMessage(msg)
|
||||||
{
|
{
|
||||||
getSocket().json.send(
|
getSocket().json.send(
|
||||||
|
@ -382,13 +302,11 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
|
||||||
{
|
{
|
||||||
userSet[id] = userInfo;
|
userSet[id] = userInfo;
|
||||||
callbacks.onUpdateUserInfo(userInfo);
|
callbacks.onUpdateUserInfo(userInfo);
|
||||||
dmesgUsers();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
userSet[id] = userInfo;
|
userSet[id] = userInfo;
|
||||||
callbacks.onUserJoin(userInfo);
|
callbacks.onUserJoin(userInfo);
|
||||||
dmesgUsers();
|
|
||||||
}
|
}
|
||||||
tellAceActiveAuthorInfo(userInfo);
|
tellAceActiveAuthorInfo(userInfo);
|
||||||
}
|
}
|
||||||
|
@ -401,7 +319,6 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
|
||||||
delete userSet[userInfo.userId];
|
delete userSet[userInfo.userId];
|
||||||
fadeAceAuthorInfo(userInfo);
|
fadeAceAuthorInfo(userInfo);
|
||||||
callbacks.onUserLeave(userInfo);
|
callbacks.onUserLeave(userInfo);
|
||||||
dmesgUsers();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (msg.type == "DISCONNECT_REASON")
|
else if (msg.type == "DISCONNECT_REASON")
|
||||||
|
@ -485,11 +402,6 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function dmesgUsers()
|
|
||||||
{
|
|
||||||
//pad.dmesg($.map(getConnectedUsers(), function(u) { return u.userId.slice(-2); }).join(','));
|
|
||||||
}
|
|
||||||
|
|
||||||
function setChannelState(newChannelState, moreInfo)
|
function setChannelState(newChannelState, moreInfo)
|
||||||
{
|
{
|
||||||
if (newChannelState != channelState)
|
if (newChannelState != channelState)
|
||||||
|
@ -678,29 +590,4 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectElementContents(elem)
|
|
||||||
{
|
|
||||||
if ($.browser.msie)
|
|
||||||
{
|
|
||||||
var range = document.body.createTextRange();
|
|
||||||
range.moveToElementText(elem);
|
|
||||||
range.select();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (window.getSelection)
|
|
||||||
{
|
|
||||||
var browserSelection = window.getSelection();
|
|
||||||
if (browserSelection)
|
|
||||||
{
|
|
||||||
var range = document.createRange();
|
|
||||||
range.selectNodeContents(elem);
|
|
||||||
browserSelection.removeAllRanges();
|
|
||||||
browserSelection.addRange(range);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.getCollabClient = getCollabClient;
|
exports.getCollabClient = getCollabClient;
|
||||||
exports.selectElementContents = selectElementContents;
|
|
||||||
|
|
|
@ -20,15 +20,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function makeCSSManager(emptyStylesheetTitle, top)
|
function makeCSSManager(emptyStylesheetTitle)
|
||||||
{
|
{
|
||||||
|
|
||||||
function getSheetByTitle(title, top)
|
function getSheetByTitle(title)
|
||||||
{
|
{
|
||||||
if(top)
|
var allSheets = document.styleSheets;
|
||||||
var allSheets = window.parent.parent.document.styleSheets;
|
|
||||||
else
|
|
||||||
var allSheets = document.styleSheets;
|
|
||||||
|
|
||||||
for (var i = 0; i < allSheets.length; i++)
|
for (var i = 0; i < allSheets.length; i++)
|
||||||
{
|
{
|
||||||
|
@ -40,21 +37,8 @@ function makeCSSManager(emptyStylesheetTitle, top)
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*function getSheetTagByTitle(title) {
|
var browserSheet = getSheetByTitle(emptyStylesheetTitle);
|
||||||
var allStyleTags = document.getElementsByTagName("style");
|
|
||||||
for(var i=0;i<allStyleTags.length;i++) {
|
|
||||||
var t = allStyleTags[i];
|
|
||||||
if (t.title == title) {
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
var browserSheet = getSheetByTitle(emptyStylesheetTitle, top);
|
|
||||||
//var browserTag = getSheetTagByTitle(emptyStylesheetTitle);
|
|
||||||
|
|
||||||
|
|
||||||
function browserRules()
|
function browserRules()
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,6 @@ require('./jquery');
|
||||||
require('./farbtastic');
|
require('./farbtastic');
|
||||||
require('./excanvas');
|
require('./excanvas');
|
||||||
JSON = require('./json2');
|
JSON = require('./json2');
|
||||||
require('./undo-xpopup');
|
|
||||||
|
|
||||||
var chat = require('./chat').chat;
|
var chat = require('./chat').chat;
|
||||||
var getCollabClient = require('./collab_client').getCollabClient;
|
var getCollabClient = require('./collab_client').getCollabClient;
|
||||||
|
@ -102,7 +101,6 @@ function getParams()
|
||||||
var showLineNumbers = params["showLineNumbers"];
|
var showLineNumbers = params["showLineNumbers"];
|
||||||
var useMonospaceFont = params["useMonospaceFont"];
|
var useMonospaceFont = params["useMonospaceFont"];
|
||||||
var IsnoColors = params["noColors"];
|
var IsnoColors = params["noColors"];
|
||||||
var hideQRCode = params["hideQRCode"];
|
|
||||||
var rtl = params["rtl"];
|
var rtl = params["rtl"];
|
||||||
var alwaysShowChat = params["alwaysShowChat"];
|
var alwaysShowChat = params["alwaysShowChat"];
|
||||||
|
|
||||||
|
@ -148,10 +146,6 @@ function getParams()
|
||||||
// If the username is set as a parameter we should set a global value that we can call once we have initiated the pad.
|
// If the username is set as a parameter we should set a global value that we can call once we have initiated the pad.
|
||||||
settings.globalUserName = decodeURIComponent(userName);
|
settings.globalUserName = decodeURIComponent(userName);
|
||||||
}
|
}
|
||||||
if(hideQRCode)
|
|
||||||
{
|
|
||||||
$('#qrcode').hide();
|
|
||||||
}
|
|
||||||
if(rtl)
|
if(rtl)
|
||||||
{
|
{
|
||||||
if(rtl == "true")
|
if(rtl == "true")
|
||||||
|
@ -203,8 +197,7 @@ function handshake()
|
||||||
//create the url
|
//create the url
|
||||||
var url = loc.protocol + "//" + loc.hostname + ":" + port + "/";
|
var url = loc.protocol + "//" + loc.hostname + ":" + port + "/";
|
||||||
//find out in which subfolder we are
|
//find out in which subfolder we are
|
||||||
var resource = exports.baseURL + "socket.io";
|
var resource = exports.baseURL.substring(1) + "socket.io";
|
||||||
|
|
||||||
//connect
|
//connect
|
||||||
socket = pad.socket = io.connect(url, {
|
socket = pad.socket = io.connect(url, {
|
||||||
resource: resource,
|
resource: resource,
|
||||||
|
@ -697,13 +690,6 @@ var pad = {
|
||||||
paduserlist.removeGuestPrompt(msg.guestId);
|
paduserlist.removeGuestPrompt(msg.guestId);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
editbarClick: function(cmd)
|
|
||||||
{
|
|
||||||
if (padeditbar)
|
|
||||||
{
|
|
||||||
padeditbar.toolbarClick(cmd);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
dmesg: function(m)
|
dmesg: function(m)
|
||||||
{
|
{
|
||||||
if (pad.getIsDebugEnabled())
|
if (pad.getIsDebugEnabled())
|
||||||
|
@ -1033,7 +1019,6 @@ var settings = {
|
||||||
, noColors: false
|
, noColors: false
|
||||||
, useMonospaceFontGlobal: false
|
, useMonospaceFontGlobal: false
|
||||||
, globalUserName: false
|
, globalUserName: false
|
||||||
, hideQRCode: false
|
|
||||||
, rtlIsTrue: false
|
, rtlIsTrue: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -97,8 +97,15 @@ var padeditbar = (function()
|
||||||
var self = {
|
var self = {
|
||||||
init: function()
|
init: function()
|
||||||
{
|
{
|
||||||
|
var self = this;
|
||||||
$("#editbar .editbarbutton").attr("unselectable", "on"); // for IE
|
$("#editbar .editbarbutton").attr("unselectable", "on"); // for IE
|
||||||
$("#editbar").removeClass("disabledtoolbar").addClass("enabledtoolbar");
|
$("#editbar").removeClass("disabledtoolbar").addClass("enabledtoolbar");
|
||||||
|
$("#editbar [data-key]").each(function (i, e) {
|
||||||
|
$(e).click(function (event) {
|
||||||
|
self.toolbarClick($(e).attr('data-key'));
|
||||||
|
event.preventDefault();
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
isEnabled: function()
|
isEnabled: function()
|
||||||
{
|
{
|
||||||
|
@ -119,7 +126,7 @@ var padeditbar = (function()
|
||||||
}
|
}
|
||||||
else if (cmd == 'settings')
|
else if (cmd == 'settings')
|
||||||
{
|
{
|
||||||
self.toogleDropDown("settingsmenu");
|
self.toogleDropDown("settings");
|
||||||
}
|
}
|
||||||
else if (cmd == 'embed')
|
else if (cmd == 'embed')
|
||||||
{
|
{
|
||||||
|
@ -177,12 +184,11 @@ var padeditbar = (function()
|
||||||
},
|
},
|
||||||
toogleDropDown: function(moduleName)
|
toogleDropDown: function(moduleName)
|
||||||
{
|
{
|
||||||
var modules = ["settingsmenu", "importexport", "embed", "users"];
|
var modules = ["settings", "importexport", "embed", "users"];
|
||||||
|
|
||||||
//hide all modules
|
// hide all modules and remove highlighting of all buttons
|
||||||
if(moduleName == "none")
|
if(moduleName == "none")
|
||||||
{
|
{
|
||||||
$(".toolbar ul.menu_right li").removeClass("selected");
|
|
||||||
for(var i=0;i<modules.length;i++)
|
for(var i=0;i<modules.length;i++)
|
||||||
{
|
{
|
||||||
//skip the userlist
|
//skip the userlist
|
||||||
|
@ -193,29 +199,27 @@ var padeditbar = (function()
|
||||||
|
|
||||||
if(module.css('display') != "none")
|
if(module.css('display') != "none")
|
||||||
{
|
{
|
||||||
|
$("#" + modules[i] + "link").removeClass("selected");
|
||||||
module.slideUp("fast");
|
module.slideUp("fast");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var nth_child = indexOf(modules, moduleName) + 1;
|
// hide all modules that are not selected and remove highlighting
|
||||||
if (nth_child > 0 && nth_child <= (modules.length-1)) {
|
// respectively add highlighting to the corresponding button
|
||||||
$(".toolbar ul.menu_right li:not(:nth-child(" + nth_child + "))").removeClass("selected");
|
|
||||||
$(".toolbar ul.menu_right li:nth-child(" + nth_child + ")").toggleClass("selected");
|
|
||||||
}
|
|
||||||
if(modules[modules.length-1] === moduleName) $(".toolbar ul.menu_right li").removeClass("selected");
|
|
||||||
//hide all modules that are not selected and show the selected one
|
|
||||||
for(var i=0;i<modules.length;i++)
|
for(var i=0;i<modules.length;i++)
|
||||||
{
|
{
|
||||||
var module = $("#" + modules[i]);
|
var module = $("#" + modules[i]);
|
||||||
|
|
||||||
if(module.css('display') != "none")
|
if(module.css('display') != "none")
|
||||||
{
|
{
|
||||||
|
$("#" + modules[i] + "link").removeClass("selected");
|
||||||
module.slideUp("fast");
|
module.slideUp("fast");
|
||||||
}
|
}
|
||||||
else if(modules[i]==moduleName)
|
else if(modules[i]==moduleName)
|
||||||
{
|
{
|
||||||
|
$("#" + modules[i] + "link").addClass("selected");
|
||||||
module.slideDown("fast");
|
module.slideDown("fast");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,14 +244,12 @@ var padeditbar = (function()
|
||||||
var readonlyLink = basePath + "/p/" + clientVars.readOnlyId;
|
var readonlyLink = basePath + "/p/" + clientVars.readOnlyId;
|
||||||
$('#embedinput').val("<iframe name='embed_readonly' src='" + readonlyLink + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>");
|
$('#embedinput').val("<iframe name='embed_readonly' src='" + readonlyLink + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>");
|
||||||
$('#linkinput').val(readonlyLink);
|
$('#linkinput').val(readonlyLink);
|
||||||
$('#embedreadonlyqr').attr("src","https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=|0&chl=" + readonlyLink);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var padurl = window.location.href.split("?")[0];
|
var padurl = window.location.href.split("?")[0];
|
||||||
$('#embedinput').val("<iframe name='embed_readwrite' src='" + padurl + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>");
|
$('#embedinput').val("<iframe name='embed_readwrite' src='" + padurl + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>");
|
||||||
$('#linkinput').val(padurl);
|
$('#linkinput').val(padurl);
|
||||||
$('#embedreadonlyqr').attr("src","https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=|0&chl=" + padurl);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -58,7 +58,6 @@ var padeditor = (function()
|
||||||
self.setViewOptions(initialViewOptions);
|
self.setViewOptions(initialViewOptions);
|
||||||
|
|
||||||
// view bar
|
// view bar
|
||||||
self.initViewZoom();
|
|
||||||
$("#viewbarcontents").show();
|
$("#viewbarcontents").show();
|
||||||
},
|
},
|
||||||
initViewOptions: function()
|
initViewOptions: function()
|
||||||
|
@ -98,43 +97,14 @@ var padeditor = (function()
|
||||||
v = getOption('showAuthorColors', true);
|
v = getOption('showAuthorColors', true);
|
||||||
self.ace.setProperty("showsauthorcolors", v);
|
self.ace.setProperty("showsauthorcolors", v);
|
||||||
padutils.setCheckbox($("#options-colorscheck"), v);
|
padutils.setCheckbox($("#options-colorscheck"), v);
|
||||||
// Override from parameters
|
// Override from parameters if true
|
||||||
self.ace.setProperty("showsauthorcolors", !settings.noColors);
|
if (settings.noColors !== false)
|
||||||
|
self.ace.setProperty("showsauthorcolors", !settings.noColors);
|
||||||
|
|
||||||
v = getOption('useMonospaceFont', false);
|
v = getOption('useMonospaceFont', false);
|
||||||
self.ace.setProperty("textface", (v ? "monospace" : "Arial, sans-serif"));
|
self.ace.setProperty("textface", (v ? "monospace" : "Arial, sans-serif"));
|
||||||
$("#viewfontmenu").val(v ? "monospace" : "normal");
|
$("#viewfontmenu").val(v ? "monospace" : "normal");
|
||||||
},
|
},
|
||||||
initViewZoom: function()
|
|
||||||
{
|
|
||||||
var viewZoom = Number(padcookie.getPref('viewZoom'));
|
|
||||||
if ((!viewZoom) || isNaN(viewZoom))
|
|
||||||
{
|
|
||||||
viewZoom = 100;
|
|
||||||
}
|
|
||||||
self.setViewZoom(viewZoom);
|
|
||||||
$("#viewzoommenu").change(function(evt)
|
|
||||||
{
|
|
||||||
// strip initial 'z' from val
|
|
||||||
self.setViewZoom(Number($("#viewzoommenu").val().substring(1)));
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setViewZoom: function(percent)
|
|
||||||
{
|
|
||||||
if (!(percent >= 50 && percent <= 1000))
|
|
||||||
{
|
|
||||||
// percent is out of sane range or NaN (which fails comparisons)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
self.viewZoom = percent;
|
|
||||||
$("#viewzoommenu").val('z' + percent);
|
|
||||||
|
|
||||||
var baseSize = 13;
|
|
||||||
self.ace.setProperty('textsize', Math.round(baseSize * self.viewZoom / 100));
|
|
||||||
|
|
||||||
padcookie.setPref('viewZoom', percent);
|
|
||||||
},
|
|
||||||
dispose: function()
|
dispose: function()
|
||||||
{
|
{
|
||||||
if (self.ace)
|
if (self.ace)
|
||||||
|
|
|
@ -217,7 +217,6 @@ var padimpexp = (function()
|
||||||
// build the export links
|
// build the export links
|
||||||
$("#exporthtmla").attr("href", pad_root_path + "/export/html");
|
$("#exporthtmla").attr("href", pad_root_path + "/export/html");
|
||||||
$("#exportplaina").attr("href", pad_root_path + "/export/txt");
|
$("#exportplaina").attr("href", pad_root_path + "/export/txt");
|
||||||
$("#exportwordlea").attr("href", pad_root_path + "/export/wordle");
|
|
||||||
$("#exportdokuwikia").attr("href", pad_root_path + "/export/dokuwiki");
|
$("#exportdokuwikia").attr("href", pad_root_path + "/export/dokuwiki");
|
||||||
|
|
||||||
//hide stuff thats not avaible if abiword is disabled
|
//hide stuff thats not avaible if abiword is disabled
|
||||||
|
@ -280,17 +279,6 @@ var padimpexp = (function()
|
||||||
$("#impexp-disabled-clickcatcher").hide();
|
$("#impexp-disabled-clickcatcher").hide();
|
||||||
$("#import").css('opacity', 1);
|
$("#import").css('opacity', 1);
|
||||||
$("#impexp-export").css('opacity', 1);
|
$("#impexp-export").css('opacity', 1);
|
||||||
},
|
|
||||||
export2Wordle: function()
|
|
||||||
{
|
|
||||||
var padUrl = $('#exportwordlea').attr('href').replace(/\/wordle$/, '/txt')
|
|
||||||
|
|
||||||
$.get(padUrl, function(data)
|
|
||||||
{
|
|
||||||
$('.result').html(data);
|
|
||||||
$('#text').html(data);
|
|
||||||
$('#wordlepost').submit();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return self;
|
return self;
|
||||||
|
|
|
@ -19,166 +19,16 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var padutils = require('./pad_utils').padutils;
|
var padutils = require('./pad_utils').padutils;
|
||||||
var paddocbar = require('./pad_docbar').paddocbar;
|
|
||||||
|
|
||||||
var padmodals = (function()
|
var padmodals = (function()
|
||||||
{
|
{
|
||||||
|
|
||||||
/*var clearFeedbackEmail = function() {};
|
|
||||||
function clearFeedback() {
|
|
||||||
clearFeedbackEmail();
|
|
||||||
$("#feedbackbox-message").val('');
|
|
||||||
}
|
|
||||||
|
|
||||||
var sendingFeedback = false;
|
|
||||||
function setSendingFeedback(v) {
|
|
||||||
v = !! v;
|
|
||||||
if (sendingFeedback != v) {
|
|
||||||
sendingFeedback = v;
|
|
||||||
if (v) {
|
|
||||||
$("#feedbackbox-send").css('opacity', 0.75);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$("#feedbackbox-send").css('opacity', 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
var sendingInvite = false;
|
|
||||||
|
|
||||||
function setSendingInvite(v)
|
|
||||||
{
|
|
||||||
v = !! v;
|
|
||||||
if (sendingInvite != v)
|
|
||||||
{
|
|
||||||
sendingInvite = v;
|
|
||||||
if (v)
|
|
||||||
{
|
|
||||||
$(".sharebox-send").css('opacity', 0.75);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$("#sharebox-send").css('opacity', 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var clearShareBoxTo = function()
|
|
||||||
{};
|
|
||||||
|
|
||||||
function clearShareBox()
|
|
||||||
{
|
|
||||||
clearShareBoxTo();
|
|
||||||
}
|
|
||||||
|
|
||||||
var pad = undefined;
|
var pad = undefined;
|
||||||
var self = {
|
var self = {
|
||||||
init: function(_pad)
|
init: function(_pad)
|
||||||
{
|
{
|
||||||
pad = _pad;
|
pad = _pad;
|
||||||
|
|
||||||
self.initFeedback();
|
|
||||||
self.initShareBox();
|
|
||||||
},
|
|
||||||
initFeedback: function()
|
|
||||||
{
|
|
||||||
/*var emailField = $("#feedbackbox-email");
|
|
||||||
clearFeedbackEmail =
|
|
||||||
padutils.makeFieldLabeledWhenEmpty(emailField, '(your email address)').clear;
|
|
||||||
clearFeedback();*/
|
|
||||||
|
|
||||||
$("#feedbackbox-hide").click(function()
|
|
||||||
{
|
|
||||||
self.hideModal();
|
|
||||||
});
|
|
||||||
/*$("#feedbackbox-send").click(function() {
|
|
||||||
self.sendFeedbackEmail();
|
|
||||||
});*/
|
|
||||||
|
|
||||||
$("#feedbackbutton").click(function()
|
|
||||||
{
|
|
||||||
self.showFeedback();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
initShareBox: function()
|
|
||||||
{
|
|
||||||
$("#sharebutton").click(function()
|
|
||||||
{
|
|
||||||
self.showShareBox();
|
|
||||||
});
|
|
||||||
$("#sharebox-hide").click(function()
|
|
||||||
{
|
|
||||||
self.hideModal();
|
|
||||||
});
|
|
||||||
$("#sharebox-send").click(function()
|
|
||||||
{
|
|
||||||
self.sendInvite();
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#sharebox-url").click(function()
|
|
||||||
{
|
|
||||||
$("#sharebox-url").focus().select();
|
|
||||||
});
|
|
||||||
|
|
||||||
clearShareBoxTo = padutils.makeFieldLabeledWhenEmpty($("#sharebox-to"), "(email addresses)").clear;
|
|
||||||
clearShareBox();
|
|
||||||
|
|
||||||
$("#sharebox-subject").val(self.getDefaultShareBoxSubjectForName(pad.getUserName()));
|
|
||||||
$("#sharebox-message").val(self.getDefaultShareBoxMessageForName(pad.getUserName()));
|
|
||||||
|
|
||||||
$("#sharebox-stripe .setsecurity").click(function()
|
|
||||||
{
|
|
||||||
self.hideModal();
|
|
||||||
paddocbar.setShownPanel('security');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getDefaultShareBoxMessageForName: function(name)
|
|
||||||
{
|
|
||||||
return (name || "Somebody") + " has shared an EtherPad document with you." + "\n\n" + "View it here:\n\n" + padutils.escapeHtml($(".sharebox-url").val() + "\n");
|
|
||||||
},
|
|
||||||
getDefaultShareBoxSubjectForName: function(name)
|
|
||||||
{
|
|
||||||
return (name || "Somebody") + " invited you to an EtherPad document";
|
|
||||||
},
|
|
||||||
relayoutWithBottom: function(px)
|
|
||||||
{
|
|
||||||
$("#modaloverlay").height(px);
|
|
||||||
$("#sharebox").css('left', Math.floor(($(window).width() - $("#sharebox").outerWidth()) / 2));
|
|
||||||
$("#feedbackbox").css('left', Math.floor(($(window).width() - $("#feedbackbox").outerWidth()) / 2));
|
|
||||||
},
|
|
||||||
showFeedback: function()
|
|
||||||
{
|
|
||||||
self.showModal("#feedbackbox");
|
|
||||||
},
|
|
||||||
showShareBox: function()
|
|
||||||
{
|
|
||||||
// when showing the dialog, if it still says "Somebody" invited you
|
|
||||||
// then we fill in the updated username if there is one;
|
|
||||||
// otherwise, we don't touch it, perhaps the user is happy with it
|
|
||||||
var msgbox = $("#sharebox-message");
|
|
||||||
if (msgbox.val() == self.getDefaultShareBoxMessageForName(null))
|
|
||||||
{
|
|
||||||
msgbox.val(self.getDefaultShareBoxMessageForName(pad.getUserName()));
|
|
||||||
}
|
|
||||||
var subjBox = $("#sharebox-subject");
|
|
||||||
if (subjBox.val() == self.getDefaultShareBoxSubjectForName(null))
|
|
||||||
{
|
|
||||||
subjBox.val(self.getDefaultShareBoxSubjectForName(pad.getUserName()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pad.isPadPublic())
|
|
||||||
{
|
|
||||||
$("#sharebox-stripe").get(0).className = 'sharebox-stripe-public';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$("#sharebox-stripe").get(0).className = 'sharebox-stripe-private';
|
|
||||||
}
|
|
||||||
|
|
||||||
self.showModal("#sharebox", 500);
|
|
||||||
$("#sharebox-url").focus().select();
|
|
||||||
},
|
},
|
||||||
showModal: function(modalId, duration)
|
showModal: function(modalId, duration)
|
||||||
{
|
{
|
||||||
|
@ -217,155 +67,6 @@ var padmodals = (function()
|
||||||
{
|
{
|
||||||
$("#modaloverlay").hide();
|
$("#modaloverlay").hide();
|
||||||
});
|
});
|
||||||
},
|
|
||||||
hideFeedbackLaterIfNoOtherInteraction: function()
|
|
||||||
{
|
|
||||||
return padutils.getCancellableAction('hide-feedbackbox', function()
|
|
||||||
{
|
|
||||||
self.hideModal();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
hideShareboxLaterIfNoOtherInteraction: function()
|
|
||||||
{
|
|
||||||
return padutils.getCancellableAction('hide-sharebox', function()
|
|
||||||
{
|
|
||||||
self.hideModal();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/* sendFeedbackEmail: function() {
|
|
||||||
if (sendingFeedback) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var message = $("#feedbackbox-message").val();
|
|
||||||
if (! message) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var email = ($("#feedbackbox-email").hasClass('editempty') ? '' :
|
|
||||||
$("#feedbackbox-email").val());
|
|
||||||
var padId = pad.getPadId();
|
|
||||||
var username = pad.getUserName();
|
|
||||||
setSendingFeedback(true);
|
|
||||||
$("#feedbackbox-response").html("Sending...").get(0).className = '';
|
|
||||||
$("#feedbackbox-response").show();
|
|
||||||
$.ajax({
|
|
||||||
type: 'post',
|
|
||||||
url: '/ep/pad/feedback',
|
|
||||||
data: {
|
|
||||||
feedback: message,
|
|
||||||
padId: padId,
|
|
||||||
username: username,
|
|
||||||
email: email
|
|
||||||
},
|
|
||||||
success: success,
|
|
||||||
error: error
|
|
||||||
});
|
|
||||||
var hideCall = self.hideFeedbackLaterIfNoOtherInteraction();
|
|
||||||
function success(msg) {
|
|
||||||
setSendingFeedback(false);
|
|
||||||
clearFeedback();
|
|
||||||
$("#feedbackbox-response").html("Thanks for your feedback").get(0).className = 'goodresponse';
|
|
||||||
$("#feedbackbox-response").show();
|
|
||||||
window.setTimeout(function() {
|
|
||||||
$("#feedbackbox-response").fadeOut('slow', function() {
|
|
||||||
hideCall();
|
|
||||||
});
|
|
||||||
}, 1500);
|
|
||||||
}
|
|
||||||
function error(e) {
|
|
||||||
setSendingFeedback(false);
|
|
||||||
$("#feedbackbox-response").html("Could not send feedback. Please email us at feedback"+"@"+"etherpad.com instead.").get(0).className = 'badresponse';
|
|
||||||
$("#feedbackbox-response").show();
|
|
||||||
}
|
|
||||||
},*/
|
|
||||||
sendInvite: function()
|
|
||||||
{
|
|
||||||
if (sendingInvite)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!pad.isFullyConnected())
|
|
||||||
{
|
|
||||||
displayErrorMessage("Error: Connection to the server is down or flaky.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var message = $("#sharebox-message").val();
|
|
||||||
if (!message)
|
|
||||||
{
|
|
||||||
displayErrorMessage("Please enter a message body before sending.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var emails = ($("#sharebox-to").hasClass('editempty') ? '' : $("#sharebox-to").val()) || '';
|
|
||||||
// find runs of characters that aren't obviously non-email punctuation
|
|
||||||
var emailArray = emails.match(/[^\s,:;<>\"\'\/\(\)\[\]{}]+/g) || [];
|
|
||||||
if (emailArray.length == 0)
|
|
||||||
{
|
|
||||||
displayErrorMessage('Please enter at least one "To:" address.');
|
|
||||||
$("#sharebox-to").focus().select();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (var i = 0; i < emailArray.length; i++)
|
|
||||||
{
|
|
||||||
var addr = emailArray[i];
|
|
||||||
if (!addr.match(/^[\w\.\_\+\-]+\@[\w\_\-]+\.[\w\_\-\.]+$/))
|
|
||||||
{
|
|
||||||
displayErrorMessage('"' + padutils.escapeHtml(addr) + '" does not appear to be a valid email address.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var subject = $("#sharebox-subject").val();
|
|
||||||
if (!subject)
|
|
||||||
{
|
|
||||||
subject = self.getDefaultShareBoxSubjectForName(pad.getUserName());
|
|
||||||
$("#sharebox-subject").val(subject); // force the default subject
|
|
||||||
}
|
|
||||||
|
|
||||||
var padId = pad.getPadId();
|
|
||||||
var username = pad.getUserName();
|
|
||||||
setSendingInvite(true);
|
|
||||||
$("#sharebox-response").html("Sending...").get(0).className = '';
|
|
||||||
$("#sharebox-response").show();
|
|
||||||
$.ajax(
|
|
||||||
{
|
|
||||||
type: 'post',
|
|
||||||
url: '/ep/pad/emailinvite',
|
|
||||||
data: {
|
|
||||||
message: message,
|
|
||||||
toEmails: emailArray.join(','),
|
|
||||||
subject: subject,
|
|
||||||
username: username,
|
|
||||||
padId: padId
|
|
||||||
},
|
|
||||||
success: success,
|
|
||||||
error: error
|
|
||||||
});
|
|
||||||
var hideCall = self.hideShareboxLaterIfNoOtherInteraction();
|
|
||||||
|
|
||||||
function success(msg)
|
|
||||||
{
|
|
||||||
setSendingInvite(false);
|
|
||||||
$("#sharebox-response").html("Email invitation sent!").get(0).className = 'goodresponse';
|
|
||||||
$("#sharebox-response").show();
|
|
||||||
window.setTimeout(function()
|
|
||||||
{
|
|
||||||
$("#sharebox-response").fadeOut('slow', function()
|
|
||||||
{
|
|
||||||
hideCall();
|
|
||||||
});
|
|
||||||
}, 1500);
|
|
||||||
}
|
|
||||||
|
|
||||||
function error(e)
|
|
||||||
{
|
|
||||||
setSendingFeedback(false);
|
|
||||||
$("#sharebox-response").html("An error occurred; no email was sent.").get(0).className = 'badresponse';
|
|
||||||
$("#sharebox-response").show();
|
|
||||||
}
|
|
||||||
|
|
||||||
function displayErrorMessage(msgHtml)
|
|
||||||
{
|
|
||||||
$("#sharebox-response").html(msgHtml).get(0).className = 'badresponse';
|
|
||||||
$("#sharebox-response").show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return self;
|
return self;
|
||||||
|
|
|
@ -724,11 +724,11 @@ var paduserlist = (function()
|
||||||
$("#myswatch").css({'background-color': myUserInfo.colorId});
|
$("#myswatch").css({'background-color': myUserInfo.colorId});
|
||||||
|
|
||||||
if ($.browser.msie && parseInt($.browser.version) <= 8) {
|
if ($.browser.msie && parseInt($.browser.version) <= 8) {
|
||||||
$("#usericon").css({'box-shadow': 'inset 0 0 30px ' + myUserInfo.colorId,'background-color': myUserInfo.colorId});
|
$("#usericon a").css({'box-shadow': 'inset 0 0 30px ' + myUserInfo.colorId,'background-color': myUserInfo.colorId});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$("#usericon").css({'box-shadow': 'inset 0 0 30px ' + myUserInfo.colorId});
|
$("#usericon a").css({'box-shadow': 'inset 0 0 30px ' + myUserInfo.colorId});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,19 +19,21 @@
|
||||||
* @params reqModuleName Module name e.g. (ep_etherpad-lite/static/js/plugins)
|
* @params reqModuleName Module name e.g. (ep_etherpad-lite/static/js/plugins)
|
||||||
*/
|
*/
|
||||||
exports.getRequirementFromParent = function(requireDefObj, reqModuleName) {
|
exports.getRequirementFromParent = function(requireDefObj, reqModuleName) {
|
||||||
requireDefObj.define(reqModuleName, function(require, exports, module) {
|
// Force the 'undefinition' of the modules (if they already have been loaded).
|
||||||
var t = parent;
|
delete (requireDefObj._definitions)[reqModuleName];
|
||||||
var max = 0; // make sure I don't go up more than 10 times
|
delete (requireDefObj._modules)[reqModuleName];
|
||||||
while (typeof(t) != "undefined") {
|
requireDefObj.define(reqModuleName, function(require, exports, module) {
|
||||||
max++;
|
var t = parent;
|
||||||
if (max==10)
|
var max = 0; // make sure I don't go up more than 10 times
|
||||||
break;
|
while (typeof(t) != "undefined") {
|
||||||
if (typeof(t.require) != "undefined") {
|
max++;
|
||||||
module.exports = t.require(reqModuleName);
|
if (max==10)
|
||||||
return;
|
break;
|
||||||
}
|
if (typeof(t.require) != "undefined") {
|
||||||
t = t.parent;
|
module.exports = t.require(reqModuleName);
|
||||||
}
|
return;
|
||||||
});
|
}
|
||||||
|
t = t.parent;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
// assigns to the global `$` and augments it with plugins.
|
// assigns to the global `$` and augments it with plugins.
|
||||||
require('./jquery');
|
require('./jquery');
|
||||||
JSON = require('./json2');
|
JSON = require('./json2');
|
||||||
require('./undo-xpopup');
|
|
||||||
|
|
||||||
var createCookie = require('./pad_utils').createCookie;
|
var createCookie = require('./pad_utils').createCookie;
|
||||||
var readCookie = require('./pad_utils').readCookie;
|
var readCookie = require('./pad_utils').readCookie;
|
||||||
|
@ -60,7 +59,7 @@ function init() {
|
||||||
//create the url
|
//create the url
|
||||||
var url = loc.protocol + "//" + loc.hostname + ":" + port + "/";
|
var url = loc.protocol + "//" + loc.hostname + ":" + port + "/";
|
||||||
//find out in which subfolder we are
|
//find out in which subfolder we are
|
||||||
var resource = exports.baseURL + 'socket.io';
|
var resource = exports.baseURL.substring(1) + 'socket.io';
|
||||||
|
|
||||||
//build up the socket io connection
|
//build up the socket io connection
|
||||||
socket = io.connect(url, {resource: resource});
|
socket = io.connect(url, {resource: resource});
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
/**
|
|
||||||
* This code is mostly from the old Etherpad. Please help us to comment this code.
|
|
||||||
* This helps other people to understand this code better and helps them to improve it.
|
|
||||||
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copyright 2009 Google Inc.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS-IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (window._orig_windowOpen)
|
|
||||||
{
|
|
||||||
window.open = _orig_windowOpen;
|
|
||||||
}
|
|
||||||
if (window._orig_windowSetTimeout)
|
|
||||||
{
|
|
||||||
window.setTimeout = _orig_windowSetTimeout;
|
|
||||||
}
|
|
||||||
if (window._orig_windowSetInterval)
|
|
||||||
{
|
|
||||||
window.setInterval = _orig_windowSetInterval;
|
|
||||||
}
|
|
|
@ -2,10 +2,10 @@
|
||||||
<head>
|
<head>
|
||||||
<title>Plugin manager</title>
|
<title>Plugin manager</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
||||||
<link rel="stylesheet" href="../../static/css/admin.css">
|
<link rel="stylesheet" href="../static/css/admin.css">
|
||||||
<script src="../../static/js/jquery.js"></script>
|
<script src="../static/js/jquery.js"></script>
|
||||||
<script src="../../socket.io/socket.io.js"></script>
|
<script src="../socket.io/socket.io.js"></script>
|
||||||
<script src="../../static/js/admin/plugins.js"></script>
|
<script src="../static/js/admin/plugins.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
|
|
||||||
<h1>Etherpad Lite</h1>
|
<h1>Etherpad Lite</h1>
|
||||||
<div class="seperator"></div>
|
<div class="separator"></div>
|
||||||
<h2>Installed plugins</h2>
|
<h2>Installed plugins</h2>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="paged listing search-results">
|
<div class="paged listing search-results">
|
||||||
<div class="seperator"></div>
|
<div class="separator"></div>
|
||||||
<h2>Search for plugins to install</h2>
|
<h2>Search for plugins to install</h2>
|
||||||
<form>
|
<form>
|
||||||
<input type="text" name="search" placeholder="Search term" id="search-query">
|
<input type="text" name="search" placeholder="Search term" id="search-query">
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="favicon.ico">
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -130,7 +132,7 @@
|
||||||
|
|
||||||
<script src="static/custom/index.js"></script>
|
<script src="static/custom/index.js"></script>
|
||||||
<script>
|
<script>
|
||||||
document.domain = document.domain;
|
|
||||||
function go2Name()
|
function go2Name()
|
||||||
{
|
{
|
||||||
var padname = document.getElementById("padname").value;
|
var padname = document.getElementById("padname").value;
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="../favicon.ico">
|
||||||
|
|
||||||
<% e.begin_block("styles"); %>
|
<% e.begin_block("styles"); %>
|
||||||
<link href="../static/css/pad.css" rel="stylesheet">
|
<link href="../static/css/pad.css" rel="stylesheet">
|
||||||
<link href="../static/custom/pad.css" rel="stylesheet">
|
<link href="../static/custom/pad.css" rel="stylesheet">
|
||||||
|
@ -18,68 +20,81 @@
|
||||||
|
|
||||||
<!-- head and body had been removed intentionally -->
|
<!-- head and body had been removed intentionally -->
|
||||||
|
|
||||||
|
<% e.begin_block("body"); %>
|
||||||
<div id="editbar" class="toolbar">
|
<div id="editbar" class="toolbar">
|
||||||
<ul class="menu_left">
|
<ul class="menu_left">
|
||||||
<% e.begin_block("editbarMenuLeft"); %>
|
<% e.begin_block("editbarMenuLeft"); %>
|
||||||
<li class="acl-write" id="bold" onClick="window.pad&&pad.editbarClick('bold');return false">
|
<li class="acl-write" id="bold" data-key="bold">
|
||||||
<a class="buttonicon buttonicon-bold" title="Bold (ctrl-B)"></a>
|
<a class="buttonicon buttonicon-bold" title="Bold (ctrl-B)"></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="acl-write" id="italic" onClick="window.pad&&pad.editbarClick('italic'); return false;">
|
<li class="acl-write" id="italic" data-key="italic">
|
||||||
<a class="buttonicon buttonicon-italic" title="Italics (ctrl-I)"></a>
|
<a class="buttonicon buttonicon-italic" title="Italics (ctrl-I)"></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="acl-write" id="underline" onClick="window.pad&&pad.editbarClick('underline');return false;" >
|
<li class="acl-write" id="underline" data-key="underline">
|
||||||
<a class="buttonicon buttonicon-underline" title="Underline (ctrl-U)"></a>
|
<a class="buttonicon buttonicon-underline" title="Underline (ctrl-U)"></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="acl-write" id="strikethrough" onClick="window.pad&&pad.editbarClick('strikethrough');return false;">
|
<li class="acl-write" id="strikethrough" data-key="strikethrough">
|
||||||
<a class="buttonicon buttonicon-strikethrough" title="Strikethrough"></a>
|
<a class="buttonicon buttonicon-strikethrough" title="Strikethrough"></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="separator acl-write"></li>
|
<li class="separator acl-write"></li>
|
||||||
<li class="acl-write" id="oderedlist" onClick="window.pad&&pad.editbarClick('insertorderedlist');return false;">
|
<li class="acl-write" id="oderedlist" data-key="insertorderedlist">
|
||||||
<a class="buttonicon buttonicon-insertorderedlist" title="Toggle Ordered List"></a>
|
<a class="buttonicon buttonicon-insertorderedlist" title="Toggle Ordered List"></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="acl-write" id="unoderedlist" onClick="window.pad&&pad.editbarClick('insertunorderedlist');return false;">
|
<li class="acl-write" id="unoderedlist" data-key="insertunorderedlist">
|
||||||
<a class="buttonicon buttonicon-insertunorderedlist" title="Toggle Bullet List"></a>
|
<a class="buttonicon buttonicon-insertunorderedlist" title="Toggle Bullet List"></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="acl-write" id="indent" onClick="window.pad&&pad.editbarClick('indent');return false;">
|
<li class="acl-write" id="indent" data-key="indent">
|
||||||
<a class="buttonicon buttonicon-indent" title="Indent"></a>
|
<a class="buttonicon buttonicon-indent" title="Indent"></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="acl-write" id="outdent" onClick="window.pad&&pad.editbarClick('outdent');return false;">
|
<li class="acl-write" id="outdent" data-key="outdent">
|
||||||
<a class="buttonicon buttonicon-outdent" title="Unindent"></a>
|
<a class="buttonicon buttonicon-outdent" title="Unindent"></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="separator acl-write"></li>
|
<li class="separator acl-write"></li>
|
||||||
<li class="acl-write" id="undo" onClick="window.pad&&pad.editbarClick('undo');return false;">
|
<li class="acl-write" id="undo" data-key="undo">
|
||||||
<a class="buttonicon buttonicon-undo" title="Undo (ctrl-Z)"></a>
|
<a class="buttonicon buttonicon-undo" title="Undo (ctrl-Z)"></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="acl-write" id="redo" onClick="window.pad&&pad.editbarClick('redo');return false;">
|
<li class="acl-write" id="redo" data-key="redo">
|
||||||
<a class="buttonicon buttonicon-redo" title="Redo (ctrl-Y)"></a>
|
<a class="buttonicon buttonicon-redo" title="Redo (ctrl-Y)"></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="separator acl-write"></li>
|
<li class="separator acl-write"></li>
|
||||||
<li class="acl-write" id="clearAuthorship" onClick="window.pad&&pad.editbarClick('clearauthorship');return false;">
|
<li class="acl-write" id="clearAuthorship" data-key="clearauthorship">
|
||||||
<a class="buttonicon buttonicon-clearauthorship" title="Clear Authorship Colors"></a>
|
<a class="buttonicon buttonicon-clearauthorship" title="Clear Authorship Colors"></a>
|
||||||
</li>
|
</li>
|
||||||
<% e.end_block(); %>
|
<% e.end_block(); %>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="menu_right">
|
<ul class="menu_right">
|
||||||
<% e.begin_block("editbarMenuRight"); %>
|
<% e.begin_block("editbarMenuRight"); %>
|
||||||
<li class="acl-write" id="settingslink" onClick="window.pad&&pad.editbarClick('settings');return false;">
|
<li class="acl-write" data-key="settings">
|
||||||
<a class="buttonicon buttonicon-settings" title="Settings of this pad"></a>
|
<a class="grouped-left" id="settingslink" title="Settings of this pad">
|
||||||
|
<span class="buttonicon buttonicon-settings"></span>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li id="importexportlink" onClick="window.pad&&pad.editbarClick('import_export');return false;">
|
<li data-key="import_export">
|
||||||
<a class="buttonicon buttonicon-import_export" title="Import/Export from/to different document formats"></a>
|
<a class="grouped-middle" id="importexportlink" title="Import/Export from/to different document formats">
|
||||||
|
<span class="buttonicon buttonicon-import_export"></span>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li id="embedlink" onClick="window.pad&&pad.editbarClick('embed');return false;">
|
<li data-key="embed">
|
||||||
<a class="buttonicon buttonicon-embed" title="Share and Embed this pad"></a>
|
<a class="grouped-middle" id="embedlink" title="Share and Embed this pad">
|
||||||
|
<span class="buttonicon buttonicon-embed"></span>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="acl-write" id="revisionlink" onClick="window.pad&&pad.editbarClick('savedRevision');return false;">
|
<li class="acl-write" data-key="savedRevision">
|
||||||
<a class="buttonicon buttonicon-savedRevision" title="Mark this revision as a saved revision"></a>
|
<a class="grouped-right" id="revisionlink" title="Mark this revision as a saved revision">
|
||||||
|
<span class="buttonicon buttonicon-savedRevision"></span>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="separator"></li>
|
<li class="separator"></li>
|
||||||
<li id="timesliderlink" onClick="document.location = document.location.pathname+ '/timeslider'">
|
<li onClick="document.location = document.location.pathname+ '/timeslider'">
|
||||||
<a class="buttonicon buttonicon-history" title="Show the history of this pad"></a>
|
<a id="timesliderlink" title="Show the history of this pad">
|
||||||
|
<span class="buttonicon buttonicon-history"></span>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li id="usericon" onClick="window.pad&&pad.editbarClick('showusers');return false;" title="Show connected users">
|
<li id="usericon" data-key="showusers">
|
||||||
<span class="buttonicon buttonicon-showusers" id="usericonback"></span>
|
<a title="Show connected users">
|
||||||
<span id="online_count">1</span>
|
<span class="buttonicon buttonicon-showusers"></span>
|
||||||
|
<span id="online_count">1</span>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<% e.end_block(); %>
|
<% e.end_block(); %>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -113,9 +128,10 @@
|
||||||
<div id="editorloadingbox">Loading...</div>
|
<div id="editorloadingbox">Loading...</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="settingsmenu" class="popup">
|
<div id="settings" class="popup">
|
||||||
<h1>Pad settings</h1>
|
<h1>Pad settings</h1>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
|
<% e.begin_block("mySettings"); %>
|
||||||
<h2>My view</h2>
|
<h2>My view</h2>
|
||||||
<p>
|
<p>
|
||||||
<input type="checkbox" id="options-stickychat" onClick="chat.stickToScreen();">
|
<input type="checkbox" id="options-stickychat" onClick="chat.stickToScreen();">
|
||||||
|
@ -136,17 +152,20 @@
|
||||||
<option value="monospace">Monospaced</option>
|
<option value="monospace">Monospaced</option>
|
||||||
</select>
|
</select>
|
||||||
</p>
|
</p>
|
||||||
|
<% e.end_block(); %>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
|
<% e.begin_block("globalSettings"); %>
|
||||||
<h2>Global view</h2>
|
<h2>Global view</h2>
|
||||||
<p>Currently nothing.</p>
|
<% e.end_block(); %>
|
||||||
<p class="note">These options affect everyone viewing this pad.</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="importexport" class="popup">
|
<div id="importexport" class="popup">
|
||||||
|
<h1>Import/Export</h1>
|
||||||
<div class="column acl-write">
|
<div class="column acl-write">
|
||||||
<h2>Import from text file, HTML, PDF, Word, ODT or RTF</h2><br>
|
<% e.begin_block("importColumn"); %>
|
||||||
|
<h2>Upload any text file or document</h2><br>
|
||||||
<form id="importform" method="post" action="" target="importiframe" enctype="multipart/form-data">
|
<form id="importform" method="post" action="" target="importiframe" enctype="multipart/form-data">
|
||||||
<div class="importformdiv" id="importformfilediv">
|
<div class="importformdiv" id="importformfilediv">
|
||||||
<input type="file" name="file" size="15" id="importfileinput">
|
<input type="file" name="file" size="15" id="importfileinput">
|
||||||
|
@ -163,20 +182,23 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<% e.end_block(); %>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<h2>Export current pad as</h2>
|
<h2>Export current pad as</h2>
|
||||||
|
<% e.begin_block("exportColumn"); %>
|
||||||
<a id="exporthtmla" target="_blank" class="exportlink"><div class="exporttype" id="exporthtml">HTML</div></a>
|
<a id="exporthtmla" target="_blank" class="exportlink"><div class="exporttype" id="exporthtml">HTML</div></a>
|
||||||
<a id="exportplaina" target="_blank" class="exportlink"><div class="exporttype" id="exportplain">Plain text</div></a>
|
<a id="exportplaina" target="_blank" class="exportlink"><div class="exporttype" id="exportplain">Plain text</div></a>
|
||||||
<a id="exportworda" target="_blank" class="exportlink"><div class="exporttype" id="exportword">Microsoft Word</div></a>
|
<a id="exportworda" target="_blank" class="exportlink"><div class="exporttype" id="exportword">Microsoft Word</div></a>
|
||||||
<a id="exportpdfa" target="_blank" class="exportlink"><div class="exporttype" id="exportpdf">PDF</div></a>
|
<a id="exportpdfa" target="_blank" class="exportlink"><div class="exporttype" id="exportpdf">PDF</div></a>
|
||||||
<a id="exportopena" target="_blank" class="exportlink"><div class="exporttype" id="exportopen">OpenDocument</div></a>
|
<a id="exportopena" target="_blank" class="exportlink"><div class="exporttype" id="exportopen">OpenDocument</div></a>
|
||||||
<a id="exportdokuwikia" target="_blank" class="exportlink"><div class="exporttype" id="exportdokuwiki">DokuWiki text</div></a>
|
<a id="exportdokuwikia" target="_blank" class="exportlink"><div class="exporttype" id="exportdokuwiki">DokuWiki text</div></a>
|
||||||
<a id="exportwordlea" target="_blank" onClick="padimpexp.export2Wordle();return false;" class="exportlink"><div class="exporttype" id="exportwordle">Wordle</div></a>
|
<% e.end_block(); %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="embed" class="popup">
|
<div id="embed" class="popup">
|
||||||
|
<% e.begin_block("embedPopup"); %>
|
||||||
<div id="embedreadonly" class="right acl-write">
|
<div id="embedreadonly" class="right acl-write">
|
||||||
<input type="checkbox" id="readonlyinput" onClick="padeditbar.setEmbedLinks();">
|
<input type="checkbox" id="readonlyinput" onClick="padeditbar.setEmbedLinks();">
|
||||||
<label for="readonlyinput">Read only</label>
|
<label for="readonlyinput">Read only</label>
|
||||||
|
@ -191,11 +213,7 @@
|
||||||
<h2>Embed URL</h2>
|
<h2>Embed URL</h2>
|
||||||
<input id="embedinput" type="text" value="">
|
<input id="embedinput" type="text" value="">
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<% e.end_block(); %>
|
||||||
<div id="qrcode">
|
|
||||||
<h2>QR code</h2>
|
|
||||||
<div id="qr_center"><img id="embedreadonlyqr"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="chatthrob"></div>
|
<div id="chatthrob"></div>
|
||||||
|
@ -269,23 +287,37 @@
|
||||||
</div>
|
</div>
|
||||||
<% e.end_block(); %>
|
<% e.end_block(); %>
|
||||||
</div>
|
</div>
|
||||||
|
<% e.end_block(); %>
|
||||||
|
|
||||||
<% e.begin_block("scripts"); %>
|
<% e.begin_block("scripts"); %>
|
||||||
<script type="text/javascript" src="../static/js/require-kernel.js"></script>
|
<script type="text/javascript" src="../static/js/require-kernel.js"></script>
|
||||||
<script type="text/javascript" src="../static/js/jquery.js"></script>
|
|
||||||
<script type="text/javascript" src="../socket.io/socket.io.js"></script>
|
<script type="text/javascript" src="../socket.io/socket.io.js"></script>
|
||||||
|
|
||||||
|
<!-- Include base packages manually (this help with debugging) -->
|
||||||
<script type="text/javascript" src="../javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define"></script>
|
<script type="text/javascript" src="../javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define"></script>
|
||||||
|
<script type="text/javascript" src="../javascripts/lib/ep_etherpad-lite/static/js/ace2_common.js?callback=require.define"></script>
|
||||||
|
|
||||||
|
<!-- Bootstrap page -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
document.domain = document.domain;
|
|
||||||
var clientVars = {};
|
var clientVars = {};
|
||||||
(function () {
|
(function () {
|
||||||
|
|
||||||
var baseURL = '../';
|
|
||||||
|
|
||||||
|
var pathComponents = location.pathname.split('/');
|
||||||
|
|
||||||
|
// Strip 'p' and the padname from the pathname and set as baseURL
|
||||||
|
var baseURL = pathComponents.slice(0,pathComponents.length-2).join('/') + '/';
|
||||||
|
|
||||||
require.setRootURI(baseURL + "javascripts/src");
|
require.setRootURI(baseURL + "javascripts/src");
|
||||||
require.setLibraryURI(baseURL + "javascripts/lib");
|
require.setLibraryURI(baseURL + "javascripts/lib");
|
||||||
require.setGlobalKeyPath("require");
|
require.setGlobalKeyPath("require");
|
||||||
|
|
||||||
|
$ = jQuery = require('ep_etherpad-lite/static/js/rjquery').jQuery; // Expose jQuery #HACK
|
||||||
|
|
||||||
|
if ((!$.browser.msie) && (!($.browser.mozilla && $.browser.version.indexOf("1.8.") == 0))) {
|
||||||
|
document.domain = document.domain; // for comet
|
||||||
|
}
|
||||||
|
|
||||||
var plugins = require('ep_etherpad-lite/static/js/pluginfw/plugins');
|
var plugins = require('ep_etherpad-lite/static/js/pluginfw/plugins');
|
||||||
plugins.baseURL = baseURL;
|
plugins.baseURL = baseURL;
|
||||||
plugins.update(function () {
|
plugins.update(function () {
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
|
|
||||||
<title>Etherpad Lite Timeslider</title>
|
<title>Etherpad Lite Timeslider</title>
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="../../favicon.ico">
|
||||||
<link rel="stylesheet" href="../../static/css/pad.css">
|
<link rel="stylesheet" href="../../static/css/pad.css">
|
||||||
<link rel="stylesheet" href="../../static/css/timeslider.css">
|
<link rel="stylesheet" href="../../static/css/timeslider.css">
|
||||||
<link rel="stylesheet" href="../../static/custom/timeslider.css">
|
<link rel="stylesheet" href="../../static/custom/timeslider.css">
|
||||||
|
@ -13,35 +15,6 @@
|
||||||
|
|
||||||
<body id="padbody" class="timeslider limwidth">
|
<body id="padbody" class="timeslider limwidth">
|
||||||
<div id="padpage">
|
<div id="padpage">
|
||||||
<div id="padtop">
|
|
||||||
<div id="alertbar">
|
|
||||||
<div id="servermsg">
|
|
||||||
<h3>Server Notice<span id="servermsgdate"><!-- --></span>:</h3><a id=
|
|
||||||
"hidetopmsg" href="javascript:%20void%20pad.hideServerMessage()" name=
|
|
||||||
"hidetopmsg">hide</a>
|
|
||||||
<p id="servermsgtext"><!-- --></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="navigation"></div>
|
|
||||||
|
|
||||||
<div id="docbar" class="menu docbar">
|
|
||||||
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="docbartable"
|
|
||||||
class="docbartable">
|
|
||||||
<tr>
|
|
||||||
<td><img src="../../static/img/roundcorner_left.gif" /></td>
|
|
||||||
|
|
||||||
<td id="docbarpadtitle" class="docbarpadtitle" title=
|
|
||||||
"Public Pad: Public Pad"><span>Public Pad</span></td>
|
|
||||||
|
|
||||||
<td width="100%"> </td>
|
|
||||||
|
|
||||||
<td><img src="../../static/img/roundcorner_right.gif" /></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div><!-- /docbar -->
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="timeslider-top">
|
<div id="timeslider-top">
|
||||||
<div id="timeslider-wrapper">
|
<div id="timeslider-wrapper">
|
||||||
<div id="timeslider" unselectable="on" style="display: none">
|
<div id="timeslider" unselectable="on" style="display: none">
|
||||||
|
@ -157,30 +130,40 @@
|
||||||
<a id="exportpdfa" target="_blank" class="exportlink"><div class="exporttype" id="exportpdf">PDF</div></a>
|
<a id="exportpdfa" target="_blank" class="exportlink"><div class="exporttype" id="exportpdf">PDF</div></a>
|
||||||
<a id="exportopena" target="_blank" class="exportlink"><div class="exporttype" id="exportopen">OpenDocument</div></a>
|
<a id="exportopena" target="_blank" class="exportlink"><div class="exporttype" id="exportopen">OpenDocument</div></a>
|
||||||
<a id="exportdokuwikia" target="_blank" class="exportlink"><div class="exporttype" id="exportdokuwiki">DokuWiki text</div></a>
|
<a id="exportdokuwikia" target="_blank" class="exportlink"><div class="exporttype" id="exportdokuwiki">DokuWiki text</div></a>
|
||||||
<a id="exportwordlea" target="_blank" onClick="padimpexp.export2Wordle();return false;" class="exportlink"><div class="exporttype" id="exportwordle">Wordle</div></a>
|
|
||||||
<form id="wordlepost" name="wall" action="http://wordle.net/advanced" method="POST" style="margin-left:0px;">
|
|
||||||
<div id="hidetext" style=""><textarea id="text" name="text" id="text" style="display:none;">Coming soon!</textarea></div>
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript" src="../../static/js/require-kernel.js"></script>
|
<script type="text/javascript" src="../../static/js/require-kernel.js"></script>
|
||||||
<script type="text/javascript" src="../../static/js/jquery.js"></script>
|
|
||||||
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
|
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
|
||||||
|
|
||||||
|
<!-- Include base packages manually (this help with debugging) -->
|
||||||
<script type="text/javascript" src="../../javascripts/lib/ep_etherpad-lite/static/js/timeslider.js?callback=require.define"></script>
|
<script type="text/javascript" src="../../javascripts/lib/ep_etherpad-lite/static/js/timeslider.js?callback=require.define"></script>
|
||||||
|
<script type="text/javascript" src="../../javascripts/lib/ep_etherpad-lite/static/js/ace2_common.js?callback=require.define"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="../../static/custom/timeslider.js"></script>
|
<script type="text/javascript" src="../../static/custom/timeslider.js"></script>
|
||||||
|
|
||||||
|
<!-- Bootstrap -->
|
||||||
<script type="text/javascript" >
|
<script type="text/javascript" >
|
||||||
document.domain = document.domain;
|
|
||||||
var clientVars = {};
|
var clientVars = {};
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
var baseURL = '../../';
|
|
||||||
|
var pathComponents = location.pathname.split('/');
|
||||||
|
|
||||||
|
// Strip 'p', the padname and 'timeslider' from the pathname and set as baseURL
|
||||||
|
var baseURL = pathComponents.slice(0,pathComponents.length-3).join('/') + '/';
|
||||||
|
|
||||||
|
|
||||||
require.setRootURI(baseURL + "javascripts/src");
|
require.setRootURI(baseURL + "javascripts/src");
|
||||||
require.setLibraryURI(baseURL + "javascripts/lib");
|
require.setLibraryURI(baseURL + "javascripts/lib");
|
||||||
require.setGlobalKeyPath("require");
|
require.setGlobalKeyPath("require");
|
||||||
|
|
||||||
|
$ = jQuery = require('ep_etherpad-lite/static/js/rjquery').jQuery; // Expose jQuery #HACK
|
||||||
|
|
||||||
|
if ((!$.browser.msie) && (!($.browser.mozilla && $.browser.version.indexOf("1.8.") == 0))) {
|
||||||
|
document.domain = document.domain; // for comet
|
||||||
|
}
|
||||||
|
|
||||||
var plugins = require('ep_etherpad-lite/static/js/pluginfw/plugins');
|
var plugins = require('ep_etherpad-lite/static/js/pluginfw/plugins');
|
||||||
plugins.baseURL = baseURL;
|
plugins.baseURL = baseURL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue