mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 07:42:48 +08:00
Begin JavaScript cleanup
This commit is contained in:
parent
156462d33e
commit
941479edb8
|
@ -1,3 +1,12 @@
|
||||||
|
/*
|
||||||
|
* This file is part of Flarum.
|
||||||
|
*
|
||||||
|
* (c) Toby Zerner <toby.zerner@gmail.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
import Modal from 'flarum/components/Modal';
|
import Modal from 'flarum/components/Modal';
|
||||||
|
|
||||||
export default class AddExtensionModal extends Modal {
|
export default class AddExtensionModal extends Modal {
|
||||||
|
@ -14,7 +23,7 @@ export default class AddExtensionModal extends Modal {
|
||||||
<div className="Modal-body">
|
<div className="Modal-body">
|
||||||
<p>One day in the not-too-distant future, this dialog will allow you to add an extension to your forum with ease. We're building an ecosystem as we speak!</p>
|
<p>One day in the not-too-distant future, this dialog will allow you to add an extension to your forum with ease. We're building an ecosystem as we speak!</p>
|
||||||
<p>In the meantime, if you manage to get your hands on a new extension, simply drop it in your forum's <code>extensions</code> directory.</p>
|
<p>In the meantime, if you manage to get your hands on a new extension, simply drop it in your forum's <code>extensions</code> directory.</p>
|
||||||
<p>If you're a developer, you can <a href="">read the docs</a> and have a go at building your own.</p>
|
<p>If you're a developer, you can <a href="http://flarum.org/docs/extend">read the docs</a> and have a go at building your own.</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
/*
|
||||||
|
* This file is part of Flarum.
|
||||||
|
*
|
||||||
|
* (c) Toby Zerner <toby.zerner@gmail.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
import LinkButton from 'flarum/components/LinkButton';
|
import LinkButton from 'flarum/components/LinkButton';
|
||||||
|
|
||||||
export default class AdminLinkButton extends LinkButton {
|
export default class AdminLinkButton extends LinkButton {
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
/*
|
||||||
|
* This file is part of Flarum.
|
||||||
|
*
|
||||||
|
* (c) Toby Zerner <toby.zerner@gmail.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
import Component from 'flarum/Component';
|
import Component from 'flarum/Component';
|
||||||
import AdminLinkButton from 'flarum/components/AdminLinkButton';
|
import AdminLinkButton from 'flarum/components/AdminLinkButton';
|
||||||
import SelectDropdown from 'flarum/components/SelectDropdown';
|
import SelectDropdown from 'flarum/components/SelectDropdown';
|
||||||
|
@ -6,13 +15,20 @@ import ItemList from 'flarum/utils/ItemList';
|
||||||
|
|
||||||
export default class AdminNav extends Component {
|
export default class AdminNav extends Component {
|
||||||
view() {
|
view() {
|
||||||
return SelectDropdown.component({
|
return (
|
||||||
className: 'AdminNav App-titleControl',
|
<SelectDropdown
|
||||||
buttonClassName: 'Button',
|
className="AdminNav App-titleControl"
|
||||||
children: this.items().toArray()
|
buttonClassName="Button"
|
||||||
});
|
children={this.items().toArray()}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build an item list of links to show in the admin navigation.
|
||||||
|
*
|
||||||
|
* @return {ItemList}
|
||||||
|
*/
|
||||||
items() {
|
items() {
|
||||||
const items = new ItemList();
|
const items = new ItemList();
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
/*
|
||||||
|
* This file is part of Flarum.
|
||||||
|
*
|
||||||
|
* (c) Toby Zerner <toby.zerner@gmail.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The `Component` class defines a user interface 'building block'. A component
|
* The `Component` class defines a user interface 'building block'. A component
|
||||||
* can generate a virtual DOM to be rendered on each redraw.
|
* can generate a virtual DOM to be rendered on each redraw.
|
||||||
|
|
|
@ -35,11 +35,12 @@ export default class Alert extends Component {
|
||||||
const dismissControl = [];
|
const dismissControl = [];
|
||||||
|
|
||||||
if (dismissible || dismissible === undefined) {
|
if (dismissible || dismissible === undefined) {
|
||||||
dismissControl.push(Button.component({
|
dismissControl.push(
|
||||||
icon: 'times',
|
<Button
|
||||||
className: 'Button Button--link Button--icon Alert-dismiss',
|
icon="times"
|
||||||
onclick: ondismiss
|
className="Button Button--link Button--icon Alert-dismiss"
|
||||||
}));
|
onclick={ondismiss}/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user