mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 17:36:14 -04:00
import: Replace the allowAnyoneToImport
check with userCanModify
This reduces the number of hoops a user or tool must jump through to import.
This commit is contained in:
parent
831528e8bc
commit
a8cf434d1d
11 changed files with 143 additions and 109 deletions
|
@ -71,7 +71,3 @@ input {
|
|||
@media (max-width: 800px) {
|
||||
.hide-for-mobile { display: none; }
|
||||
}
|
||||
|
||||
#importmessagepermission {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -312,16 +312,6 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
|
|||
}
|
||||
else if (msg.type == "ACCEPT_COMMIT")
|
||||
{
|
||||
/*
|
||||
* this is the first time this user contributed to this pad. Let's record
|
||||
* it, because it will be used for allowing import.
|
||||
*
|
||||
* TODO: here, we are changing this variable on the client side only. The
|
||||
* server has all the informations to make the same deduction, and
|
||||
* broadcast to the client.
|
||||
*/
|
||||
clientVars.thisUserHasEditedThisPad = true;
|
||||
|
||||
var newRev = msg.newRev;
|
||||
if (msgQueue.length > 0)
|
||||
{
|
||||
|
|
|
@ -415,17 +415,6 @@ var padeditbar = (function()
|
|||
|
||||
toolbar.registerCommand("import_export", function () {
|
||||
toolbar.toggleDropDown("import_export", function(){
|
||||
|
||||
if (clientVars.thisUserHasEditedThisPad || clientVars.allowAnyoneToImport) {
|
||||
// the user has edited this pad historically or in this session
|
||||
$('#importform').show();
|
||||
$('#importmessagepermission').hide();
|
||||
} else {
|
||||
// this is the first time this user visits this pad
|
||||
$('#importform').hide();
|
||||
$('#importmessagepermission').show();
|
||||
}
|
||||
|
||||
// If Import file input exists then focus on it..
|
||||
if($('#importfileinput').length !== 0){
|
||||
setTimeout(function(){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue