Skip to content

Commit

Permalink
Added a new event ON('componentator', function(meta)).
Browse files Browse the repository at this point in the history
  • Loading branch information
petersirka committed Jul 18, 2023
1 parent 59a467d commit 23ae9d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- added `API.file(filename, path, [formkey])`
- added `PATH.plugins(path)` method
- added a new event `ON('componentator', function(meta))`

========================
0.0.87
Expand Down
12 changes: 9 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9905,13 +9905,19 @@ global.HTMLMAIL = function(address, subject, body, language, callback) {

global.COMPONENTATOR = function(name, components, removeprev) {

var url = 'https://componentator.com/download.js?id=' + components;
var meta = {};

meta.components = components;
meta.name = name;

F.$events.componentator && EMIT('componentator', meta);

var nameid = name.slug();
var url = 'https://componentator.com/download.js?id=' + meta.components;
var nameid = meta.name.slug();
var relative = 'ui-' + (removeprev ? (nameid + '-') : '') + url.makeid() + '.min.js';
var filename = PATH.public(relative);

REPO[name] = '/' + relative;
REPO[meta.name] = '/' + relative;

if (removeprev) {
F.Fs.readdir(PATH.public(), function(err, files) {
Expand Down

0 comments on commit 23ae9d8

Please sign in to comment.