mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-08 16:05:05 -04:00
Merge 811c20508a
into 2435003403
This commit is contained in:
commit
6cfa43cb97
3 changed files with 28 additions and 12 deletions
|
@ -431,7 +431,7 @@ exports.setPassword = function(padID, password, callback)
|
|||
if(ERR(err, callback)) return;
|
||||
|
||||
//set the password
|
||||
pad.setPassword(password);
|
||||
pad.setPassword(password == "" ? null : password);
|
||||
|
||||
callback();
|
||||
});
|
||||
|
|
|
@ -4,7 +4,7 @@ var formidable = require('formidable');
|
|||
var apiHandler = require('../../handler/APIHandler');
|
||||
|
||||
//This is for making an api call, collecting all post information and passing it to the apiHandler
|
||||
exports.apiCaller = function(req, res, fields) {
|
||||
var apiCaller = function(req, res, fields) {
|
||||
res.header("Content-Type", "application/json; charset=utf-8");
|
||||
|
||||
apiLogger.info("REQUEST, " + req.params.func + ", " + JSON.stringify(fields));
|
||||
|
@ -26,6 +26,7 @@ exports.apiCaller = function(req, res, fields) {
|
|||
apiHandler.handle(req.params.func, fields, req, res);
|
||||
}
|
||||
|
||||
exports.apiCaller = apiCaller;
|
||||
|
||||
exports.expressCreateServer = function (hook_name, args, cb) {
|
||||
//This is a api GET call, collect all post informations and pass it to the apiHandler
|
||||
|
@ -55,4 +56,4 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
|||
res.end("OK");
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var readCookie = require('./pad_utils').readCookie;
|
||||
var padutils = require('./pad_utils').padutils;
|
||||
var padeditor = require('./pad_editor').padeditor;
|
||||
var padsavedrevs = require('./pad_savedrevs');
|
||||
|
@ -236,19 +237,33 @@ var padeditbar = (function()
|
|||
{
|
||||
if ($('#readonlyinput').is(':checked'))
|
||||
{
|
||||
var basePath = document.location.href.substring(0, document.location.href.indexOf("/p/"));
|
||||
var readonlyLink = basePath + "/ro/" + clientVars.readOnlyId;
|
||||
$('#embedinput').val("<iframe name='embed_readonly' src='" + readonlyLink + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false' width=600 height=400>");
|
||||
$('#linkinput').val(readonlyLink);
|
||||
$('#embedreadonlyqr').attr("src","https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=|0&chl=" + readonlyLink);
|
||||
if (readCookie("parentUriReadOnly"))
|
||||
{
|
||||
var padLink = decodeURIComponent(readCookie("parentUriReadOnly"));
|
||||
var embedLink = padLink;
|
||||
}
|
||||
else
|
||||
{
|
||||
var padLink = document.location.href.substring(0, document.location.href.indexOf("/p/")) + "/ro/" + clientVars.readOnlyId;
|
||||
var embedLink = padLink + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
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>");
|
||||
$('#linkinput').val(padurl);
|
||||
$('#embedreadonlyqr').attr("src","https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=|0&chl=" + padurl);
|
||||
if (readCookie("parentUri"))
|
||||
{
|
||||
var padLink = decodeURIComponent(readCookie("parentUri"));
|
||||
var embedLink = padLink;
|
||||
}
|
||||
else
|
||||
{
|
||||
var padLink = document.location.href.split("?")[0];
|
||||
var embedLink = padLink + "?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false";
|
||||
}
|
||||
}
|
||||
$('#embedinput').val("<iframe name='embed_readonly' src='" + embedLink + "' width=600 height=400>");
|
||||
$('#linkinput').val(padLink);
|
||||
$('#embedreadonlyqr').attr("src","https://chart.googleapis.com/chart?chs=200x200&cht=qr&chld=|0&chl=" + padLink);
|
||||
}
|
||||
};
|
||||
return self;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue