Skip to content

Commit

Permalink
Header plugin (#348)
Browse files Browse the repository at this point in the history
* isFunction function

* use header from cdn
  • Loading branch information
talyguryn authored Jul 28, 2018
1 parent 46bc5db commit 3ba88fa
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 422 deletions.
16 changes: 14 additions & 2 deletions build/codex-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -11259,8 +11259,8 @@ var CodexEditor = function () {
for (var toolName in this.config.tools) {
var tool = this.config.tools[toolName];

if (!_.isClass(tool) && !_.isClass(tool.class)) {
return Promise.reject('Tool \xAB' + toolName + '\xBB must be a class or an object with a \xABclass\xBB property');
if (!_.isFunction(tool) && !_.isFunction(tool.class)) {
return Promise.reject('Tool \xAB' + toolName + '\xBB must be a constructor function or an object with that function in the \xABclass\xBB property');
}
}

Expand Down Expand Up @@ -20451,6 +20451,18 @@ var Util = function () {
return Array.prototype.slice.call(collection);
}

/**
* Check if passed variable is a function
* @param {*} fn
* @return {boolean}
*/

}, {
key: 'isFunction',
value: function isFunction(fn) {
return typeof fn === 'function';
}

/**
* Check if passed function is a class
* @param {function} fn
Expand Down
2 changes: 1 addition & 1 deletion build/codex-editor.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions example/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
<script src="plugins/header/header.js?v=100"></script>
<link rel="stylesheet" href="plugins/header/header.css">

<script src="https://cdn.rawgit.com/codex-editor/header/25d39a1e/dist/bundle.js"></script>

<script src="plugins/simple-image/simple-image.js?v=100"></script>
<link rel="stylesheet" href="plugins/simple-image/simple-image.css">

Expand Down
20 changes: 0 additions & 20 deletions example/plugins/header/header.css

This file was deleted.

Loading

0 comments on commit 3ba88fa

Please sign in to comment.