New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ep_font_color

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ep_font_color - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

exportHTML.js

5

ep.json

@@ -8,2 +8,3 @@ {

"aceInitialized": "ep_font_color/static/js/index",
"aceEditorCSS": "ep_font_color/static/js/index",
"aceCreateDomLine": "ep_font_color/static/js/index",

@@ -17,3 +18,5 @@ "aceAttribsToClasses": "ep_font_color/static/js/index",

"collectContentPost": "ep_font_color/static/js/shared",
"getLineHTMLForExport": "ep_font_color/index",
"exportHtmlAdditionalTagsWithData": "ep_font_color/exportHTML",
"stylesForExport": "ep_font_color/exportHTML",
"getLineHTMLForExport": "ep_font_color/exportHTML",
"eejsBlock_dd_format":"ep_font_color/index"

@@ -20,0 +23,0 @@ }

var eejs = require('ep_etherpad-lite/node/eejs/');
var Changeset = require("ep_etherpad-lite/static/js/Changeset");
exports.eejsBlock_editbarMenuLeft = function (hook_name, args, cb) {

@@ -12,25 +11,1 @@ args.content = args.content + eejs.require("ep_font_color/templates/editbarButtons.ejs");

}
function getInlineStyle(color) {
return "color: "+color+";";
}
// line, apool,attribLine,text
exports.getLineHTMLForExport = function (hook, context) {
var header = _analyzeLine(context.attribLine, context.apool);
if (header) {
var inlineStyle = getInlineStyle(header);
return "<" + header + " style=\"" + inlineStyle + "\">" + context.text.substring(1) + "</" + header + ">";
}
}
function _analyzeLine(alineAttrs, apool) {
var header = null;
if (alineAttrs) {
var opIter = Changeset.opIterator(alineAttrs);
if (opIter.hasNext()) {
var op = opIter.next();
header = Changeset.opAttributeValue(op, 'colors', apool);
}
}
return header;
}

7

package.json
{
"description": "Apply colors to fonts",
"name": "ep_font_color",
"version": "0.0.10",
"version": "0.0.11",
"license": "Apache-2.0",
"author": {

@@ -12,3 +13,7 @@ "name": "John McLear",

"node": "*"
},
"repository": {
"type": "git",
"url": "https://github.com/JohnMcLear/ep_font_color.git"
}
}

@@ -5,3 +5,3 @@ var _, $, jQuery;

var _ = require('ep_etherpad-lite/static/js/underscore');
var colorsClass = 'colors';
var cssFiles = ["ep_font_color/static/css/color.css"];

@@ -32,3 +32,3 @@ // All our colors are block elements, so we just return them.

// Our colors attribute will result in a heaading:h1... :h6 class
// Our colors attribute will result in a color:red... _yellow class
function aceAttribsToClasses(hook, context){

@@ -54,8 +54,8 @@ if(context.key.indexOf("color:") !== -1){

if (tagIndex !== undefined && tagIndex >= 0){
var tag = colors[tagIndex];
var modifier = {
extraOpenTags: '<span style="color: ' + tag + ';">',
extraCloseTags: '</span>',
extraOpenTags: '',
extraCloseTags: '',
cls: cls

@@ -69,5 +69,4 @@ };

// Find out which lines are selected and assign them the colors attribute.
// Passing a level >= 0 will set a colors on the selected lines, level < 0
// Find out which lines are selected and assign them the color attribute.
// Passing a level >= 0 will set a colors on the selected lines, level < 0
// will remove it

@@ -80,12 +79,9 @@ function doInsertColors(level){

}
if(level >= 0){
documentAttributeManager.setAttributesOnRange(rep.selStart, rep.selEnd, [
['color', colors[level]]
]);
}else{
documentAttributeManager.setAttributesOnRange(rep.selStart, rep.selEnd, [
['color', '']
]);
var new_color = ["color", ""];
if(level >= 0) {
new_color = ["color", colors[level]];
}
documentAttributeManager.setAttributesOnRange(rep.selStart, rep.selEnd, [new_color]);
}

@@ -100,3 +96,7 @@

function aceEditorCSS(){
return cssFiles;
};
// Export all hooks

@@ -106,1 +106,2 @@ exports.aceInitialized = aceInitialized;

exports.aceAttribsToClasses = aceAttribsToClasses;
exports.aceEditorCSS = aceEditorCSS;

@@ -8,3 +8,3 @@ var _ = require('ep_etherpad-lite/static/js/underscore');

if(color && color[1]){
context.cc.doAttrib(context.state, color[0]);
context.cc.doAttrib(context.state, "color::" + color[1]);
}

@@ -11,0 +11,0 @@ };

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