Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ep_context

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ep_context - npm Package Compare versions

Comparing version 0.0.5 to 0.0.7

2

package.json
{
"description": "Context for Etherpad Documents, very WIP.",
"name": "ep_context",
"version": "0.0.5",
"version": "0.0.7",
"author": {

@@ -6,0 +6,0 @@ "name": "John McLear",

@@ -53,3 +53,2 @@ var _, $, jQuery;

var documentAttributeManager = call.documentAttributeManager;
if(!(cs.type == "handleClick") && !(cs.type == "handleKeyEvent") && !(cs.docTextChanged)){

@@ -65,6 +64,7 @@ return false;

var thisLine = rep.selEnd[0];
// This should only fire on a new line, at the moment it fires on a new tab!
var attributes = documentAttributeManager.getAttributeOnLine(lastLine, 'context');
if(attributes){
// The line did have attributes so set them on the new line
// But before we apply a new attribute we should see if we're supposed to be dropping an context layer

@@ -77,9 +77,19 @@ if(clientVars.plugins.plugins.ep_context.crudeEnterCounter >= 1){

documentAttributeManager.setAttributeOnLine(thisLine, 'context', attributes);
// remove on previous line too
documentAttributeManager.setAttributeOnLine(thisLine-1, 'context', attributes);
}else{
// no more attributes left so remove it
// documentAttributeManager.setAttributeOnLine(thisLine, 'context', ['null']);
documentAttributeManager.removeAttributeOnLine(thisLine, 'context');
// remove on previous line too
// documentAttributeManager.setAttributeOnLine(thisLine-1, 'context', ['null']);
documentAttributeManager.removeAttributeOnLine(thisLine-1, 'context');
}
return true;
}else{ // first enter will keep the attribute
// Make sure the line doesn't have any content in already
var blankLine = call.rep.alines[thisLine] === "*0|1+1";
if(!blankLine) return;
documentAttributeManager.setAttributeOnLine(thisLine, 'context', attributes);
}
documentAttributeManager.setAttributeOnLine(thisLine, 'context', attributes);
clientVars.plugins.plugins.ep_context.crudeEnterCounter++;

@@ -86,0 +96,0 @@ return true;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc