mirror of
https://github.com/flarum/core.git
synced 2025-08-30 03:20:36 +02:00
Compare commits
14 Commits
v0.1.0-bet
...
v0.1.0-bet
Author | SHA1 | Date | |
---|---|---|---|
|
4734dbf46d | ||
|
783a14610a | ||
|
351d2d1366 | ||
|
e7b417121a | ||
|
9e3ecd528e | ||
|
3518fb2299 | ||
|
a6eff9383b | ||
|
d806c4491d | ||
|
c9a878d49c | ||
|
30856a8e2b | ||
|
3d3be6983a | ||
|
96b85f1330 | ||
|
25932cf7c4 | ||
|
7dcb99621d |
12
CHANGELOG.md
12
CHANGELOG.md
@@ -2,6 +2,16 @@
|
|||||||
All notable changes to Flarum and its bundled extensions will be documented in this file.
|
All notable changes to Flarum and its bundled extensions will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
## [0.1.0-beta.4] - 2015-11-05
|
||||||
|
### Added
|
||||||
|
- Add an icon/label to the back button to indicate where it leads
|
||||||
|
- Add "Loading..." text while the JavaScript payload is loading
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fix some admin actions resulting in "You do not have permission to do that"
|
||||||
|
- Fix translation keys persisting after enabling an initial language pack
|
||||||
|
- Fix translation `=>` references not being parsed in some cases
|
||||||
|
|
||||||
## [0.1.0-beta.3] - 2015-11-03
|
## [0.1.0-beta.3] - 2015-11-03
|
||||||
### Architecture improvements
|
### Architecture improvements
|
||||||
- **Composer-driven extension architecture.** All extensions are Composer packages installable via Packagist.
|
- **Composer-driven extension architecture.** All extensions are Composer packages installable via Packagist.
|
||||||
@@ -93,6 +103,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
## 0.1.0-beta - 2015-08-27
|
## 0.1.0-beta - 2015-08-27
|
||||||
First Version
|
First Version
|
||||||
|
|
||||||
[unreleased]: https://github.com/flarum/core/compare/v0.1.0-beta.2...HEAD
|
[0.1.0-beta.4]: https://github.com/flarum/core/compare/v0.1.0-beta.3...v0.1.0-beta.4
|
||||||
[0.1.0-beta.3]: https://github.com/flarum/core/compare/v0.1.0-beta.2...v0.1.0-beta.3
|
[0.1.0-beta.3]: https://github.com/flarum/core/compare/v0.1.0-beta.2...v0.1.0-beta.3
|
||||||
[0.1.0-beta.2]: https://github.com/flarum/core/compare/v0.1.0-beta...v0.1.0-beta.2
|
[0.1.0-beta.2]: https://github.com/flarum/core/compare/v0.1.0-beta...v0.1.0-beta.2
|
||||||
|
6
js/admin/dist/app.js
vendored
6
js/admin/dist/app.js
vendored
@@ -18996,10 +18996,13 @@ System.register('flarum/components/Navigation', ['flarum/Component', 'flarum/com
|
|||||||
var _app2 = app;
|
var _app2 = app;
|
||||||
var history = _app2.history;
|
var history = _app2.history;
|
||||||
|
|
||||||
|
var previous = history.getPrevious() || {};
|
||||||
|
|
||||||
return LinkButton.component({
|
return LinkButton.component({
|
||||||
className: 'Button Button--icon Navigation-back',
|
className: 'Button Navigation-back ' + (previous.title ? '' : 'Button--icon'),
|
||||||
href: history.backUrl(),
|
href: history.backUrl(),
|
||||||
icon: 'chevron-left',
|
icon: 'chevron-left',
|
||||||
|
children: previous.title,
|
||||||
config: function config() {},
|
config: function config() {},
|
||||||
onclick: function onclick(e) {
|
onclick: function onclick(e) {
|
||||||
if (e.shiftKey || e.ctrlKey || e.metaKey || e.which === 2) return;
|
if (e.shiftKey || e.ctrlKey || e.metaKey || e.which === 2) return;
|
||||||
@@ -20663,6 +20666,7 @@ System.register('flarum/initializers/boot', ['flarum/utils/ScrollListener', 'fla
|
|||||||
canGoBack: function canGoBack() {
|
canGoBack: function canGoBack() {
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
getPrevious: function getPrevious() {},
|
||||||
backUrl: function backUrl() {
|
backUrl: function backUrl() {
|
||||||
return app.forum.attribute('baseUrl');
|
return app.forum.attribute('baseUrl');
|
||||||
},
|
},
|
||||||
|
@@ -31,6 +31,7 @@ export default function boot(app) {
|
|||||||
app.alerts = m.mount(document.getElementById('alerts'), AlertManager.component());
|
app.alerts = m.mount(document.getElementById('alerts'), AlertManager.component());
|
||||||
app.history = {
|
app.history = {
|
||||||
canGoBack: () => true,
|
canGoBack: () => true,
|
||||||
|
getPrevious: () => {},
|
||||||
backUrl: () => app.forum.attribute('baseUrl'),
|
backUrl: () => app.forum.attribute('baseUrl'),
|
||||||
back: function() {
|
back: function() {
|
||||||
window.location = this.backUrl();
|
window.location = this.backUrl();
|
||||||
|
58
js/forum/dist/app.js
vendored
58
js/forum/dist/app.js
vendored
@@ -21026,6 +21026,7 @@ System.register('flarum/components/DiscussionPage', ['flarum/components/Page', '
|
|||||||
value: function show(discussion) {
|
value: function show(discussion) {
|
||||||
this.discussion = discussion;
|
this.discussion = discussion;
|
||||||
|
|
||||||
|
app.history.push('discussion', discussion.title());
|
||||||
app.setTitle(discussion.title());
|
app.setTitle(discussion.title());
|
||||||
app.setTitleCount(0);
|
app.setTitleCount(0);
|
||||||
|
|
||||||
@@ -21145,7 +21146,7 @@ System.register('flarum/components/DiscussionPage', ['flarum/components/Page', '
|
|||||||
m.route(url, true);
|
m.route(url, true);
|
||||||
window.history.replaceState(null, document.title, url);
|
window.history.replaceState(null, document.title, url);
|
||||||
|
|
||||||
app.history.push('discussion');
|
app.history.push('discussion', discussion.title());
|
||||||
|
|
||||||
// If the user hasn't read past here before, then we'll update their read
|
// If the user hasn't read past here before, then we'll update their read
|
||||||
// state and redraw.
|
// state and redraw.
|
||||||
@@ -22406,7 +22407,7 @@ System.register('flarum/components/HeaderSecondary', ['flarum/Component', 'flaru
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
});;
|
});;
|
||||||
System.register('flarum/components/IndexPage', ['flarum/extend', 'flarum/components/Page', 'flarum/utils/ItemList', 'flarum/helpers/listItems', 'flarum/components/DiscussionList', 'flarum/components/WelcomeHero', 'flarum/components/DiscussionComposer', 'flarum/components/LogInModal', 'flarum/components/DiscussionPage', 'flarum/components/Select', 'flarum/components/Button', 'flarum/components/LinkButton', 'flarum/components/SelectDropdown'], function (_export) {
|
System.register('flarum/components/IndexPage', ['flarum/extend', 'flarum/components/Page', 'flarum/utils/ItemList', 'flarum/helpers/listItems', 'flarum/helpers/icon', 'flarum/components/DiscussionList', 'flarum/components/WelcomeHero', 'flarum/components/DiscussionComposer', 'flarum/components/LogInModal', 'flarum/components/DiscussionPage', 'flarum/components/Select', 'flarum/components/Button', 'flarum/components/LinkButton', 'flarum/components/SelectDropdown'], function (_export) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The `IndexPage` component displays the index page, including the welcome
|
* The `IndexPage` component displays the index page, including the welcome
|
||||||
@@ -22414,7 +22415,7 @@ System.register('flarum/components/IndexPage', ['flarum/extend', 'flarum/compone
|
|||||||
*/
|
*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var extend, Page, ItemList, listItems, DiscussionList, WelcomeHero, DiscussionComposer, LogInModal, DiscussionPage, Select, Button, LinkButton, SelectDropdown, IndexPage;
|
var extend, Page, ItemList, listItems, icon, DiscussionList, WelcomeHero, DiscussionComposer, LogInModal, DiscussionPage, Select, Button, LinkButton, SelectDropdown, IndexPage;
|
||||||
return {
|
return {
|
||||||
setters: [function (_flarumExtend) {
|
setters: [function (_flarumExtend) {
|
||||||
extend = _flarumExtend.extend;
|
extend = _flarumExtend.extend;
|
||||||
@@ -22424,6 +22425,8 @@ System.register('flarum/components/IndexPage', ['flarum/extend', 'flarum/compone
|
|||||||
ItemList = _flarumUtilsItemList['default'];
|
ItemList = _flarumUtilsItemList['default'];
|
||||||
}, function (_flarumHelpersListItems) {
|
}, function (_flarumHelpersListItems) {
|
||||||
listItems = _flarumHelpersListItems['default'];
|
listItems = _flarumHelpersListItems['default'];
|
||||||
|
}, function (_flarumHelpersIcon) {
|
||||||
|
icon = _flarumHelpersIcon['default'];
|
||||||
}, function (_flarumComponentsDiscussionList) {
|
}, function (_flarumComponentsDiscussionList) {
|
||||||
DiscussionList = _flarumComponentsDiscussionList['default'];
|
DiscussionList = _flarumComponentsDiscussionList['default'];
|
||||||
}, function (_flarumComponentsWelcomeHero) {
|
}, function (_flarumComponentsWelcomeHero) {
|
||||||
@@ -22491,7 +22494,7 @@ System.register('flarum/components/IndexPage', ['flarum/extend', 'flarum/compone
|
|||||||
app.cache.discussionList = new DiscussionList({ params: params });
|
app.cache.discussionList = new DiscussionList({ params: params });
|
||||||
}
|
}
|
||||||
|
|
||||||
app.history.push('index');
|
app.history.push('index', icon('bars'));
|
||||||
|
|
||||||
this.bodyClass = 'App--index';
|
this.bodyClass = 'App--index';
|
||||||
}
|
}
|
||||||
@@ -23701,10 +23704,13 @@ System.register('flarum/components/Navigation', ['flarum/Component', 'flarum/com
|
|||||||
var _app2 = app;
|
var _app2 = app;
|
||||||
var history = _app2.history;
|
var history = _app2.history;
|
||||||
|
|
||||||
|
var previous = history.getPrevious() || {};
|
||||||
|
|
||||||
return LinkButton.component({
|
return LinkButton.component({
|
||||||
className: 'Button Button--icon Navigation-back',
|
className: 'Button Navigation-back ' + (previous.title ? '' : 'Button--icon'),
|
||||||
href: history.backUrl(),
|
href: history.backUrl(),
|
||||||
icon: 'chevron-left',
|
icon: 'chevron-left',
|
||||||
|
children: previous.title,
|
||||||
config: function config() {},
|
config: function config() {},
|
||||||
onclick: function onclick(e) {
|
onclick: function onclick(e) {
|
||||||
if (e.shiftKey || e.ctrlKey || e.metaKey || e.which === 2) return;
|
if (e.shiftKey || e.ctrlKey || e.metaKey || e.which === 2) return;
|
||||||
@@ -28854,6 +28860,7 @@ System.register('flarum/components/UserPage', ['flarum/components/Page', 'flarum
|
|||||||
value: function show(user) {
|
value: function show(user) {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
|
|
||||||
|
app.history.push('user', user.username());
|
||||||
app.setTitle(user.username());
|
app.setTitle(user.username());
|
||||||
|
|
||||||
m.redraw();
|
m.redraw();
|
||||||
@@ -29651,7 +29658,7 @@ System.register("flarum/helpers/username", [], function (_export) {
|
|||||||
execute: function () {}
|
execute: function () {}
|
||||||
};
|
};
|
||||||
});;
|
});;
|
||||||
System.register('flarum/initializers/boot', ['flarum/utils/ScrollListener', 'flarum/utils/Pane', 'flarum/utils/Drawer', 'flarum/utils/mapRoutes', 'flarum/components/Navigation', 'flarum/components/HeaderPrimary', 'flarum/components/HeaderSecondary', 'flarum/components/Composer', 'flarum/components/ModalManager', 'flarum/components/AlertManager'], function (_export) {
|
System.register('flarum/initializers/boot', ['flarum/utils/ScrollListener', 'flarum/utils/Pane', 'flarum/utils/Drawer', 'flarum/utils/mapRoutes', 'flarum/helpers/icon', 'flarum/components/Navigation', 'flarum/components/HeaderPrimary', 'flarum/components/HeaderSecondary', 'flarum/components/Composer', 'flarum/components/ModalManager', 'flarum/components/AlertManager'], function (_export) {
|
||||||
/*global FastClick*/
|
/*global FastClick*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29662,7 +29669,7 @@ System.register('flarum/initializers/boot', ['flarum/utils/ScrollListener', 'fla
|
|||||||
*/
|
*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var ScrollListener, Pane, Drawer, mapRoutes, Navigation, HeaderPrimary, HeaderSecondary, Composer, ModalManager, AlertManager;
|
var ScrollListener, Pane, Drawer, mapRoutes, icon, Navigation, HeaderPrimary, HeaderSecondary, Composer, ModalManager, AlertManager;
|
||||||
|
|
||||||
_export('default', boot);
|
_export('default', boot);
|
||||||
|
|
||||||
@@ -29679,7 +29686,7 @@ System.register('flarum/initializers/boot', ['flarum/utils/ScrollListener', 'fla
|
|||||||
}
|
}
|
||||||
|
|
||||||
app.routes[defaultAction].path = '/';
|
app.routes[defaultAction].path = '/';
|
||||||
app.history.push(defaultAction, '/');
|
app.history.push(defaultAction, icon('bars'), '/');
|
||||||
|
|
||||||
m.startComputation();
|
m.startComputation();
|
||||||
|
|
||||||
@@ -29737,6 +29744,8 @@ System.register('flarum/initializers/boot', ['flarum/utils/ScrollListener', 'fla
|
|||||||
Drawer = _flarumUtilsDrawer['default'];
|
Drawer = _flarumUtilsDrawer['default'];
|
||||||
}, function (_flarumUtilsMapRoutes) {
|
}, function (_flarumUtilsMapRoutes) {
|
||||||
mapRoutes = _flarumUtilsMapRoutes['default'];
|
mapRoutes = _flarumUtilsMapRoutes['default'];
|
||||||
|
}, function (_flarumHelpersIcon) {
|
||||||
|
icon = _flarumHelpersIcon['default'];
|
||||||
}, function (_flarumComponentsNavigation) {
|
}, function (_flarumComponentsNavigation) {
|
||||||
Navigation = _flarumComponentsNavigation['default'];
|
Navigation = _flarumComponentsNavigation['default'];
|
||||||
}, function (_flarumComponentsHeaderPrimary) {
|
}, function (_flarumComponentsHeaderPrimary) {
|
||||||
@@ -32171,26 +32180,39 @@ System.register('flarum/utils/History', [], function (_export) {
|
|||||||
* Get the item on the top of the stack.
|
* Get the item on the top of the stack.
|
||||||
*
|
*
|
||||||
* @return {Object}
|
* @return {Object}
|
||||||
* @protected
|
* @public
|
||||||
*/
|
*/
|
||||||
babelHelpers.createClass(History, [{
|
babelHelpers.createClass(History, [{
|
||||||
key: 'getTop',
|
key: 'getCurrent',
|
||||||
value: function getTop() {
|
value: function getCurrent() {
|
||||||
return this.stack[this.stack.length - 1];
|
return this.stack[this.stack.length - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the previous item on the stack.
|
||||||
|
*
|
||||||
|
* @return {Object}
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
}, {
|
||||||
|
key: 'getPrevious',
|
||||||
|
value: function getPrevious() {
|
||||||
|
return this.stack[this.stack.length - 2];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Push an item to the top of the stack.
|
* Push an item to the top of the stack.
|
||||||
*
|
*
|
||||||
* @param {String} name The name of the route.
|
* @param {String} name The name of the route.
|
||||||
|
* @param {String} title The title of the route.
|
||||||
* @param {String} [url] The URL of the route. The current URL will be used if
|
* @param {String} [url] The URL of the route. The current URL will be used if
|
||||||
* not provided.
|
* not provided.
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
}, {
|
}, {
|
||||||
key: 'push',
|
key: 'push',
|
||||||
value: function push(name) {
|
value: function push(name, title) {
|
||||||
var url = arguments.length <= 1 || arguments[1] === undefined ? m.route() : arguments[1];
|
var url = arguments.length <= 2 || arguments[2] === undefined ? m.route() : arguments[2];
|
||||||
|
|
||||||
// If we're pushing an item with the same name as second-to-top item in the
|
// If we're pushing an item with the same name as second-to-top item in the
|
||||||
// stack, we will assume that the user has clicked the 'back' button in
|
// stack, we will assume that the user has clicked the 'back' button in
|
||||||
@@ -32204,11 +32226,11 @@ System.register('flarum/utils/History', [], function (_export) {
|
|||||||
|
|
||||||
// If we're pushing an item with the same name as the top item in the stack,
|
// If we're pushing an item with the same name as the top item in the stack,
|
||||||
// then we'll overwrite it with the new URL.
|
// then we'll overwrite it with the new URL.
|
||||||
var top = this.getTop();
|
var top = this.getCurrent();
|
||||||
if (top && top.name === name) {
|
if (top && top.name === name) {
|
||||||
top.url = url;
|
babelHelpers._extends(top, { url: url, title: title });
|
||||||
} else {
|
} else {
|
||||||
this.stack.push({ name: name, url: url });
|
this.stack.push({ name: name, url: url, title: title });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32234,7 +32256,7 @@ System.register('flarum/utils/History', [], function (_export) {
|
|||||||
value: function back() {
|
value: function back() {
|
||||||
this.stack.pop();
|
this.stack.pop();
|
||||||
|
|
||||||
m.route(this.getTop().url);
|
m.route(this.getCurrent().url);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32258,7 +32280,7 @@ System.register('flarum/utils/History', [], function (_export) {
|
|||||||
}, {
|
}, {
|
||||||
key: 'home',
|
key: 'home',
|
||||||
value: function home() {
|
value: function home() {
|
||||||
this.stack.splice(1);
|
this.stack.splice(0);
|
||||||
|
|
||||||
m.route('/');
|
m.route('/');
|
||||||
}
|
}
|
||||||
|
@@ -159,6 +159,7 @@ export default class DiscussionPage extends Page {
|
|||||||
show(discussion) {
|
show(discussion) {
|
||||||
this.discussion = discussion;
|
this.discussion = discussion;
|
||||||
|
|
||||||
|
app.history.push('discussion', discussion.title());
|
||||||
app.setTitle(discussion.title());
|
app.setTitle(discussion.title());
|
||||||
app.setTitleCount(0);
|
app.setTitleCount(0);
|
||||||
|
|
||||||
@@ -273,7 +274,7 @@ export default class DiscussionPage extends Page {
|
|||||||
m.route(url, true);
|
m.route(url, true);
|
||||||
window.history.replaceState(null, document.title, url);
|
window.history.replaceState(null, document.title, url);
|
||||||
|
|
||||||
app.history.push('discussion');
|
app.history.push('discussion', discussion.title());
|
||||||
|
|
||||||
// If the user hasn't read past here before, then we'll update their read
|
// If the user hasn't read past here before, then we'll update their read
|
||||||
// state and redraw.
|
// state and redraw.
|
||||||
|
@@ -2,6 +2,7 @@ import { extend } from 'flarum/extend';
|
|||||||
import Page from 'flarum/components/Page';
|
import Page from 'flarum/components/Page';
|
||||||
import ItemList from 'flarum/utils/ItemList';
|
import ItemList from 'flarum/utils/ItemList';
|
||||||
import listItems from 'flarum/helpers/listItems';
|
import listItems from 'flarum/helpers/listItems';
|
||||||
|
import icon from 'flarum/helpers/icon';
|
||||||
import DiscussionList from 'flarum/components/DiscussionList';
|
import DiscussionList from 'flarum/components/DiscussionList';
|
||||||
import WelcomeHero from 'flarum/components/WelcomeHero';
|
import WelcomeHero from 'flarum/components/WelcomeHero';
|
||||||
import DiscussionComposer from 'flarum/components/DiscussionComposer';
|
import DiscussionComposer from 'flarum/components/DiscussionComposer';
|
||||||
@@ -54,7 +55,7 @@ export default class IndexPage extends Page {
|
|||||||
app.cache.discussionList = new DiscussionList({params});
|
app.cache.discussionList = new DiscussionList({params});
|
||||||
}
|
}
|
||||||
|
|
||||||
app.history.push('index');
|
app.history.push('index', icon('bars'));
|
||||||
|
|
||||||
this.bodyClass = 'App--index';
|
this.bodyClass = 'App--index';
|
||||||
}
|
}
|
||||||
|
@@ -74,6 +74,7 @@ export default class UserPage extends Page {
|
|||||||
show(user) {
|
show(user) {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
|
|
||||||
|
app.history.push('user', user.username());
|
||||||
app.setTitle(user.username());
|
app.setTitle(user.username());
|
||||||
|
|
||||||
m.redraw();
|
m.redraw();
|
||||||
|
@@ -4,7 +4,7 @@ import ScrollListener from 'flarum/utils/ScrollListener';
|
|||||||
import Pane from 'flarum/utils/Pane';
|
import Pane from 'flarum/utils/Pane';
|
||||||
import Drawer from 'flarum/utils/Drawer';
|
import Drawer from 'flarum/utils/Drawer';
|
||||||
import mapRoutes from 'flarum/utils/mapRoutes';
|
import mapRoutes from 'flarum/utils/mapRoutes';
|
||||||
|
import icon from 'flarum/helpers/icon';
|
||||||
import Navigation from 'flarum/components/Navigation';
|
import Navigation from 'flarum/components/Navigation';
|
||||||
import HeaderPrimary from 'flarum/components/HeaderPrimary';
|
import HeaderPrimary from 'flarum/components/HeaderPrimary';
|
||||||
import HeaderSecondary from 'flarum/components/HeaderSecondary';
|
import HeaderSecondary from 'flarum/components/HeaderSecondary';
|
||||||
@@ -31,7 +31,7 @@ export default function boot(app) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
app.routes[defaultAction].path = '/';
|
app.routes[defaultAction].path = '/';
|
||||||
app.history.push(defaultAction, '/');
|
app.history.push(defaultAction, icon('bars'), '/');
|
||||||
|
|
||||||
m.startComputation();
|
m.startComputation();
|
||||||
|
|
||||||
|
@@ -24,21 +24,32 @@ export default class History {
|
|||||||
* Get the item on the top of the stack.
|
* Get the item on the top of the stack.
|
||||||
*
|
*
|
||||||
* @return {Object}
|
* @return {Object}
|
||||||
* @protected
|
* @public
|
||||||
*/
|
*/
|
||||||
getTop() {
|
getCurrent() {
|
||||||
return this.stack[this.stack.length - 1];
|
return this.stack[this.stack.length - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the previous item on the stack.
|
||||||
|
*
|
||||||
|
* @return {Object}
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
getPrevious() {
|
||||||
|
return this.stack[this.stack.length - 2];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Push an item to the top of the stack.
|
* Push an item to the top of the stack.
|
||||||
*
|
*
|
||||||
* @param {String} name The name of the route.
|
* @param {String} name The name of the route.
|
||||||
|
* @param {String} title The title of the route.
|
||||||
* @param {String} [url] The URL of the route. The current URL will be used if
|
* @param {String} [url] The URL of the route. The current URL will be used if
|
||||||
* not provided.
|
* not provided.
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
push(name, url = m.route()) {
|
push(name, title, url = m.route()) {
|
||||||
// If we're pushing an item with the same name as second-to-top item in the
|
// If we're pushing an item with the same name as second-to-top item in the
|
||||||
// stack, we will assume that the user has clicked the 'back' button in
|
// stack, we will assume that the user has clicked the 'back' button in
|
||||||
// their browser. In this case, we don't want to push a new item, so we will
|
// their browser. In this case, we don't want to push a new item, so we will
|
||||||
@@ -51,11 +62,11 @@ export default class History {
|
|||||||
|
|
||||||
// If we're pushing an item with the same name as the top item in the stack,
|
// If we're pushing an item with the same name as the top item in the stack,
|
||||||
// then we'll overwrite it with the new URL.
|
// then we'll overwrite it with the new URL.
|
||||||
const top = this.getTop();
|
const top = this.getCurrent();
|
||||||
if (top && top.name === name) {
|
if (top && top.name === name) {
|
||||||
top.url = url;
|
Object.assign(top, {url, title});
|
||||||
} else {
|
} else {
|
||||||
this.stack.push({name, url});
|
this.stack.push({name, url, title});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +88,7 @@ export default class History {
|
|||||||
back() {
|
back() {
|
||||||
this.stack.pop();
|
this.stack.pop();
|
||||||
|
|
||||||
m.route(this.getTop().url);
|
m.route(this.getCurrent().url);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,7 +108,7 @@ export default class History {
|
|||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
home() {
|
home() {
|
||||||
this.stack.splice(1);
|
this.stack.splice(0);
|
||||||
|
|
||||||
m.route('/');
|
m.route('/');
|
||||||
}
|
}
|
||||||
|
@@ -47,11 +47,13 @@ export default class Navigation extends Component {
|
|||||||
*/
|
*/
|
||||||
getBackButton() {
|
getBackButton() {
|
||||||
const {history} = app;
|
const {history} = app;
|
||||||
|
const previous = history.getPrevious() || {};
|
||||||
|
|
||||||
return LinkButton.component({
|
return LinkButton.component({
|
||||||
className: 'Button Button--icon Navigation-back',
|
className: 'Button Navigation-back ' + (previous.title ? '' : 'Button--icon'),
|
||||||
href: history.backUrl(),
|
href: history.backUrl(),
|
||||||
icon: 'chevron-left',
|
icon: 'chevron-left',
|
||||||
|
children: previous.title,
|
||||||
config: () => {},
|
config: () => {},
|
||||||
onclick: e => {
|
onclick: e => {
|
||||||
if (e.shiftKey || e.ctrlKey || e.metaKey || e.which === 2) return;
|
if (e.shiftKey || e.ctrlKey || e.metaKey || e.which === 2) return;
|
||||||
|
@@ -70,7 +70,6 @@
|
|||||||
@media @tablet-up {
|
@media @tablet-up {
|
||||||
.DiscussionPage-list {
|
.DiscussionPage-list {
|
||||||
left: -@pane-width - 6px;
|
left: -@pane-width - 6px;
|
||||||
width: 100%;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: @zindex-pane;
|
z-index: @zindex-pane;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
@@ -109,29 +109,27 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@media @tablet-up {
|
.Dropdown--split {
|
||||||
.Dropdown--split {
|
.Dropdown-toggle .Button-icon {
|
||||||
.Dropdown-toggle .Button-icon {
|
display: none;
|
||||||
|
}
|
||||||
|
.Dropdown-toggle .Button-caret {
|
||||||
|
display: inline;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.itemCount1 {
|
||||||
|
.Button {
|
||||||
|
border-radius: @border-radius !important;
|
||||||
|
}
|
||||||
|
.Dropdown-toggle {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.Dropdown-toggle .Button-caret {
|
}
|
||||||
display: inline;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.itemCount1 {
|
.Dropdown-menu li:first-child {
|
||||||
.Button {
|
&, + li.Dropdown-separator {
|
||||||
border-radius: @border-radius !important;
|
display: none;
|
||||||
}
|
|
||||||
.Dropdown-toggle {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.Dropdown-menu li:first-child {
|
|
||||||
&, + li.Dropdown-separator {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,10 @@
|
|||||||
.Form--centered {
|
.Form--centered {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
.FormControl, .Button {
|
.FormControl[type=text],
|
||||||
|
.FormControl[type=email],
|
||||||
|
.FormControl[type=password],
|
||||||
|
.Button {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
@@ -20,6 +23,9 @@
|
|||||||
.Form-group {
|
.Form-group {
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
.checkbox {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.Form-group > label {
|
.Form-group > label {
|
||||||
|
@@ -2,8 +2,17 @@
|
|||||||
z-index: 3 !important; // z-index of an active .btn-group .btn is 2
|
z-index: 3 !important; // z-index of an active .btn-group .btn is 2
|
||||||
border-radius: @border-radius !important;
|
border-radius: @border-radius !important;
|
||||||
.transition(border-radius 0.2s);
|
.transition(border-radius 0.2s);
|
||||||
|
max-width: 150px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
padding-left: 8px;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.Navigation-pin {
|
.Navigation-pin {
|
||||||
|
display: none;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
margin-left: -5px !important;
|
margin-left: -5px !important;
|
||||||
border-radius: 0 @border-radius @border-radius 0;
|
border-radius: 0 @border-radius @border-radius 0;
|
||||||
@@ -15,6 +24,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media @desktop-hd {
|
@media @desktop-hd {
|
||||||
|
.Navigation-pin {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
.hasPane.panePinned, .hasPane.paneShowing {
|
.hasPane.panePinned, .hasPane.paneShowing {
|
||||||
.Navigation-back {
|
.Navigation-back {
|
||||||
border-radius: @border-radius 0 0 @border-radius !important;
|
border-radius: @border-radius 0 0 @border-radius !important;
|
||||||
|
@@ -137,3 +137,10 @@ blockquote ol:last-child {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#flarum-loading {
|
||||||
|
text-align: center;
|
||||||
|
padding: 50px 0;
|
||||||
|
font-size: 18px;
|
||||||
|
color: @muted-more-color;
|
||||||
|
}
|
||||||
|
@@ -69,7 +69,7 @@ class CoreServiceProvider extends AbstractServiceProvider
|
|||||||
});
|
});
|
||||||
|
|
||||||
$this->app->make('flarum.gate')->before(function (User $actor, $ability, $model = null) {
|
$this->app->make('flarum.gate')->before(function (User $actor, $ability, $model = null) {
|
||||||
if (! $model && $actor->hasPermission($ability)) {
|
if ($actor->isAdmin() || (! $model && $actor->hasPermission($ability))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,6 +25,8 @@ class LocaleServiceProvider extends AbstractServiceProvider
|
|||||||
{
|
{
|
||||||
$locales = $this->app->make('flarum.localeManager');
|
$locales = $this->app->make('flarum.localeManager');
|
||||||
|
|
||||||
|
$locales->addLocale($this->getDefaultLocale(), 'Default');
|
||||||
|
|
||||||
$events->fire(new ConfigureLocales($locales));
|
$events->fire(new ConfigureLocales($locales));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,9 +39,7 @@ class LocaleServiceProvider extends AbstractServiceProvider
|
|||||||
$this->app->alias('Flarum\Locale\LocaleManager', 'flarum.localeManager');
|
$this->app->alias('Flarum\Locale\LocaleManager', 'flarum.localeManager');
|
||||||
|
|
||||||
$this->app->singleton('translator', function () {
|
$this->app->singleton('translator', function () {
|
||||||
$defaultLocale = $this->app->isInstalled() && $this->app->isUpToDate()
|
$defaultLocale = $this->getDefaultLocale();
|
||||||
? $this->app->make('flarum.settings')->get('default_locale', 'en')
|
|
||||||
: 'en';
|
|
||||||
|
|
||||||
$translator = new Translator($defaultLocale, new MessageSelector());
|
$translator = new Translator($defaultLocale, new MessageSelector());
|
||||||
$translator->setFallbackLocales([$defaultLocale, 'en']);
|
$translator->setFallbackLocales([$defaultLocale, 'en']);
|
||||||
@@ -50,4 +50,11 @@ class LocaleServiceProvider extends AbstractServiceProvider
|
|||||||
$this->app->alias('translator', 'Symfony\Component\Translation\Translator');
|
$this->app->alias('translator', 'Symfony\Component\Translation\Translator');
|
||||||
$this->app->alias('translator', 'Symfony\Component\Translation\TranslatorInterface');
|
$this->app->alias('translator', 'Symfony\Component\Translation\TranslatorInterface');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getDefaultLocale()
|
||||||
|
{
|
||||||
|
return $this->app->isInstalled() && $this->app->isUpToDate()
|
||||||
|
? $this->app->make('flarum.settings')->get('default_locale', 'en')
|
||||||
|
: 'en';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -34,6 +34,11 @@ class Translator extends BaseTranslator
|
|||||||
|
|
||||||
if ($parse) {
|
if ($parse) {
|
||||||
$this->parseCatalogue($catalogue);
|
$this->parseCatalogue($catalogue);
|
||||||
|
|
||||||
|
$fallbackCatalogue = $catalogue;
|
||||||
|
while ($fallbackCatalogue = $fallbackCatalogue->getFallbackCatalogue()) {
|
||||||
|
$this->parseCatalogue($fallbackCatalogue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $catalogue;
|
return $catalogue;
|
||||||
@@ -54,17 +59,17 @@ class Translator extends BaseTranslator
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param MessageCatalogueInterface $messages
|
* @param MessageCatalogueInterface $catalogue
|
||||||
* @param string $id
|
* @param string $id
|
||||||
* @param string $domain
|
* @param string $domain
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function getTranslation(MessageCatalogueInterface $messages, $id, $domain)
|
private function getTranslation(MessageCatalogueInterface $catalogue, $id, $domain)
|
||||||
{
|
{
|
||||||
$translation = $messages->get($id, $domain);
|
$translation = $catalogue->get($id, $domain);
|
||||||
|
|
||||||
if (preg_match(self::REFERENCE_REGEX, $translation, $matches)) {
|
if (preg_match(self::REFERENCE_REGEX, $translation, $matches)) {
|
||||||
return $this->getTranslation($messages, $matches[1], $domain);
|
return $this->getTranslation($catalogue, $matches[1], $domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $translation;
|
return $translation;
|
||||||
|
@@ -1,2 +1,28 @@
|
|||||||
{{name}}:
|
{{name}}:
|
||||||
# hello_world: "Hello, world!"
|
|
||||||
|
##
|
||||||
|
# UNIQUE KEYS - The following keys are used in only one location each.
|
||||||
|
##
|
||||||
|
|
||||||
|
# Strings in this namespace are used by the admin interface.
|
||||||
|
admin:
|
||||||
|
|
||||||
|
# These keys are provided as examples; please delete them before using.
|
||||||
|
sample_location:
|
||||||
|
sample_text: "Hello, world!"
|
||||||
|
|
||||||
|
|
||||||
|
# Strings in this namespace are used by the forum user interface.
|
||||||
|
forum:
|
||||||
|
|
||||||
|
|
||||||
|
# Strings in this namespace are used by the forum and admin interfaces.
|
||||||
|
lib:
|
||||||
|
|
||||||
|
|
||||||
|
##
|
||||||
|
# REUSED STRINGS - The following keys are referenced by two or more unique keys.
|
||||||
|
##
|
||||||
|
|
||||||
|
# Strings in this namespace are referenced by two or more unique keys.
|
||||||
|
ref:
|
||||||
|
@@ -25,6 +25,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="content" class="sideNavOffset"></div>
|
<div id="content" class="sideNavOffset"></div>
|
||||||
|
|
||||||
|
{!! $content !!}
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@@ -22,30 +22,35 @@
|
|||||||
<div id="alerts"></div>
|
<div id="alerts"></div>
|
||||||
|
|
||||||
@if (! $noJs)
|
@if (! $noJs)
|
||||||
@foreach ($scripts as $file)
|
<script>
|
||||||
<script src="{{ $forum->attributes->baseUrl . str_replace(public_path(), '', $file) }}"></script>
|
document.getElementById('flarum-loading').style.display = 'block';
|
||||||
@endforeach
|
</script>
|
||||||
|
|
||||||
<script>
|
@foreach ($scripts as $file)
|
||||||
@if (! $forum->attributes->debug)
|
<script src="{{ $forum->attributes->baseUrl . str_replace(public_path(), '', $file) }}"></script>
|
||||||
try {
|
@endforeach
|
||||||
@endif
|
|
||||||
var app = System.get('flarum/app').default;
|
|
||||||
|
|
||||||
babelHelpers._extends(app, {!! json_encode($app) !!});
|
<script>
|
||||||
|
document.getElementById('flarum-loading').style.display = 'none';
|
||||||
|
@if (! $forum->attributes->debug)
|
||||||
|
try {
|
||||||
|
@endif
|
||||||
|
var app = System.get('flarum/app').default;
|
||||||
|
|
||||||
@foreach ($bootstrappers as $bootstrapper)
|
babelHelpers._extends(app, {!! json_encode($app) !!});
|
||||||
System.get('{{ $bootstrapper }}');
|
|
||||||
@endforeach
|
|
||||||
|
|
||||||
app.boot();
|
@foreach ($bootstrappers as $bootstrapper)
|
||||||
@if (! $forum->attributes->debug)
|
System.get('{{ $bootstrapper }}');
|
||||||
} catch (e) {
|
@endforeach
|
||||||
var nojs = window.location.search ? '&nojs=1' : '?nojs=1';
|
|
||||||
window.location = window.location + nojs;
|
app.boot();
|
||||||
}
|
@if (! $forum->attributes->debug)
|
||||||
@endif
|
} catch (e) {
|
||||||
</script>
|
var nojs = window.location.search ? '&nojs=1' : '?nojs=1';
|
||||||
|
window.location = window.location + nojs;
|
||||||
|
}
|
||||||
|
@endif
|
||||||
|
</script>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
{!! $foot !!}
|
{!! $foot !!}
|
||||||
|
@@ -1,12 +1,16 @@
|
|||||||
|
<div id="flarum-loading" style="display: none">
|
||||||
|
{{ $translator->trans('core.basic.loading_text') }}
|
||||||
|
</div>
|
||||||
|
|
||||||
@if (! $noJs) <noscript> @endif
|
@if (! $noJs) <noscript> @endif
|
||||||
<div class="Alert">
|
<div class="Alert">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@if ($noJs)
|
@if ($noJs)
|
||||||
{{ $translator->trans('core.basic.load_error_message') }}
|
{{ $translator->trans('core.basic.load_error_message') }}
|
||||||
@else
|
@else
|
||||||
{{ $translator->trans('core.basic.javascript_disabled_message') }}
|
{{ $translator->trans('core.basic.javascript_disabled_message') }}
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!! $content !!}
|
{!! $content !!}
|
||||||
|
Reference in New Issue
Block a user