willviles / ember-medium-editor-button Goto Github PK
View Code? Open in Web Editor NEWAn extension to Ember CLI Medium Editor to enable custom buttons with the MediumButton plugin
License: MIT License
An extension to Ember CLI Medium Editor to enable custom buttons with the MediumButton plugin
License: MIT License
Change Ember Medium Editor Insert from being compatible with the (seemingly dead) Ember CLI Medium Editor to Ember Medium Editor.
Would be awesome to have like a simple DSL for it...
Something like this structure, but it somehow adds a new ember-medium-insert-plugin addon.
I understand the structure of an insert-plugin addon is something like this since it's basically jQuery I think...
;(function ($, window, document, undefined) {
'use strict';
/** Default values */
var pluginName = 'mediumInsert',
addonName = 'CustomAddon', // first char is uppercase
defaults = {
label: '<span class="fa fa-plus-circle"></span>'
};
/**
* Custom Addon object
*
* Sets options, variables and calls init() function
*
* @constructor
* @param {DOM} el - DOM element to init the plugin on
* @param {object} options - Options to override defaults
* @return {void}
*/
function CustomAddon (el, options) {
this.el = el;
this.$el = $(el);
this.templates = window.MediumInsert.Templates;
this.core = this.$el.data('plugin_'+ pluginName);
this.options = $.extend(true, {}, defaults, options);
this._defaults = defaults;
this._name = pluginName;
this.init();
}
/**
* Initialization
*
* @return {void}
*/
CustomAddon.prototype.init = function () {
this.events();
};
/**
* Event listeners
*
* @return {void}
*/
CustomAddon.prototype.events = function () {
};
/**
* Get the Core object
*
* @return {object} Core object
*/
CustomAddon.prototype.getCore = function () {
return this.core;
};
/**
* Add custom content
*
* This function is called when user click on the addon's icon
*
* @return {void}
*/
CustomAddon.prototype.add = function () {
};
/** Addon initialization */
$.fn[pluginName + addonName] = function (options) {
return this.each(function () {
if (!$.data(this, 'plugin_' + pluginName + addonName)) {
$.data(this, 'plugin_' + pluginName + addonName, new CustomAddon(this, options));
}
});
};
})(jQuery, window, document);
The current ember-cli-fastboot
releases (1.0.0-rc.1 and above) introduce breaking changes. These will most likely break your current FastBoot implementation.
See ember-fastboot/ember-cli-fastboot#387 for more information and a guide on how to fix your addon. Also you may want to visit the -fastboot
Slack channel to get help from other users.
Note: this issue has been created automatically, by searching for certain patterns in your code. If you think this has been falsely created, feel free to close!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.