Commit 9a76a6c9 authored by Nelson Gonçalves's avatar Nelson Gonçalves
Browse files

Add plugin to disable name change

parent cb42222a
Copyright 2020 John McLear
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.
{
"parts":[
{
"name": "disableNameInputbox",
"hooks": {},
"client_hooks": {
"postAceInit": "ep_disable_change_author_name/static/js/disable:postAceInit"
}
}
]
}
{
"name": "ep_disable_change_author_name",
"description": "A plugin to stop users from being able to change their names",
"version": "0.0.13",
"author": {
"name": "johnyma22",
"email": "john@mclear.co.uk",
"url": "John McLear"
},
"contributors": [],
"dependencies": {},
"engines": {
"node": ">= 0.4.1"
},
"_id": "ep_disable_change_author_name@0.0.2",
"dist": {
"shasum": "7a668717f83a7027ecd5316aa44833c4cc105ee8",
"tarball": "http://registry.npmjs.org/ep_disable_change_author_name/-/ep_disable_change_author_name-0.0.2.tgz"
},
"_from": "ep_disable_change_author_name@*",
"_resolved": "https://registry.npmjs.org/ep_disable_change_author_name/-/ep_disable_change_author_name-0.0.2.tgz",
"_npmVersion": "1.4.6",
"_npmUser": {
"name": "johnyma22",
"email": "john@mclear.co.uk"
},
"maintainers": [
{
"name": "johnyma22",
"email": "john@mclear.co.uk"
}
],
"directories": {},
"_shasum": "7a668717f83a7027ecd5316aa44833c4cc105ee8"
}
var $ = require('ep_etherpad-lite/static/js/rjquery').$; // use jQuery
exports.postAceInit = function (hook_name, args, cb) {
$('#users input[type=text]').prop('disabled', true); // disable the text boxes in the users section.
$('#users input[type=text]').attr('Title', 'Name Change Disabled'); // disable the text boxes in the users section.
$('body').append("<style> \
#myusernameedit{background:lightgrey !important;} \
#myusernameedit:hover{background:lightgrey !important;color:#333 !important} \
</style>");
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment