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

apostrophe-schema-widgets

Package Overview
Dependencies
Maintainers
10
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apostrophe-schema-widgets - npm Package Compare versions

Comparing version 0.5.7 to 0.5.8

5

index.js

@@ -14,2 +14,3 @@ var _ = require('lodash');

var self = this;
self.widgets = {};
self._apos = apos;

@@ -19,2 +20,3 @@ self._app = app;

self._options = options;
self._pages = options.pages;
self._apos.mixinModuleAssets(self, 'schema-widgets', __dirname, options);

@@ -68,5 +70,6 @@

apos.addWidgetType(widget.name, widget);
self.widgets[widget.name] = widget;
});
return setImmediate(function() { return callback(null); });
return setImmediate(function() { return callback && callback(null); });
}

2

package.json
{
"name": "apostrophe-schema-widgets",
"version": "0.5.7",
"version": "0.5.8",
"description": "An easy form widget builder for the Apostrophe content management system",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -109,2 +109,38 @@ # apostrophe-schema-widgets

## Extending Schema Widgets
If you need a custom loader to fetch more data, just subclass the module in `lib/modules/apostrophe-schema-widgets/index.js`. Here's an example in which we want to do extra work for the schema widget named `menuBuilder`:
```javascript
module.exports = schemaWidgets;
function schemaWidgets(options, callback) {
return new schemaWidgets.SchemaWidgets(options, callback);
}
schemaWidgets.SchemaWidgets = function(options, callback) {
var self = this;
module.exports.Super.call(this, options, null);
var superLoad = self.widgets.menuBuilder.load;
self.widgets.menuBuilder.load = function(req, item, callback) {
return superLoad(req, item, function(err) {
if (err) {
return callback(err);
}
// Do your custom work here, add properties
// to the item, then...
return callback(null);
});
};
if (callback) {
process.nextTick(function() { return callback(null); });
}
};
```
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