var base_url = window.location.origin; (function() { var tab_template; tab_template = '

Panel Heading

Panel body
'; SirTrevor.Blocks.Accordion = SirTrevor.Block.extend({ type: "accordion", title: 'Accordion', editorHTML: '
', icon_name: 'accordion', controllable: true, constructor: function(data, instance_id, sirTrevor) { this.controls = { 'add': this.addPanel }; return SirTrevor.Block.apply(this, arguments); }, addPanel: function() { this.$('.panel-group').append(tab_template); return this._initTextBlocks(); }, onBlockRender: function() { if (this.$('.panel-group').children('.panel').length === 0) { this.$('.panel-group').append(tab_template); this._initTextBlocks(true); } this.$('.panel-group').on('click', 'button.close', function() { if (confirm('Are you sure you want to remove this panel?')) { return $(this).closest('.panel').trigger('destroy').remove(); } }); return new Sortable(this.$('.panel-group')[0], { handle: '.reorder', draggable: '.panel' }); }, toData: function() { var data; data = { panels: [] }; this.$('.panel').each(function() { return data.panels.push({ title: $(this).find('.panel-title > a').html(), body: $(this).find('.panel-body').html() }); }); return this.setData(data); }, loadData: function(data) { var $panel, panel, _i, _len, _ref, _results; if (typeof data !== 'undefined') { this.$('.panel').remove(); _ref = data.panels; _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { panel = _ref[_i]; $panel = $(tab_template); $panel.find('.panel-title > a').html(panel.title); $panel.find('.panel-body').html(panel.body); _results.push(this.$('.panel-group').append($panel)); } return _results; } } }); }).call(this); (function() { var button_template, __hasProp = {}.hasOwnProperty; button_template = ''; SirTrevor.Blocks.Button = SirTrevor.Block.extend({ button_sizes: { 'btn-xs': 'X-Small', 'btn-sm': 'Small', '': 'Default', 'btn-lg': 'Large' }, button_styles: { 'btn-default': 'Default', 'btn-primary': 'Primary', 'btn-success': 'Success', 'btn-info': 'Info', 'btn-warning': 'Warning', 'btn-danger': 'Danger' }, type: "button", title: 'Button', editorHTML: '
' + button_template + '
', icon_name: 'button', loadData: function(data) { return this.$find('.btn').html(SirTrevor.toHTML(data.text, this.type)); }, _setBlockInner: function() { var $sizes_select, $styles_select, size, size_class, style, style_class, _ref, _ref1; SirTrevor.Block.prototype._setBlockInner.apply(this, arguments); $styles_select = this.$('[name=style]'); _ref = this.button_styles; for (style_class in _ref) { if (!__hasProp.call(_ref, style_class)) continue; style = _ref[style_class]; $styles_select.append($('