Skip to content

Instantly share code, notes, and snippets.

@wizhippo
Last active June 10, 2016 13:48
Show Gist options
  • Save wizhippo/95c2b9e41c1c942ca7a47aaf50c825bf to your computer and use it in GitHub Desktop.
Save wizhippo/95c2b9e41c1c942ca7a47aaf50c825bf to your computer and use it in GitHub Desktop.
YUI.add('wizhippo-editcontentviewplugin', function (Y) {
"use strict";
Y.namespace('Wizhippo.Plugin');
Y.Wizhippo.Plugin.WizhippoContentEditView = Y.Base.create('wizhippoContentEditView', Y.Plugin.Base, [], {
initializer: function () {
var view = this.get('host');
var actionBar = view.get('actionBar');
var actionsList = actionBar.get('actionsList');
actionsList.unshift(
new Y.eZ.ButtonActionView({
actionId: "deferredPublish",
disabled: false,
label: "Deferred Publish",
bubbleTargets: view
})
);
view.on('*:deferredPublishAction', view._handleSavePublish);
},
}, {
NS: 'wizhippoContentEditView',
});
Y.eZ.PluginRegistry.registerPlugin(
Y.Wizhippo.Plugin.WizhippoContentEditView, ['contentEditView', 'contentCreateView']
);
});
YUI.add('wizhippo-deferredpublishdraftplugin', function (Y) {
"use strict";
Y.namespace('Wizhippo.Plugin');
Y.Wizhippo.Plugin.DeferredPublishDraft = Y.Base.create('deferredPublishDraft', Y.eZ.Plugin.ViewServiceBase, [], {
initializer: function () {
this.onHostEvent('*:deferredPublishAction', this._deferredPublish);
},
_deferredPublish: function (e) {
Y.log('_deferredPublish');
},
}, {
NS: 'deferredPublishDraft',
});
Y.eZ.PluginRegistry.registerPlugin(
Y.Wizhippo.Plugin.DeferredPublishDraft, ['contentEditViewService', 'contentCreateViewService']
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment