1 define(['libs/jquery-1.9.1.min', 'libs/underscore-min', 'utils/wlxml', 'libs/text!./template.html'], function($, _, wlxmlUtils, template) {
5 return function(sandbox) {
8 node: $(_.template(template)({tagNames: wlxmlUtils.wlxmlTagNames, classNames: wlxmlUtils.wlxmlClassNames})),
12 this.node.find('button').click(function(e) {
14 var btn = $(e.currentTarget),
15 btnName = btn.attr('data-name'),
16 meta = btn.attr('data-meta'),
20 if(btn.attr('data-btn-type') === 'toggle') {
21 command = 'toggle-' + command;
22 btn.toggleClass('active');
23 params.toggle = btn.hasClass('active');
26 if(btnName === 'new-node') {
27 command = 'newNodeRequested';
28 params.wlxmlTag = view.getOption('newTag-tag');
29 params.wlxmlClass = view.getOption('newTag-class');
31 var split = meta.split('/');
32 params.wlxmlTag = split[0];
33 params.wlxmlClass = split[1];
39 sandbox.publish('command', command, params);
42 getOption: function(option) {
43 return this.node.find('.rng-module-documentToolbar-toolbarOption[data-option=' + option +']').val();
50 start: function() { sandbox.publish('ready'); },
51 getView: function() { return view.node; },
52 getOption: function(option) { return view.getOption(option); }