You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 30, 2018. It is now read-only.
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 */varpluginName='mediumInsert',addonName='CustomAddon',// first char is uppercasedefaults={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} */functionCustomAddon(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(){returnthis.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){returnthis.each(function(){if(!$.data(this,'plugin_'+pluginName+addonName)){$.data(this,'plugin_'+pluginName+addonName,newCustomAddon(this,options));}});};})(jQuery,window,document);
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...