Upgrade to flarum-gulp 0.2.0 / Babel 6

This commit is contained in:
Toby Zerner 2016-03-18 09:34:13 +10:30
parent 94cfc5e535
commit 19bf6667f0
4 changed files with 581 additions and 591 deletions

View File

@ -412,19 +412,11 @@ $.fn.sortable = function(options) {
return sortable; return sortable;
})); }));
; ;
System.register('flarum/tags/addTagChangePermission', ['flarum/extend', 'flarum/components/PermissionGrid', 'flarum/components/SettingDropdown'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/addTagChangePermission', ['flarum/extend', 'flarum/components/PermissionGrid', 'flarum/components/SettingDropdown'], function (_export, _context) {
var extend, PermissionGrid, SettingDropdown; var extend, PermissionGrid, SettingDropdown;
return {
setters: [function (_flarumExtend) {
extend = _flarumExtend.extend;
}, function (_flarumComponentsPermissionGrid) {
PermissionGrid = _flarumComponentsPermissionGrid['default'];
}, function (_flarumComponentsSettingDropdown) {
SettingDropdown = _flarumComponentsSettingDropdown['default'];
}],
execute: function () {
_export('default', function () { _export('default', function () {
extend(PermissionGrid.prototype, 'startItems', function (items) { extend(PermissionGrid.prototype, 'startItems', function (items) {
items.add('allowTagChange', { items.add('allowTagChange', {
@ -442,20 +434,23 @@ System.register('flarum/tags/addTagChangePermission', ['flarum/extend', 'flarum/
}, 90); }, 90);
}); });
}); });
}
};
});;
System.register('flarum/tags/addTagPermission', ['flarum/extend', 'flarum/components/PermissionGrid'], function (_export) {
'use strict';
var extend, PermissionGrid;
return { return {
setters: [function (_flarumExtend) { setters: [function (_flarumExtend) {
extend = _flarumExtend.extend; extend = _flarumExtend.extend;
}, function (_flarumComponentsPermissionGrid) { }, function (_flarumComponentsPermissionGrid) {
PermissionGrid = _flarumComponentsPermissionGrid['default']; PermissionGrid = _flarumComponentsPermissionGrid.default;
}, function (_flarumComponentsSettingDropdown) {
SettingDropdown = _flarumComponentsSettingDropdown.default;
}], }],
execute: function () { execute: function () {}
};
});;
'use strict';
System.register('flarum/tags/addTagPermission', ['flarum/extend', 'flarum/components/PermissionGrid'], function (_export, _context) {
var extend, PermissionGrid;
_export('default', function () { _export('default', function () {
extend(PermissionGrid.prototype, 'moderateItems', function (items) { extend(PermissionGrid.prototype, 'moderateItems', function (items) {
items.add('tag', { items.add('tag', {
@ -465,20 +460,21 @@ System.register('flarum/tags/addTagPermission', ['flarum/extend', 'flarum/compon
}, 95); }, 95);
}); });
}); });
}
};
});;
System.register('flarum/tags/addTagsHomePageOption', ['flarum/extend', 'flarum/components/BasicsPage'], function (_export) {
'use strict';
var extend, BasicsPage;
return { return {
setters: [function (_flarumExtend) { setters: [function (_flarumExtend) {
extend = _flarumExtend.extend; extend = _flarumExtend.extend;
}, function (_flarumComponentsBasicsPage) { }, function (_flarumComponentsPermissionGrid) {
BasicsPage = _flarumComponentsBasicsPage['default']; PermissionGrid = _flarumComponentsPermissionGrid.default;
}], }],
execute: function () { execute: function () {}
};
});;
'use strict';
System.register('flarum/tags/addTagsHomePageOption', ['flarum/extend', 'flarum/components/BasicsPage'], function (_export, _context) {
var extend, BasicsPage;
_export('default', function () { _export('default', function () {
extend(BasicsPage.prototype, 'homePageItems', function (items) { extend(BasicsPage.prototype, 'homePageItems', function (items) {
items.add('tags', { items.add('tags', {
@ -487,24 +483,21 @@ System.register('flarum/tags/addTagsHomePageOption', ['flarum/extend', 'flarum/c
}); });
}); });
}); });
}
};
});;
System.register('flarum/tags/addTagsPane', ['flarum/extend', 'flarum/components/AdminNav', 'flarum/components/AdminLinkButton', 'flarum/tags/components/TagsPage'], function (_export) {
'use strict';
var extend, AdminNav, AdminLinkButton, TagsPage;
return { return {
setters: [function (_flarumExtend) { setters: [function (_flarumExtend) {
extend = _flarumExtend.extend; extend = _flarumExtend.extend;
}, function (_flarumComponentsAdminNav) { }, function (_flarumComponentsBasicsPage) {
AdminNav = _flarumComponentsAdminNav['default']; BasicsPage = _flarumComponentsBasicsPage.default;
}, function (_flarumComponentsAdminLinkButton) {
AdminLinkButton = _flarumComponentsAdminLinkButton['default'];
}, function (_flarumTagsComponentsTagsPage) {
TagsPage = _flarumTagsComponentsTagsPage['default'];
}], }],
execute: function () { execute: function () {}
};
});;
'use strict';
System.register('flarum/tags/addTagsPane', ['flarum/extend', 'flarum/components/AdminNav', 'flarum/components/AdminLinkButton', 'flarum/tags/components/TagsPage'], function (_export, _context) {
var extend, AdminNav, AdminLinkButton, TagsPage;
_export('default', function () { _export('default', function () {
app.routes.tags = { path: '/tags', component: TagsPage.component() }; app.routes.tags = { path: '/tags', component: TagsPage.component() };
@ -521,32 +514,25 @@ System.register('flarum/tags/addTagsPane', ['flarum/extend', 'flarum/components/
})); }));
}); });
}); });
}
};
});;
System.register('flarum/tags/addTagsPermissionScope', ['flarum/extend', 'flarum/components/PermissionGrid', 'flarum/components/PermissionDropdown', 'flarum/components/Dropdown', 'flarum/components/Button', 'flarum/tags/helpers/tagLabel', 'flarum/tags/helpers/tagIcon', 'flarum/tags/utils/sortTags'], function (_export) {
'use strict';
var extend, PermissionGrid, PermissionDropdown, Dropdown, Button, tagLabel, tagIcon, sortTags;
return { return {
setters: [function (_flarumExtend) { setters: [function (_flarumExtend) {
extend = _flarumExtend.extend; extend = _flarumExtend.extend;
}, function (_flarumComponentsPermissionGrid) { }, function (_flarumComponentsAdminNav) {
PermissionGrid = _flarumComponentsPermissionGrid['default']; AdminNav = _flarumComponentsAdminNav.default;
}, function (_flarumComponentsPermissionDropdown) { }, function (_flarumComponentsAdminLinkButton) {
PermissionDropdown = _flarumComponentsPermissionDropdown['default']; AdminLinkButton = _flarumComponentsAdminLinkButton.default;
}, function (_flarumComponentsDropdown) { }, function (_flarumTagsComponentsTagsPage) {
Dropdown = _flarumComponentsDropdown['default']; TagsPage = _flarumTagsComponentsTagsPage.default;
}, function (_flarumComponentsButton) {
Button = _flarumComponentsButton['default'];
}, function (_flarumTagsHelpersTagLabel) {
tagLabel = _flarumTagsHelpersTagLabel['default'];
}, function (_flarumTagsHelpersTagIcon) {
tagIcon = _flarumTagsHelpersTagIcon['default'];
}, function (_flarumTagsUtilsSortTags) {
sortTags = _flarumTagsUtilsSortTags['default'];
}], }],
execute: function () { execute: function () {}
};
});;
'use strict';
System.register('flarum/tags/addTagsPermissionScope', ['flarum/extend', 'flarum/components/PermissionGrid', 'flarum/components/PermissionDropdown', 'flarum/components/Dropdown', 'flarum/components/Button', 'flarum/tags/helpers/tagLabel', 'flarum/tags/helpers/tagIcon', 'flarum/tags/utils/sortTags'], function (_export, _context) {
var extend, PermissionGrid, PermissionDropdown, Dropdown, Button, tagLabel, tagIcon, sortTags;
_export('default', function () { _export('default', function () {
extend(PermissionGrid.prototype, 'scopeItems', function (items) { extend(PermissionGrid.prototype, 'scopeItems', function (items) {
sortTags(app.store.all('tags')).filter(function (tag) { sortTags(app.store.all('tags')).filter(function (tag) {
@ -596,35 +582,49 @@ System.register('flarum/tags/addTagsPermissionScope', ['flarum/extend', 'flarum/
} }
}); });
}); });
}
return {
setters: [function (_flarumExtend) {
extend = _flarumExtend.extend;
}, function (_flarumComponentsPermissionGrid) {
PermissionGrid = _flarumComponentsPermissionGrid.default;
}, function (_flarumComponentsPermissionDropdown) {
PermissionDropdown = _flarumComponentsPermissionDropdown.default;
}, function (_flarumComponentsDropdown) {
Dropdown = _flarumComponentsDropdown.default;
}, function (_flarumComponentsButton) {
Button = _flarumComponentsButton.default;
}, function (_flarumTagsHelpersTagLabel) {
tagLabel = _flarumTagsHelpersTagLabel.default;
}, function (_flarumTagsHelpersTagIcon) {
tagIcon = _flarumTagsHelpersTagIcon.default;
}, function (_flarumTagsUtilsSortTags) {
sortTags = _flarumTagsUtilsSortTags.default;
}],
execute: function () {}
}; };
});; });;
System.register('flarum/tags/components/EditTagModal', ['flarum/components/Modal', 'flarum/components/Button', 'flarum/utils/string', 'flarum/tags/helpers/tagLabel'], function (_export) {
/**
* The `EditTagModal` component shows a modal dialog which allows the user
* to create or edit a tag.
*/
'use strict'; 'use strict';
System.register('flarum/tags/components/EditTagModal', ['flarum/components/Modal', 'flarum/components/Button', 'flarum/utils/string', 'flarum/tags/helpers/tagLabel'], function (_export, _context) {
var Modal, Button, slug, tagLabel, EditTagModal; var Modal, Button, slug, tagLabel, EditTagModal;
return { return {
setters: [function (_flarumComponentsModal) { setters: [function (_flarumComponentsModal) {
Modal = _flarumComponentsModal['default']; Modal = _flarumComponentsModal.default;
}, function (_flarumComponentsButton) { }, function (_flarumComponentsButton) {
Button = _flarumComponentsButton['default']; Button = _flarumComponentsButton.default;
}, function (_flarumUtilsString) { }, function (_flarumUtilsString) {
slug = _flarumUtilsString.slug; slug = _flarumUtilsString.slug;
}, function (_flarumTagsHelpersTagLabel) { }, function (_flarumTagsHelpersTagLabel) {
tagLabel = _flarumTagsHelpersTagLabel['default']; tagLabel = _flarumTagsHelpersTagLabel.default;
}], }],
execute: function () { execute: function () {
EditTagModal = (function (_Modal) { EditTagModal = function (_Modal) {
babelHelpers.inherits(EditTagModal, _Modal); babelHelpers.inherits(EditTagModal, _Modal);
function EditTagModal() { function EditTagModal() {
babelHelpers.classCallCheck(this, EditTagModal); babelHelpers.classCallCheck(this, EditTagModal);
babelHelpers.get(Object.getPrototypeOf(EditTagModal.prototype), 'constructor', this).apply(this, arguments); return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(EditTagModal).apply(this, arguments));
} }
babelHelpers.createClass(EditTagModal, [{ babelHelpers.createClass(EditTagModal, [{
@ -656,7 +656,7 @@ System.register('flarum/tags/components/EditTagModal', ['flarum/components/Modal
}, { }, {
key: 'content', key: 'content',
value: function content() { value: function content() {
var _this = this; var _this2 = this;
return m( return m(
'div', 'div',
@ -672,9 +672,9 @@ System.register('flarum/tags/components/EditTagModal', ['flarum/components/Modal
null, null,
app.translator.trans('flarum-tags.admin.edit_tag.name_label') app.translator.trans('flarum-tags.admin.edit_tag.name_label')
), ),
m('input', { className: 'FormControl', placeholder: app.translator.trans('flarum-tags.admin.edit_tag.name_placeholder'), value: this.name(), oninput: function (e) { m('input', { className: 'FormControl', placeholder: app.translator.trans('flarum-tags.admin.edit_tag.name_placeholder'), value: this.name(), oninput: function oninput(e) {
_this.name(e.target.value); _this2.name(e.target.value);
_this.slug(slug(e.target.value)); _this2.slug(slug(e.target.value));
} }) } })
), ),
m( m(
@ -732,7 +732,7 @@ System.register('flarum/tags/components/EditTagModal', ['flarum/components/Modal
}), }),
this.tag.exists ? m( this.tag.exists ? m(
'button', 'button',
{ type: 'button', className: 'Button EditTagModal-delete', onclick: this['delete'].bind(this) }, { type: 'button', className: 'Button EditTagModal-delete', onclick: this.delete.bind(this) },
app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_button') app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_button')
) : '' ) : ''
) )
@ -742,7 +742,7 @@ System.register('flarum/tags/components/EditTagModal', ['flarum/components/Modal
}, { }, {
key: 'onsubmit', key: 'onsubmit',
value: function onsubmit(e) { value: function onsubmit(e) {
var _this2 = this; var _this3 = this;
e.preventDefault(); e.preventDefault();
@ -755,17 +755,17 @@ System.register('flarum/tags/components/EditTagModal', ['flarum/components/Modal
color: this.color(), color: this.color(),
isHidden: this.isHidden() isHidden: this.isHidden()
}).then(function () { }).then(function () {
return _this2.hide(); return _this3.hide();
}, function (response) { }, function (response) {
_this2.loading = false; _this3.loading = false;
_this2.handleErrors(response); _this3.handleErrors(response);
}); });
} }
}, { }, {
key: 'delete', key: 'delete',
value: function _delete() { value: function _delete() {
if (confirm(app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_confirmation'))) { if (confirm(app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_confirmation'))) {
this.tag['delete']().then(function () { this.tag.delete().then(function () {
return m.redraw(); return m.redraw();
}); });
this.hide(); this.hide();
@ -773,27 +773,27 @@ System.register('flarum/tags/components/EditTagModal', ['flarum/components/Modal
} }
}]); }]);
return EditTagModal; return EditTagModal;
})(Modal); }(Modal);
_export('default', EditTagModal); _export('default', EditTagModal);
} }
}; };
});; });;
System.register('flarum/tags/components/TagSettingsModal', ['flarum/components/SettingsModal'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/components/TagSettingsModal', ['flarum/components/SettingsModal'], function (_export, _context) {
var SettingsModal, TagSettingsModal; var SettingsModal, TagSettingsModal;
return { return {
setters: [function (_flarumComponentsSettingsModal) { setters: [function (_flarumComponentsSettingsModal) {
SettingsModal = _flarumComponentsSettingsModal['default']; SettingsModal = _flarumComponentsSettingsModal.default;
}], }],
execute: function () { execute: function () {
TagSettingsModal = (function (_SettingsModal) { TagSettingsModal = function (_SettingsModal) {
babelHelpers.inherits(TagSettingsModal, _SettingsModal); babelHelpers.inherits(TagSettingsModal, _SettingsModal);
function TagSettingsModal() { function TagSettingsModal() {
babelHelpers.classCallCheck(this, TagSettingsModal); babelHelpers.classCallCheck(this, TagSettingsModal);
babelHelpers.get(Object.getPrototypeOf(TagSettingsModal.prototype), 'constructor', this).apply(this, arguments); return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(TagSettingsModal).apply(this, arguments));
} }
babelHelpers.createClass(TagSettingsModal, [{ babelHelpers.createClass(TagSettingsModal, [{
@ -879,17 +879,18 @@ System.register('flarum/tags/components/TagSettingsModal', ['flarum/components/S
} }
}]); }]);
return TagSettingsModal; return TagSettingsModal;
})(SettingsModal); }(SettingsModal);
_export('default', TagSettingsModal); _export('default', TagSettingsModal);
} }
}; };
});; });;
System.register('flarum/tags/components/TagsPage', ['flarum/components/Page', 'flarum/components/Button', 'flarum/tags/components/EditTagModal', 'flarum/tags/components/TagSettingsModal', 'flarum/tags/helpers/tagIcon', 'flarum/tags/utils/sortTags'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/components/TagsPage', ['flarum/components/Page', 'flarum/components/Button', 'flarum/tags/components/EditTagModal', 'flarum/tags/components/TagSettingsModal', 'flarum/tags/helpers/tagIcon', 'flarum/tags/utils/sortTags'], function (_export, _context) {
var Page, Button, EditTagModal, TagSettingsModal, tagIcon, sortTags, TagsPage; var Page, Button, EditTagModal, TagSettingsModal, tagIcon, sortTags, TagsPage;
function tagItem(tag) { function tagItem(tag) {
return m( return m(
'li', 'li',
@ -923,25 +924,25 @@ System.register('flarum/tags/components/TagsPage', ['flarum/components/Page', 'f
return { return {
setters: [function (_flarumComponentsPage) { setters: [function (_flarumComponentsPage) {
Page = _flarumComponentsPage['default']; Page = _flarumComponentsPage.default;
}, function (_flarumComponentsButton) { }, function (_flarumComponentsButton) {
Button = _flarumComponentsButton['default']; Button = _flarumComponentsButton.default;
}, function (_flarumTagsComponentsEditTagModal) { }, function (_flarumTagsComponentsEditTagModal) {
EditTagModal = _flarumTagsComponentsEditTagModal['default']; EditTagModal = _flarumTagsComponentsEditTagModal.default;
}, function (_flarumTagsComponentsTagSettingsModal) { }, function (_flarumTagsComponentsTagSettingsModal) {
TagSettingsModal = _flarumTagsComponentsTagSettingsModal['default']; TagSettingsModal = _flarumTagsComponentsTagSettingsModal.default;
}, function (_flarumTagsHelpersTagIcon) { }, function (_flarumTagsHelpersTagIcon) {
tagIcon = _flarumTagsHelpersTagIcon['default']; tagIcon = _flarumTagsHelpersTagIcon.default;
}, function (_flarumTagsUtilsSortTags) { }, function (_flarumTagsUtilsSortTags) {
sortTags = _flarumTagsUtilsSortTags['default']; sortTags = _flarumTagsUtilsSortTags.default;
}], }],
execute: function () { execute: function () {
TagsPage = (function (_Page) { TagsPage = function (_Page) {
babelHelpers.inherits(TagsPage, _Page); babelHelpers.inherits(TagsPage, _Page);
function TagsPage() { function TagsPage() {
babelHelpers.classCallCheck(this, TagsPage); babelHelpers.classCallCheck(this, TagsPage);
babelHelpers.get(Object.getPrototypeOf(TagsPage.prototype), 'constructor', this).apply(this, arguments); return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(TagsPage).apply(this, arguments));
} }
babelHelpers.createClass(TagsPage, [{ babelHelpers.createClass(TagsPage, [{
@ -1025,7 +1026,7 @@ System.register('flarum/tags/components/TagsPage', ['flarum/components/Page', 'f
}, { }, {
key: 'config', key: 'config',
value: function config() { value: function config() {
var _this = this; var _this2 = this;
this.$('ol, ul').sortable({ connectWith: 'primary' }).on('sortupdate', function (e, ui) { this.$('ol, ul').sortable({ connectWith: 'primary' }).on('sortupdate', function (e, ui) {
// If we've moved a tag from 'primary' to 'secondary', then we'll update // If we've moved a tag from 'primary' to 'secondary', then we'll update
@ -1043,7 +1044,7 @@ System.register('flarum/tags/components/TagsPage', ['flarum/components/Page', 'f
// Construct an array of primary tag IDs and their children, in the same // Construct an array of primary tag IDs and their children, in the same
// order that they have been arranged in. // order that they have been arranged in.
var order = _this.$('.TagList--primary > li').map(function () { var order = _this2.$('.TagList--primary > li').map(function () {
return { return {
id: $(this).data('id'), id: $(this).data('id'),
children: $(this).find('li').map(function () { children: $(this).find('li').map(function () {
@ -1091,17 +1092,15 @@ System.register('flarum/tags/components/TagsPage', ['flarum/components/Page', 'f
} }
}]); }]);
return TagsPage; return TagsPage;
})(Page); }(Page);
_export('default', TagsPage); _export('default', TagsPage);
} }
}; };
});; });;
System.register('flarum/tags/helpers/tagIcon', [], function (_export) {
'use strict'; 'use strict';
_export('default', tagIcon); System.register('flarum/tags/helpers/tagIcon', [], function (_export, _context) {
function tagIcon(tag) { function tagIcon(tag) {
var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
@ -1117,18 +1116,17 @@ System.register('flarum/tags/helpers/tagIcon', [], function (_export) {
return m('span', attrs); return m('span', attrs);
} }
_export('default', tagIcon);
return { return {
setters: [], setters: [],
execute: function () {} execute: function () {}
}; };
});; });;
System.register('flarum/tags/helpers/tagLabel', ['flarum/utils/extract'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/helpers/tagLabel', ['flarum/utils/extract'], function (_export, _context) {
var extract; var extract;
_export('default', tagLabel);
function tagLabel(tag) { function tagLabel(tag) {
var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
@ -1160,20 +1158,19 @@ System.register('flarum/tags/helpers/tagLabel', ['flarum/utils/extract'], functi
)); ));
} }
_export('default', tagLabel);
return { return {
setters: [function (_flarumUtilsExtract) { setters: [function (_flarumUtilsExtract) {
extract = _flarumUtilsExtract['default']; extract = _flarumUtilsExtract.default;
}], }],
execute: function () {} execute: function () {}
}; };
});; });;
System.register('flarum/tags/helpers/tagsLabel', ['flarum/utils/extract', 'flarum/tags/helpers/tagLabel', 'flarum/tags/utils/sortTags'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/helpers/tagsLabel', ['flarum/utils/extract', 'flarum/tags/helpers/tagLabel', 'flarum/tags/utils/sortTags'], function (_export, _context) {
var extract, tagLabel, sortTags; var extract, tagLabel, sortTags;
_export('default', tagsLabel);
function tagsLabel(tags) { function tagsLabel(tags) {
var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
@ -1199,34 +1196,36 @@ System.register('flarum/tags/helpers/tagsLabel', ['flarum/utils/extract', 'flaru
); );
} }
_export('default', tagsLabel);
return { return {
setters: [function (_flarumUtilsExtract) { setters: [function (_flarumUtilsExtract) {
extract = _flarumUtilsExtract['default']; extract = _flarumUtilsExtract.default;
}, function (_flarumTagsHelpersTagLabel) { }, function (_flarumTagsHelpersTagLabel) {
tagLabel = _flarumTagsHelpersTagLabel['default']; tagLabel = _flarumTagsHelpersTagLabel.default;
}, function (_flarumTagsUtilsSortTags) { }, function (_flarumTagsUtilsSortTags) {
sortTags = _flarumTagsUtilsSortTags['default']; sortTags = _flarumTagsUtilsSortTags.default;
}], }],
execute: function () {} execute: function () {}
}; };
});; });;
System.register('flarum/tags/main', ['flarum/tags/models/Tag', 'flarum/tags/addTagsPermissionScope', 'flarum/tags/addTagPermission', 'flarum/tags/addTagsPane', 'flarum/tags/addTagsHomePageOption', 'flarum/tags/addTagChangePermission'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/main', ['flarum/tags/models/Tag', 'flarum/tags/addTagsPermissionScope', 'flarum/tags/addTagPermission', 'flarum/tags/addTagsPane', 'flarum/tags/addTagsHomePageOption', 'flarum/tags/addTagChangePermission'], function (_export, _context) {
var Tag, addTagsPermissionScope, addTagPermission, addTagsPane, addTagsHomePageOption, addTagChangePermission; var Tag, addTagsPermissionScope, addTagPermission, addTagsPane, addTagsHomePageOption, addTagChangePermission;
return { return {
setters: [function (_flarumTagsModelsTag) { setters: [function (_flarumTagsModelsTag) {
Tag = _flarumTagsModelsTag['default']; Tag = _flarumTagsModelsTag.default;
}, function (_flarumTagsAddTagsPermissionScope) { }, function (_flarumTagsAddTagsPermissionScope) {
addTagsPermissionScope = _flarumTagsAddTagsPermissionScope['default']; addTagsPermissionScope = _flarumTagsAddTagsPermissionScope.default;
}, function (_flarumTagsAddTagPermission) { }, function (_flarumTagsAddTagPermission) {
addTagPermission = _flarumTagsAddTagPermission['default']; addTagPermission = _flarumTagsAddTagPermission.default;
}, function (_flarumTagsAddTagsPane) { }, function (_flarumTagsAddTagsPane) {
addTagsPane = _flarumTagsAddTagsPane['default']; addTagsPane = _flarumTagsAddTagsPane.default;
}, function (_flarumTagsAddTagsHomePageOption) { }, function (_flarumTagsAddTagsHomePageOption) {
addTagsHomePageOption = _flarumTagsAddTagsHomePageOption['default']; addTagsHomePageOption = _flarumTagsAddTagsHomePageOption.default;
}, function (_flarumTagsAddTagChangePermission) { }, function (_flarumTagsAddTagChangePermission) {
addTagChangePermission = _flarumTagsAddTagChangePermission['default']; addTagChangePermission = _flarumTagsAddTagChangePermission.default;
}], }],
execute: function () { execute: function () {
@ -1242,29 +1241,29 @@ System.register('flarum/tags/main', ['flarum/tags/models/Tag', 'flarum/tags/addT
} }
}; };
});; });;
System.register('flarum/tags/models/Tag', ['flarum/Model', 'flarum/utils/mixin', 'flarum/utils/computed'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/models/Tag', ['flarum/Model', 'flarum/utils/mixin', 'flarum/utils/computed'], function (_export, _context) {
var Model, mixin, computed, Tag; var Model, mixin, computed, Tag;
return { return {
setters: [function (_flarumModel) { setters: [function (_flarumModel) {
Model = _flarumModel['default']; Model = _flarumModel.default;
}, function (_flarumUtilsMixin) { }, function (_flarumUtilsMixin) {
mixin = _flarumUtilsMixin['default']; mixin = _flarumUtilsMixin.default;
}, function (_flarumUtilsComputed) { }, function (_flarumUtilsComputed) {
computed = _flarumUtilsComputed['default']; computed = _flarumUtilsComputed.default;
}], }],
execute: function () { execute: function () {
Tag = (function (_mixin) { Tag = function (_mixin) {
babelHelpers.inherits(Tag, _mixin); babelHelpers.inherits(Tag, _mixin);
function Tag() { function Tag() {
babelHelpers.classCallCheck(this, Tag); babelHelpers.classCallCheck(this, Tag);
babelHelpers.get(Object.getPrototypeOf(Tag.prototype), 'constructor', this).apply(this, arguments); return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(Tag).apply(this, arguments));
} }
return Tag; return Tag;
})(mixin(Model, { }(mixin(Model, {
name: Model.attribute('name'), name: Model.attribute('name'),
slug: Model.attribute('slug'), slug: Model.attribute('slug'),
description: Model.attribute('description'), description: Model.attribute('description'),
@ -1295,11 +1294,9 @@ System.register('flarum/tags/models/Tag', ['flarum/Model', 'flarum/utils/mixin',
} }
}; };
});; });;
System.register("flarum/tags/utils/sortTags", [], function (_export) {
"use strict"; "use strict";
_export("default", sortTags); System.register("flarum/tags/utils/sortTags", [], function (_export, _context) {
function sortTags(tags) { function sortTags(tags) {
return tags.slice(0).sort(function (a, b) { return tags.slice(0).sort(function (a, b) {
var aPos = a.position(); var aPos = a.position();
@ -1336,6 +1333,8 @@ System.register("flarum/tags/utils/sortTags", [], function (_export) {
}); });
} }
_export("default", sortTags);
return { return {
setters: [], setters: [],
execute: function () {} execute: function () {}

View File

@ -1,7 +1,7 @@
{ {
"private": true, "private": true,
"devDependencies": { "devDependencies": {
"gulp": "^3.8.11", "gulp": "^3.9.1",
"flarum-gulp": "^0.1.0" "flarum-gulp": "^0.2.0"
} }
} }

View File

@ -1,21 +1,8 @@
System.register('flarum/tags/addTagComposer', ['flarum/extend', 'flarum/components/IndexPage', 'flarum/components/DiscussionComposer', 'flarum/tags/components/TagDiscussionModal', 'flarum/tags/helpers/tagsLabel'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/addTagComposer', ['flarum/extend', 'flarum/components/IndexPage', 'flarum/components/DiscussionComposer', 'flarum/tags/components/TagDiscussionModal', 'flarum/tags/helpers/tagsLabel'], function (_export, _context) {
var extend, override, IndexPage, DiscussionComposer, TagDiscussionModal, tagsLabel; var extend, override, IndexPage, DiscussionComposer, TagDiscussionModal, tagsLabel;
return {
setters: [function (_flarumExtend) {
extend = _flarumExtend.extend;
override = _flarumExtend.override;
}, function (_flarumComponentsIndexPage) {
IndexPage = _flarumComponentsIndexPage['default'];
}, function (_flarumComponentsDiscussionComposer) {
DiscussionComposer = _flarumComponentsDiscussionComposer['default'];
}, function (_flarumTagsComponentsTagDiscussionModal) {
TagDiscussionModal = _flarumTagsComponentsTagDiscussionModal['default'];
}, function (_flarumTagsHelpersTagsLabel) {
tagsLabel = _flarumTagsHelpersTagsLabel['default'];
}],
execute: function () {
_export('default', function () { _export('default', function () {
extend(IndexPage.prototype, 'composeNewDiscussion', function (promise) { extend(IndexPage.prototype, 'composeNewDiscussion', function (promise) {
var tag = app.store.getBy('tags', 'slug', this.params().tags); var tag = app.store.getBy('tags', 'slug', this.params().tags);
@ -81,24 +68,28 @@ System.register('flarum/tags/addTagComposer', ['flarum/extend', 'flarum/componen
data.relationships.tags = this.tags; data.relationships.tags = this.tags;
}); });
}); });
}
};
});;
System.register('flarum/tags/addTagControl', ['flarum/extend', 'flarum/utils/DiscussionControls', 'flarum/components/Button', 'flarum/tags/components/TagDiscussionModal'], function (_export) {
'use strict';
var extend, DiscussionControls, Button, TagDiscussionModal;
return { return {
setters: [function (_flarumExtend) { setters: [function (_flarumExtend) {
extend = _flarumExtend.extend; extend = _flarumExtend.extend;
}, function (_flarumUtilsDiscussionControls) { override = _flarumExtend.override;
DiscussionControls = _flarumUtilsDiscussionControls['default']; }, function (_flarumComponentsIndexPage) {
}, function (_flarumComponentsButton) { IndexPage = _flarumComponentsIndexPage.default;
Button = _flarumComponentsButton['default']; }, function (_flarumComponentsDiscussionComposer) {
DiscussionComposer = _flarumComponentsDiscussionComposer.default;
}, function (_flarumTagsComponentsTagDiscussionModal) { }, function (_flarumTagsComponentsTagDiscussionModal) {
TagDiscussionModal = _flarumTagsComponentsTagDiscussionModal['default']; TagDiscussionModal = _flarumTagsComponentsTagDiscussionModal.default;
}, function (_flarumTagsHelpersTagsLabel) {
tagsLabel = _flarumTagsHelpersTagsLabel.default;
}], }],
execute: function () { execute: function () {}
};
});;
'use strict';
System.register('flarum/tags/addTagControl', ['flarum/extend', 'flarum/utils/DiscussionControls', 'flarum/components/Button', 'flarum/tags/components/TagDiscussionModal'], function (_export, _context) {
var extend, DiscussionControls, Button, TagDiscussionModal;
_export('default', function () { _export('default', function () {
// Add a control allowing the discussion to be moved to another category. // Add a control allowing the discussion to be moved to another category.
extend(DiscussionControls, 'moderationControls', function (items, discussion) { extend(DiscussionControls, 'moderationControls', function (items, discussion) {
@ -113,25 +104,25 @@ System.register('flarum/tags/addTagControl', ['flarum/extend', 'flarum/utils/Dis
} }
}); });
}); });
}
};
});;
System.register('flarum/tags/addTagFilter', ['flarum/extend', 'flarum/components/IndexPage', 'flarum/components/DiscussionList', 'flarum/tags/components/TagHero'], function (_export) {
'use strict';
var extend, override, IndexPage, DiscussionList, TagHero;
return { return {
setters: [function (_flarumExtend) { setters: [function (_flarumExtend) {
extend = _flarumExtend.extend; extend = _flarumExtend.extend;
override = _flarumExtend.override; }, function (_flarumUtilsDiscussionControls) {
}, function (_flarumComponentsIndexPage) { DiscussionControls = _flarumUtilsDiscussionControls.default;
IndexPage = _flarumComponentsIndexPage['default']; }, function (_flarumComponentsButton) {
}, function (_flarumComponentsDiscussionList) { Button = _flarumComponentsButton.default;
DiscussionList = _flarumComponentsDiscussionList['default']; }, function (_flarumTagsComponentsTagDiscussionModal) {
}, function (_flarumTagsComponentsTagHero) { TagDiscussionModal = _flarumTagsComponentsTagDiscussionModal.default;
TagHero = _flarumTagsComponentsTagHero['default'];
}], }],
execute: function () { execute: function () {}
};
});;
'use strict';
System.register('flarum/tags/addTagFilter', ['flarum/extend', 'flarum/components/IndexPage', 'flarum/components/DiscussionList', 'flarum/tags/components/TagHero'], function (_export, _context) {
var extend, override, IndexPage, DiscussionList, TagHero;
_export('default', function () { _export('default', function () {
IndexPage.prototype.currentTag = function () { IndexPage.prototype.currentTag = function () {
var slug = this.params().tags; var slug = this.params().tags;
@ -177,28 +168,26 @@ System.register('flarum/tags/addTagFilter', ['flarum/extend', 'flarum/components
} }
}); });
}); });
}
};
});;
System.register('flarum/tags/addTagLabels', ['flarum/extend', 'flarum/components/DiscussionListItem', 'flarum/components/DiscussionPage', 'flarum/components/DiscussionHero', 'flarum/tags/helpers/tagsLabel', 'flarum/tags/utils/sortTags'], function (_export) {
'use strict';
var extend, DiscussionListItem, DiscussionPage, DiscussionHero, tagsLabel, sortTags;
return { return {
setters: [function (_flarumExtend) { setters: [function (_flarumExtend) {
extend = _flarumExtend.extend; extend = _flarumExtend.extend;
}, function (_flarumComponentsDiscussionListItem) { override = _flarumExtend.override;
DiscussionListItem = _flarumComponentsDiscussionListItem['default']; }, function (_flarumComponentsIndexPage) {
}, function (_flarumComponentsDiscussionPage) { IndexPage = _flarumComponentsIndexPage.default;
DiscussionPage = _flarumComponentsDiscussionPage['default']; }, function (_flarumComponentsDiscussionList) {
}, function (_flarumComponentsDiscussionHero) { DiscussionList = _flarumComponentsDiscussionList.default;
DiscussionHero = _flarumComponentsDiscussionHero['default']; }, function (_flarumTagsComponentsTagHero) {
}, function (_flarumTagsHelpersTagsLabel) { TagHero = _flarumTagsComponentsTagHero.default;
tagsLabel = _flarumTagsHelpersTagsLabel['default'];
}, function (_flarumTagsUtilsSortTags) {
sortTags = _flarumTagsUtilsSortTags['default'];
}], }],
execute: function () { execute: function () {}
};
});;
'use strict';
System.register('flarum/tags/addTagLabels', ['flarum/extend', 'flarum/components/DiscussionListItem', 'flarum/components/DiscussionPage', 'flarum/components/DiscussionHero', 'flarum/tags/helpers/tagsLabel', 'flarum/tags/utils/sortTags'], function (_export, _context) {
var extend, DiscussionListItem, DiscussionPage, DiscussionHero, tagsLabel, sortTags;
_export('default', function () { _export('default', function () {
// Add tag labels to each discussion in the discussion list. // Add tag labels to each discussion in the discussion list.
extend(DiscussionListItem.prototype, 'infoItems', function (items) { extend(DiscussionListItem.prototype, 'infoItems', function (items) {
@ -237,30 +226,29 @@ System.register('flarum/tags/addTagLabels', ['flarum/extend', 'flarum/components
} }
}); });
}); });
}
};
});;
System.register('flarum/tags/addTagList', ['flarum/extend', 'flarum/components/IndexPage', 'flarum/components/Separator', 'flarum/components/LinkButton', 'flarum/tags/components/TagLinkButton', 'flarum/tags/components/TagsPage', 'flarum/tags/utils/sortTags'], function (_export) {
'use strict';
var extend, IndexPage, Separator, LinkButton, TagLinkButton, TagsPage, sortTags;
return { return {
setters: [function (_flarumExtend) { setters: [function (_flarumExtend) {
extend = _flarumExtend.extend; extend = _flarumExtend.extend;
}, function (_flarumComponentsIndexPage) { }, function (_flarumComponentsDiscussionListItem) {
IndexPage = _flarumComponentsIndexPage['default']; DiscussionListItem = _flarumComponentsDiscussionListItem.default;
}, function (_flarumComponentsSeparator) { }, function (_flarumComponentsDiscussionPage) {
Separator = _flarumComponentsSeparator['default']; DiscussionPage = _flarumComponentsDiscussionPage.default;
}, function (_flarumComponentsLinkButton) { }, function (_flarumComponentsDiscussionHero) {
LinkButton = _flarumComponentsLinkButton['default']; DiscussionHero = _flarumComponentsDiscussionHero.default;
}, function (_flarumTagsComponentsTagLinkButton) { }, function (_flarumTagsHelpersTagsLabel) {
TagLinkButton = _flarumTagsComponentsTagLinkButton['default']; tagsLabel = _flarumTagsHelpersTagsLabel.default;
}, function (_flarumTagsComponentsTagsPage) {
TagsPage = _flarumTagsComponentsTagsPage['default'];
}, function (_flarumTagsUtilsSortTags) { }, function (_flarumTagsUtilsSortTags) {
sortTags = _flarumTagsUtilsSortTags['default']; sortTags = _flarumTagsUtilsSortTags.default;
}], }],
execute: function () { execute: function () {}
};
});;
'use strict';
System.register('flarum/tags/addTagList', ['flarum/extend', 'flarum/components/IndexPage', 'flarum/components/Separator', 'flarum/components/LinkButton', 'flarum/tags/components/TagLinkButton', 'flarum/tags/components/TagsPage', 'flarum/tags/utils/sortTags'], function (_export, _context) {
var extend, IndexPage, Separator, LinkButton, TagLinkButton, TagsPage, sortTags;
_export('default', function () { _export('default', function () {
// Add a link to the tags page, as well as a list of all the tags, // Add a link to the tags page, as well as a list of all the tags,
// to the index page's sidebar. // to the index page's sidebar.
@ -309,28 +297,45 @@ System.register('flarum/tags/addTagList', ['flarum/extend', 'flarum/components/I
} }
}); });
}); });
}
return {
setters: [function (_flarumExtend) {
extend = _flarumExtend.extend;
}, function (_flarumComponentsIndexPage) {
IndexPage = _flarumComponentsIndexPage.default;
}, function (_flarumComponentsSeparator) {
Separator = _flarumComponentsSeparator.default;
}, function (_flarumComponentsLinkButton) {
LinkButton = _flarumComponentsLinkButton.default;
}, function (_flarumTagsComponentsTagLinkButton) {
TagLinkButton = _flarumTagsComponentsTagLinkButton.default;
}, function (_flarumTagsComponentsTagsPage) {
TagsPage = _flarumTagsComponentsTagsPage.default;
}, function (_flarumTagsUtilsSortTags) {
sortTags = _flarumTagsUtilsSortTags.default;
}],
execute: function () {}
}; };
});; });;
System.register('flarum/tags/components/DiscussionTaggedPost', ['flarum/components/EventPost', 'flarum/helpers/punctuateSeries', 'flarum/tags/helpers/tagsLabel'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/components/DiscussionTaggedPost', ['flarum/components/EventPost', 'flarum/helpers/punctuateSeries', 'flarum/tags/helpers/tagsLabel'], function (_export, _context) {
var EventPost, punctuateSeries, tagsLabel, DiscussionTaggedPost; var EventPost, punctuateSeries, tagsLabel, DiscussionTaggedPost;
return { return {
setters: [function (_flarumComponentsEventPost) { setters: [function (_flarumComponentsEventPost) {
EventPost = _flarumComponentsEventPost['default']; EventPost = _flarumComponentsEventPost.default;
}, function (_flarumHelpersPunctuateSeries) { }, function (_flarumHelpersPunctuateSeries) {
punctuateSeries = _flarumHelpersPunctuateSeries['default']; punctuateSeries = _flarumHelpersPunctuateSeries.default;
}, function (_flarumTagsHelpersTagsLabel) { }, function (_flarumTagsHelpersTagsLabel) {
tagsLabel = _flarumTagsHelpersTagsLabel['default']; tagsLabel = _flarumTagsHelpersTagsLabel.default;
}], }],
execute: function () { execute: function () {
DiscussionTaggedPost = (function (_EventPost) { DiscussionTaggedPost = function (_EventPost) {
babelHelpers.inherits(DiscussionTaggedPost, _EventPost); babelHelpers.inherits(DiscussionTaggedPost, _EventPost);
function DiscussionTaggedPost() { function DiscussionTaggedPost() {
babelHelpers.classCallCheck(this, DiscussionTaggedPost); babelHelpers.classCallCheck(this, DiscussionTaggedPost);
babelHelpers.get(Object.getPrototypeOf(DiscussionTaggedPost.prototype), 'constructor', this).apply(this, arguments); return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(DiscussionTaggedPost).apply(this, arguments));
} }
babelHelpers.createClass(DiscussionTaggedPost, [{ babelHelpers.createClass(DiscussionTaggedPost, [{
@ -393,43 +398,43 @@ System.register('flarum/tags/components/DiscussionTaggedPost', ['flarum/componen
} }
}]); }]);
return DiscussionTaggedPost; return DiscussionTaggedPost;
})(EventPost); }(EventPost);
_export('default', DiscussionTaggedPost); _export('default', DiscussionTaggedPost);
} }
}; };
});; });;
System.register('flarum/tags/components/TagDiscussionModal', ['flarum/components/Modal', 'flarum/components/DiscussionPage', 'flarum/components/Button', 'flarum/helpers/highlight', 'flarum/utils/classList', 'flarum/utils/extractText', 'flarum/tags/helpers/tagLabel', 'flarum/tags/helpers/tagIcon', 'flarum/tags/utils/sortTags'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/components/TagDiscussionModal', ['flarum/components/Modal', 'flarum/components/DiscussionPage', 'flarum/components/Button', 'flarum/helpers/highlight', 'flarum/utils/classList', 'flarum/utils/extractText', 'flarum/tags/helpers/tagLabel', 'flarum/tags/helpers/tagIcon', 'flarum/tags/utils/sortTags'], function (_export, _context) {
var Modal, DiscussionPage, Button, highlight, classList, extractText, tagLabel, tagIcon, sortTags, TagDiscussionModal; var Modal, DiscussionPage, Button, highlight, classList, extractText, tagLabel, tagIcon, sortTags, TagDiscussionModal;
return { return {
setters: [function (_flarumComponentsModal) { setters: [function (_flarumComponentsModal) {
Modal = _flarumComponentsModal['default']; Modal = _flarumComponentsModal.default;
}, function (_flarumComponentsDiscussionPage) { }, function (_flarumComponentsDiscussionPage) {
DiscussionPage = _flarumComponentsDiscussionPage['default']; DiscussionPage = _flarumComponentsDiscussionPage.default;
}, function (_flarumComponentsButton) { }, function (_flarumComponentsButton) {
Button = _flarumComponentsButton['default']; Button = _flarumComponentsButton.default;
}, function (_flarumHelpersHighlight) { }, function (_flarumHelpersHighlight) {
highlight = _flarumHelpersHighlight['default']; highlight = _flarumHelpersHighlight.default;
}, function (_flarumUtilsClassList) { }, function (_flarumUtilsClassList) {
classList = _flarumUtilsClassList['default']; classList = _flarumUtilsClassList.default;
}, function (_flarumUtilsExtractText) { }, function (_flarumUtilsExtractText) {
extractText = _flarumUtilsExtractText['default']; extractText = _flarumUtilsExtractText.default;
}, function (_flarumTagsHelpersTagLabel) { }, function (_flarumTagsHelpersTagLabel) {
tagLabel = _flarumTagsHelpersTagLabel['default']; tagLabel = _flarumTagsHelpersTagLabel.default;
}, function (_flarumTagsHelpersTagIcon) { }, function (_flarumTagsHelpersTagIcon) {
tagIcon = _flarumTagsHelpersTagIcon['default']; tagIcon = _flarumTagsHelpersTagIcon.default;
}, function (_flarumTagsUtilsSortTags) { }, function (_flarumTagsUtilsSortTags) {
sortTags = _flarumTagsUtilsSortTags['default']; sortTags = _flarumTagsUtilsSortTags.default;
}], }],
execute: function () { execute: function () {
TagDiscussionModal = (function (_Modal) { TagDiscussionModal = function (_Modal) {
babelHelpers.inherits(TagDiscussionModal, _Modal); babelHelpers.inherits(TagDiscussionModal, _Modal);
function TagDiscussionModal() { function TagDiscussionModal() {
babelHelpers.classCallCheck(this, TagDiscussionModal); babelHelpers.classCallCheck(this, TagDiscussionModal);
babelHelpers.get(Object.getPrototypeOf(TagDiscussionModal.prototype), 'constructor', this).apply(this, arguments); return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(TagDiscussionModal).apply(this, arguments));
} }
babelHelpers.createClass(TagDiscussionModal, [{ babelHelpers.createClass(TagDiscussionModal, [{
@ -471,12 +476,6 @@ System.register('flarum/tags/components/TagDiscussionModal', ['flarum/components
return !tag.isPrimary(); return !tag.isPrimary();
}).length; }).length;
} }
/**
* Add the given tag to the list of selected tags.
*
* @param {Tag} tag
*/
}, { }, {
key: 'addTag', key: 'addTag',
value: function addTag(tag) { value: function addTag(tag) {
@ -494,12 +493,6 @@ System.register('flarum/tags/components/TagDiscussionModal', ['flarum/components
this.selected.push(tag); this.selected.push(tag);
} }
/**
* Remove the given tag from the list of selected tags.
*
* @param {Tag} tag
*/
}, { }, {
key: 'removeTag', key: 'removeTag',
value: function removeTag(tag) { value: function removeTag(tag) {
@ -535,8 +528,8 @@ System.register('flarum/tags/components/TagDiscussionModal', ['flarum/components
var remaining = this.minPrimary - primaryCount; var remaining = this.minPrimary - primaryCount;
return app.translator.transChoice('flarum-tags.forum.choose_tags.choose_primary_placeholder', remaining, { count: remaining }); return app.translator.transChoice('flarum-tags.forum.choose_tags.choose_primary_placeholder', remaining, { count: remaining });
} else if (secondaryCount < this.minSecondary) { } else if (secondaryCount < this.minSecondary) {
var remaining = this.minSecondary - secondaryCount; var _remaining = this.minSecondary - secondaryCount;
return app.translator.transChoice('flarum-tags.forum.choose_tags.choose_secondary_placeholder', remaining, { count: remaining }); return app.translator.transChoice('flarum-tags.forum.choose_tags.choose_secondary_placeholder', _remaining, { count: _remaining });
} }
return ''; return '';
@ -544,7 +537,7 @@ System.register('flarum/tags/components/TagDiscussionModal', ['flarum/components
}, { }, {
key: 'content', key: 'content',
value: function content() { value: function content() {
var _this = this; var _this2 = this;
var tags = this.tags; var tags = this.tags;
var filter = this.filter().toLowerCase(); var filter = this.filter().toLowerCase();
@ -555,20 +548,20 @@ System.register('flarum/tags/components/TagDiscussionModal', ['flarum/components
// makes it impossible to select a child if its parent hasn't been selected. // makes it impossible to select a child if its parent hasn't been selected.
tags = tags.filter(function (tag) { tags = tags.filter(function (tag) {
var parent = tag.parent(); var parent = tag.parent();
return parent === false || _this.selected.indexOf(parent) !== -1; return parent === false || _this2.selected.indexOf(parent) !== -1;
}); });
// If the number of selected primary/secondary tags is at the maximum, then // If the number of selected primary/secondary tags is at the maximum, then
// we'll filter out all other tags of that type. // we'll filter out all other tags of that type.
if (primaryCount >= app.forum.attribute('maxPrimaryTags')) { if (primaryCount >= app.forum.attribute('maxPrimaryTags')) {
tags = tags.filter(function (tag) { tags = tags.filter(function (tag) {
return !tag.isPrimary() || _this.selected.indexOf(tag) !== -1; return !tag.isPrimary() || _this2.selected.indexOf(tag) !== -1;
}); });
} }
if (secondaryCount >= app.forum.attribute('maxSecondaryTags')) { if (secondaryCount >= app.forum.attribute('maxSecondaryTags')) {
tags = tags.filter(function (tag) { tags = tags.filter(function (tag) {
return tag.isPrimary() || _this.selected.indexOf(tag) !== -1; return tag.isPrimary() || _this2.selected.indexOf(tag) !== -1;
}); });
} }
@ -600,9 +593,9 @@ System.register('flarum/tags/components/TagDiscussionModal', ['flarum/components
this.selected.map(function (tag) { this.selected.map(function (tag) {
return m( return m(
'span', 'span',
{ className: 'TagsInput-tag', onclick: function () { { className: 'TagsInput-tag', onclick: function onclick() {
_this.removeTag(tag); _this2.removeTag(tag);
_this.onready(); _this2.onready();
} }, } },
tagLabel(tag) tagLabel(tag)
); );
@ -613,11 +606,11 @@ System.register('flarum/tags/components/TagDiscussionModal', ['flarum/components
value: this.filter(), value: this.filter(),
oninput: m.withAttr('value', this.filter), oninput: m.withAttr('value', this.filter),
onkeydown: this.onkeydown.bind(this), onkeydown: this.onkeydown.bind(this),
onfocus: function () { onfocus: function onfocus() {
return _this.focused = true; return _this2.focused = true;
}, },
onblur: function () { onblur: function onblur() {
return _this.focused = false; return _this2.focused = false;
} }) } })
) )
), ),
@ -640,7 +633,7 @@ System.register('flarum/tags/components/TagDiscussionModal', ['flarum/components
'ul', 'ul',
{ className: 'TagDiscussionModal-list SelectTagList' }, { className: 'TagDiscussionModal-list SelectTagList' },
tags.filter(function (tag) { tags.filter(function (tag) {
return filter || !tag.parent() || _this.selected.indexOf(tag.parent()) !== -1; return filter || !tag.parent() || _this2.selected.indexOf(tag.parent()) !== -1;
}).map(function (tag) { }).map(function (tag) {
return m( return m(
'li', 'li',
@ -649,14 +642,14 @@ System.register('flarum/tags/components/TagDiscussionModal', ['flarum/components
pinned: tag.position() !== null, pinned: tag.position() !== null,
child: !!tag.parent(), child: !!tag.parent(),
colored: !!tag.color(), colored: !!tag.color(),
selected: _this.selected.indexOf(tag) !== -1, selected: _this2.selected.indexOf(tag) !== -1,
active: _this.index === tag active: _this2.index === tag
}), }),
style: { color: tag.color() }, style: { color: tag.color() },
onmouseover: function () { onmouseover: function onmouseover() {
return _this.index = tag; return _this2.index = tag;
}, },
onclick: _this.toggleTag.bind(_this, tag) onclick: _this2.toggleTag.bind(_this2, tag)
}, },
tagIcon(tag), tagIcon(tag),
m( m(
@ -767,7 +760,7 @@ System.register('flarum/tags/components/TagDiscussionModal', ['flarum/components
var itemTop = $item.offset().top; var itemTop = $item.offset().top;
var itemBottom = itemTop + $item.outerHeight(); var itemBottom = itemTop + $item.outerHeight();
var scrollTop = undefined; var scrollTop = void 0;
if (itemTop < dropdownTop) { if (itemTop < dropdownTop) {
scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10); scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10);
} else if (itemBottom > dropdownBottom) { } else if (itemBottom > dropdownBottom) {
@ -804,27 +797,27 @@ System.register('flarum/tags/components/TagDiscussionModal', ['flarum/components
} }
}]); }]);
return TagDiscussionModal; return TagDiscussionModal;
})(Modal); }(Modal);
_export('default', TagDiscussionModal); _export('default', TagDiscussionModal);
} }
}; };
});; });;
System.register('flarum/tags/components/TagHero', ['flarum/Component'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/components/TagHero', ['flarum/Component'], function (_export, _context) {
var Component, TagHero; var Component, TagHero;
return { return {
setters: [function (_flarumComponent) { setters: [function (_flarumComponent) {
Component = _flarumComponent['default']; Component = _flarumComponent.default;
}], }],
execute: function () { execute: function () {
TagHero = (function (_Component) { TagHero = function (_Component) {
babelHelpers.inherits(TagHero, _Component); babelHelpers.inherits(TagHero, _Component);
function TagHero() { function TagHero() {
babelHelpers.classCallCheck(this, TagHero); babelHelpers.classCallCheck(this, TagHero);
babelHelpers.get(Object.getPrototypeOf(TagHero.prototype), 'constructor', this).apply(this, arguments); return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(TagHero).apply(this, arguments));
} }
babelHelpers.createClass(TagHero, [{ babelHelpers.createClass(TagHero, [{
@ -859,29 +852,29 @@ System.register('flarum/tags/components/TagHero', ['flarum/Component'], function
} }
}]); }]);
return TagHero; return TagHero;
})(Component); }(Component);
_export('default', TagHero); _export('default', TagHero);
} }
}; };
});; });;
System.register('flarum/tags/components/TagLinkButton', ['flarum/components/LinkButton', 'flarum/tags/helpers/tagIcon'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/components/TagLinkButton', ['flarum/components/LinkButton', 'flarum/tags/helpers/tagIcon'], function (_export, _context) {
var LinkButton, tagIcon, TagLinkButton; var LinkButton, tagIcon, TagLinkButton;
return { return {
setters: [function (_flarumComponentsLinkButton) { setters: [function (_flarumComponentsLinkButton) {
LinkButton = _flarumComponentsLinkButton['default']; LinkButton = _flarumComponentsLinkButton.default;
}, function (_flarumTagsHelpersTagIcon) { }, function (_flarumTagsHelpersTagIcon) {
tagIcon = _flarumTagsHelpersTagIcon['default']; tagIcon = _flarumTagsHelpersTagIcon.default;
}], }],
execute: function () { execute: function () {
TagLinkButton = (function (_LinkButton) { TagLinkButton = function (_LinkButton) {
babelHelpers.inherits(TagLinkButton, _LinkButton); babelHelpers.inherits(TagLinkButton, _LinkButton);
function TagLinkButton() { function TagLinkButton() {
babelHelpers.classCallCheck(this, TagLinkButton); babelHelpers.classCallCheck(this, TagLinkButton);
babelHelpers.get(Object.getPrototypeOf(TagLinkButton.prototype), 'constructor', this).apply(this, arguments); return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(TagLinkButton).apply(this, arguments));
} }
babelHelpers.createClass(TagLinkButton, [{ babelHelpers.createClass(TagLinkButton, [{
@ -911,39 +904,39 @@ System.register('flarum/tags/components/TagLinkButton', ['flarum/components/Link
} }
}]); }]);
return TagLinkButton; return TagLinkButton;
})(LinkButton); }(LinkButton);
_export('default', TagLinkButton); _export('default', TagLinkButton);
} }
}; };
});; });;
System.register('flarum/tags/components/TagsPage', ['flarum/Component', 'flarum/components/IndexPage', 'flarum/helpers/listItems', 'flarum/helpers/humanTime', 'flarum/helpers/icon', 'flarum/tags/helpers/tagLabel', 'flarum/tags/utils/sortTags'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/components/TagsPage', ['flarum/Component', 'flarum/components/IndexPage', 'flarum/helpers/listItems', 'flarum/helpers/humanTime', 'flarum/helpers/icon', 'flarum/tags/helpers/tagLabel', 'flarum/tags/utils/sortTags'], function (_export, _context) {
var Component, IndexPage, listItems, humanTime, icon, tagLabel, sortTags, TagsPage; var Component, IndexPage, listItems, humanTime, icon, tagLabel, sortTags, TagsPage;
return { return {
setters: [function (_flarumComponent) { setters: [function (_flarumComponent) {
Component = _flarumComponent['default']; Component = _flarumComponent.default;
}, function (_flarumComponentsIndexPage) { }, function (_flarumComponentsIndexPage) {
IndexPage = _flarumComponentsIndexPage['default']; IndexPage = _flarumComponentsIndexPage.default;
}, function (_flarumHelpersListItems) { }, function (_flarumHelpersListItems) {
listItems = _flarumHelpersListItems['default']; listItems = _flarumHelpersListItems.default;
}, function (_flarumHelpersHumanTime) { }, function (_flarumHelpersHumanTime) {
humanTime = _flarumHelpersHumanTime['default']; humanTime = _flarumHelpersHumanTime.default;
}, function (_flarumHelpersIcon) { }, function (_flarumHelpersIcon) {
icon = _flarumHelpersIcon['default']; icon = _flarumHelpersIcon.default;
}, function (_flarumTagsHelpersTagLabel) { }, function (_flarumTagsHelpersTagLabel) {
tagLabel = _flarumTagsHelpersTagLabel['default']; tagLabel = _flarumTagsHelpersTagLabel.default;
}, function (_flarumTagsUtilsSortTags) { }, function (_flarumTagsUtilsSortTags) {
sortTags = _flarumTagsUtilsSortTags['default']; sortTags = _flarumTagsUtilsSortTags.default;
}], }],
execute: function () { execute: function () {
TagsPage = (function (_Component) { TagsPage = function (_Component) {
babelHelpers.inherits(TagsPage, _Component); babelHelpers.inherits(TagsPage, _Component);
function TagsPage() { function TagsPage() {
babelHelpers.classCallCheck(this, TagsPage); babelHelpers.classCallCheck(this, TagsPage);
babelHelpers.get(Object.getPrototypeOf(TagsPage.prototype), 'constructor', this).apply(this, arguments); return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(TagsPage).apply(this, arguments));
} }
babelHelpers.createClass(TagsPage, [{ babelHelpers.createClass(TagsPage, [{
@ -1019,7 +1012,7 @@ System.register('flarum/tags/components/TagsPage', ['flarum/Component', 'flarum/
children.map(function (child) { children.map(function (child) {
return [m( return [m(
'a', 'a',
{ href: app.route.tag(child), config: function (element, isInitialized) { { href: app.route.tag(child), config: function config(element, isInitialized) {
if (isInitialized) return; if (isInitialized) return;
$(element).on('click', function (e) { $(element).on('click', function (e) {
return e.stopPropagation(); return e.stopPropagation();
@ -1061,17 +1054,15 @@ System.register('flarum/tags/components/TagsPage', ['flarum/Component', 'flarum/
} }
}]); }]);
return TagsPage; return TagsPage;
})(Component); }(Component);
_export('default', TagsPage); _export('default', TagsPage);
} }
}; };
});; });;
System.register('flarum/tags/helpers/tagIcon', [], function (_export) {
'use strict'; 'use strict';
_export('default', tagIcon); System.register('flarum/tags/helpers/tagIcon', [], function (_export, _context) {
function tagIcon(tag) { function tagIcon(tag) {
var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
@ -1087,18 +1078,17 @@ System.register('flarum/tags/helpers/tagIcon', [], function (_export) {
return m('span', attrs); return m('span', attrs);
} }
_export('default', tagIcon);
return { return {
setters: [], setters: [],
execute: function () {} execute: function () {}
}; };
});; });;
System.register('flarum/tags/helpers/tagLabel', ['flarum/utils/extract'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/helpers/tagLabel', ['flarum/utils/extract'], function (_export, _context) {
var extract; var extract;
_export('default', tagLabel);
function tagLabel(tag) { function tagLabel(tag) {
var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
@ -1130,20 +1120,19 @@ System.register('flarum/tags/helpers/tagLabel', ['flarum/utils/extract'], functi
)); ));
} }
_export('default', tagLabel);
return { return {
setters: [function (_flarumUtilsExtract) { setters: [function (_flarumUtilsExtract) {
extract = _flarumUtilsExtract['default']; extract = _flarumUtilsExtract.default;
}], }],
execute: function () {} execute: function () {}
}; };
});; });;
System.register('flarum/tags/helpers/tagsLabel', ['flarum/utils/extract', 'flarum/tags/helpers/tagLabel', 'flarum/tags/utils/sortTags'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/helpers/tagsLabel', ['flarum/utils/extract', 'flarum/tags/helpers/tagLabel', 'flarum/tags/utils/sortTags'], function (_export, _context) {
var extract, tagLabel, sortTags; var extract, tagLabel, sortTags;
_export('default', tagsLabel);
function tagsLabel(tags) { function tagsLabel(tags) {
var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
@ -1169,44 +1158,46 @@ System.register('flarum/tags/helpers/tagsLabel', ['flarum/utils/extract', 'flaru
); );
} }
_export('default', tagsLabel);
return { return {
setters: [function (_flarumUtilsExtract) { setters: [function (_flarumUtilsExtract) {
extract = _flarumUtilsExtract['default']; extract = _flarumUtilsExtract.default;
}, function (_flarumTagsHelpersTagLabel) { }, function (_flarumTagsHelpersTagLabel) {
tagLabel = _flarumTagsHelpersTagLabel['default']; tagLabel = _flarumTagsHelpersTagLabel.default;
}, function (_flarumTagsUtilsSortTags) { }, function (_flarumTagsUtilsSortTags) {
sortTags = _flarumTagsUtilsSortTags['default']; sortTags = _flarumTagsUtilsSortTags.default;
}], }],
execute: function () {} execute: function () {}
}; };
});; });;
System.register('flarum/tags/main', ['flarum/Model', 'flarum/models/Discussion', 'flarum/components/IndexPage', 'flarum/tags/models/Tag', 'flarum/tags/components/TagsPage', 'flarum/tags/components/DiscussionTaggedPost', 'flarum/tags/addTagList', 'flarum/tags/addTagFilter', 'flarum/tags/addTagLabels', 'flarum/tags/addTagControl', 'flarum/tags/addTagComposer'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/main', ['flarum/Model', 'flarum/models/Discussion', 'flarum/components/IndexPage', 'flarum/tags/models/Tag', 'flarum/tags/components/TagsPage', 'flarum/tags/components/DiscussionTaggedPost', 'flarum/tags/addTagList', 'flarum/tags/addTagFilter', 'flarum/tags/addTagLabels', 'flarum/tags/addTagControl', 'flarum/tags/addTagComposer'], function (_export, _context) {
var Model, Discussion, IndexPage, Tag, TagsPage, DiscussionTaggedPost, addTagList, addTagFilter, addTagLabels, addTagControl, addTagComposer; var Model, Discussion, IndexPage, Tag, TagsPage, DiscussionTaggedPost, addTagList, addTagFilter, addTagLabels, addTagControl, addTagComposer;
return { return {
setters: [function (_flarumModel) { setters: [function (_flarumModel) {
Model = _flarumModel['default']; Model = _flarumModel.default;
}, function (_flarumModelsDiscussion) { }, function (_flarumModelsDiscussion) {
Discussion = _flarumModelsDiscussion['default']; Discussion = _flarumModelsDiscussion.default;
}, function (_flarumComponentsIndexPage) { }, function (_flarumComponentsIndexPage) {
IndexPage = _flarumComponentsIndexPage['default']; IndexPage = _flarumComponentsIndexPage.default;
}, function (_flarumTagsModelsTag) { }, function (_flarumTagsModelsTag) {
Tag = _flarumTagsModelsTag['default']; Tag = _flarumTagsModelsTag.default;
}, function (_flarumTagsComponentsTagsPage) { }, function (_flarumTagsComponentsTagsPage) {
TagsPage = _flarumTagsComponentsTagsPage['default']; TagsPage = _flarumTagsComponentsTagsPage.default;
}, function (_flarumTagsComponentsDiscussionTaggedPost) { }, function (_flarumTagsComponentsDiscussionTaggedPost) {
DiscussionTaggedPost = _flarumTagsComponentsDiscussionTaggedPost['default']; DiscussionTaggedPost = _flarumTagsComponentsDiscussionTaggedPost.default;
}, function (_flarumTagsAddTagList) { }, function (_flarumTagsAddTagList) {
addTagList = _flarumTagsAddTagList['default']; addTagList = _flarumTagsAddTagList.default;
}, function (_flarumTagsAddTagFilter) { }, function (_flarumTagsAddTagFilter) {
addTagFilter = _flarumTagsAddTagFilter['default']; addTagFilter = _flarumTagsAddTagFilter.default;
}, function (_flarumTagsAddTagLabels) { }, function (_flarumTagsAddTagLabels) {
addTagLabels = _flarumTagsAddTagLabels['default']; addTagLabels = _flarumTagsAddTagLabels.default;
}, function (_flarumTagsAddTagControl) { }, function (_flarumTagsAddTagControl) {
addTagControl = _flarumTagsAddTagControl['default']; addTagControl = _flarumTagsAddTagControl.default;
}, function (_flarumTagsAddTagComposer) { }, function (_flarumTagsAddTagComposer) {
addTagComposer = _flarumTagsAddTagComposer['default']; addTagComposer = _flarumTagsAddTagComposer.default;
}], }],
execute: function () { execute: function () {
@ -1234,29 +1225,29 @@ System.register('flarum/tags/main', ['flarum/Model', 'flarum/models/Discussion',
} }
}; };
});; });;
System.register('flarum/tags/models/Tag', ['flarum/Model', 'flarum/utils/mixin', 'flarum/utils/computed'], function (_export) {
'use strict'; 'use strict';
System.register('flarum/tags/models/Tag', ['flarum/Model', 'flarum/utils/mixin', 'flarum/utils/computed'], function (_export, _context) {
var Model, mixin, computed, Tag; var Model, mixin, computed, Tag;
return { return {
setters: [function (_flarumModel) { setters: [function (_flarumModel) {
Model = _flarumModel['default']; Model = _flarumModel.default;
}, function (_flarumUtilsMixin) { }, function (_flarumUtilsMixin) {
mixin = _flarumUtilsMixin['default']; mixin = _flarumUtilsMixin.default;
}, function (_flarumUtilsComputed) { }, function (_flarumUtilsComputed) {
computed = _flarumUtilsComputed['default']; computed = _flarumUtilsComputed.default;
}], }],
execute: function () { execute: function () {
Tag = (function (_mixin) { Tag = function (_mixin) {
babelHelpers.inherits(Tag, _mixin); babelHelpers.inherits(Tag, _mixin);
function Tag() { function Tag() {
babelHelpers.classCallCheck(this, Tag); babelHelpers.classCallCheck(this, Tag);
babelHelpers.get(Object.getPrototypeOf(Tag.prototype), 'constructor', this).apply(this, arguments); return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(Tag).apply(this, arguments));
} }
return Tag; return Tag;
})(mixin(Model, { }(mixin(Model, {
name: Model.attribute('name'), name: Model.attribute('name'),
slug: Model.attribute('slug'), slug: Model.attribute('slug'),
description: Model.attribute('description'), description: Model.attribute('description'),
@ -1287,11 +1278,9 @@ System.register('flarum/tags/models/Tag', ['flarum/Model', 'flarum/utils/mixin',
} }
}; };
});; });;
System.register("flarum/tags/utils/sortTags", [], function (_export) {
"use strict"; "use strict";
_export("default", sortTags); System.register("flarum/tags/utils/sortTags", [], function (_export, _context) {
function sortTags(tags) { function sortTags(tags) {
return tags.slice(0).sort(function (a, b) { return tags.slice(0).sort(function (a, b) {
var aPos = a.position(); var aPos = a.position();
@ -1328,6 +1317,8 @@ System.register("flarum/tags/utils/sortTags", [], function (_export) {
}); });
} }
_export("default", sortTags);
return { return {
setters: [], setters: [],
execute: function () {} execute: function () {}

View File

@ -1,7 +1,7 @@
{ {
"private": true, "private": true,
"devDependencies": { "devDependencies": {
"gulp": "^3.8.11", "gulp": "^3.9.1",
"flarum-gulp": "^0.1.0" "flarum-gulp": "^0.2.0"
} }
} }