Skip to content

Commit

Permalink
include waveSkin inti unpkg module
Browse files Browse the repository at this point in the history
  • Loading branch information
drom committed Sep 26, 2018
1 parent 1d37e3f commit ffaeb5a
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 121 deletions.
14 changes: 9 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
'use strict';

var processAll = require('./process-all'),
eva = require('./eva'),
renderWaveForm = require('./render-wave-form'),
renderWaveElement = require('./render-wave-element'),
editorRefresh = require('./editor-refresh');
var processAll = require('./process-all');
var eva = require('./eva');
var renderWaveForm = require('./render-wave-form');
var renderWaveElement = require('./render-wave-element');
var editorRefresh = require('./editor-refresh');
var def = require('../skins/default.js');

exports.processAll = processAll;
exports.eva = eva;
exports.renderWaveForm = renderWaveForm;
exports.renderWaveElement = renderWaveElement;
exports.editorRefresh = editorRefresh;
exports.waveSkin = {
default: def
};
8 changes: 4 additions & 4 deletions lib/insert-svg-template.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict';

var jsonmlParse = require('./create-element'),
w3 = require('./w3'),
waveSkin = require('./wave-skin');
var jsonmlParse = require('./create-element');
var w3 = require('./w3');
// var waveSkin = require('./wave-skin');

function insertSVGTemplate (index, parent, source, lane) {
function insertSVGTemplate (index, parent, source, lane, waveSkin) {
var node, first, e;

// cleanup
Expand Down
4 changes: 2 additions & 2 deletions lib/render-wave-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ function findFirstChildByTagName (parent, name) {
}
}

function renderWaveElement (index, source, outputElement) {
function renderWaveElement (index, source, outputElement, waveSkin) {
var width, height, xmax = 0, i;

if (source.signal) {

insertSVGTemplate(index, outputElement, source, lane);
insertSVGTemplate(index, outputElement, source, lane, waveSkin);
parseConfig(source, lane);

var ret = rec(source.signal, {'x':0, 'y':0, 'xmax':0, 'width':[], 'lanes':[], 'groups':[]});
Expand Down
2 changes: 1 addition & 1 deletion lib/render-wave-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var renderWaveElement = require('./render-wave-element');

function renderWaveForm (index, source, output) {
renderWaveElement(index, source, document.getElementById(output + index));
renderWaveElement(index, source, document.getElementById(output + index), window.WaveSkin);
}

module.exports = renderWaveForm;
13 changes: 8 additions & 5 deletions lib/wave-drom.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

window.WaveDrom = window.WaveDrom || {};

var index = require('./');
var processAll = require('./process-all');
var eva = require('./eva');
var renderWaveForm = require('./render-wave-form');
var editorRefresh = require('./editor-refresh');

window.WaveDrom.ProcessAll = index.processAll;
window.WaveDrom.RenderWaveForm = index.renderWaveForm;
window.WaveDrom.EditorRefresh = index.editorRefresh;
window.WaveDrom.eva = index.eva;
window.WaveDrom.ProcessAll = processAll;
window.WaveDrom.RenderWaveForm = renderWaveForm;
window.WaveDrom.EditorRefresh = editorRefresh;
window.WaveDrom.eva = eva;
4 changes: 3 additions & 1 deletion lib/wave-skin.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = window.WaveSkin;
var def = require('../skins/default.js');

module.exports = def; // window.WaveSkin;
Loading

0 comments on commit ffaeb5a

Please sign in to comment.