ep_clear_formatting
Advanced tools
Comparing version 0.0.8 to 0.0.10
@@ -1,9 +0,8 @@ | ||
var eejs = require('ep_etherpad-lite/node/eejs/'); | ||
var settings = require('ep_etherpad-lite/node/utils/Settings'); | ||
var checked_state = ''; | ||
const eejs = require('ep_etherpad-lite/node/eejs/'); | ||
const settings = require('ep_etherpad-lite/node/utils/Settings'); | ||
const checked_state = ''; | ||
exports.eejsBlock_dd_format = function (hook_name, args, cb) { | ||
args.content = args.content + eejs.require('ep_clear_formatting/templates/clear_formatting_menu.ejs'); | ||
args.content += eejs.require('ep_clear_formatting/templates/clear_formatting_menu.ejs'); | ||
return cb(); | ||
} | ||
}; |
{ | ||
"name": "ep_clear_formatting", | ||
"version": "0.0.8", | ||
"version": "0.0.10", | ||
"keywords": [ | ||
@@ -27,3 +27,19 @@ "clear", | ||
"url": "http://etherpad.org/" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^7.14.0", | ||
"eslint-config-etherpad": "^1.0.8", | ||
"eslint-plugin-mocha": "^8.0.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prefer-arrow": "^1.2.2", | ||
"eslint-plugin-promise": "^4.2.1" | ||
}, | ||
"eslintConfig": { | ||
"root": true, | ||
"extends": "etherpad/plugin" | ||
}, | ||
"scripts": { | ||
"lint": "eslint .", | ||
"lint:fix": "eslint --fix ." | ||
} | ||
} |
@@ -1,18 +0,17 @@ | ||
exports.postAceInit = function(hook, context){ | ||
$('#clearFormatting').click(function(){ | ||
context.ace.callWithAce(function(ace){ | ||
exports.postAceInit = function (hook, context) { | ||
$('#clearFormatting').click(() => { | ||
context.ace.callWithAce((ace) => { | ||
const rep = ace.ace_getRep(); // get the current user selection | ||
const isSelection = (rep.selStart[0] !== rep.selEnd[0] || rep.selStart[1] !== rep.selEnd[1]); | ||
if (!isSelection) return false; // No point proceeding if no selection.. | ||
var rep = ace.ace_getRep(); // get the current user selection | ||
var isSelection = (rep.selStart[0] !== rep.selEnd[0] || rep.selStart[1] !== rep.selEnd[1]); | ||
if(!isSelection) return false; // No point proceeding if no selection.. | ||
var attrs = rep.apool.attribToNum; // get the attributes on this document | ||
$.each(attrs, function(k, v){ // for each attribute | ||
var attr = k.split(",")[0]; // get the name of the attribute | ||
if(attr !== "author"){ // if its not an author attribute | ||
const attrs = rep.apool.attribToNum; // get the attributes on this document | ||
$.each(attrs, (k, v) => { // for each attribute | ||
const attr = k.split(',')[0]; // get the name of the attribute | ||
if (attr !== 'author') { // if its not an author attribute | ||
ace.ace_setAttributeOnSelection(attr, false); // set the attribute to false | ||
} | ||
}); | ||
},'clearFormatting' , true); | ||
}, 'clearFormatting', true); | ||
}); | ||
} | ||
}; |
Sorry, the diff of this file is not supported yet
7174
9
6