mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-02-01 16:08:17 +00:00
源码和关于事件。
This commit is contained in:
parent
a665140f8c
commit
aed6643e39
@ -77,6 +77,9 @@ import VRModeEvent from './menu/view/VRModeEvent';
|
||||
|
||||
import ExampleEvent from './menu/example/ExampleEvent';
|
||||
|
||||
import SourceCodeEvent from './menu/help/SourceCodeEvent';
|
||||
import AboutEvent from './menu/help/AboutEvent';
|
||||
|
||||
/**
|
||||
* 事件执行器
|
||||
*/
|
||||
@ -162,6 +165,9 @@ function EventDispatcher(app) {
|
||||
new VRModeEvent(this.app),
|
||||
|
||||
new ExampleEvent(this.app),
|
||||
|
||||
new SourceCodeEvent(this.app),
|
||||
new AboutEvent(this.app),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
29
src/event/menu/help/AboutEvent.js
Normal file
29
src/event/menu/help/AboutEvent.js
Normal file
@ -0,0 +1,29 @@
|
||||
import MenuEvent from '../MenuEvent';
|
||||
|
||||
/**
|
||||
* 关于事件
|
||||
* @param {*} app
|
||||
*/
|
||||
function AboutEvent(app) {
|
||||
MenuEvent.call(this, app);
|
||||
}
|
||||
|
||||
AboutEvent.prototype = Object.create(MenuEvent.prototype);
|
||||
AboutEvent.prototype.constructor = AboutEvent;
|
||||
|
||||
AboutEvent.prototype.start = function () {
|
||||
var _this = this;
|
||||
this.app.on('mAbout.' + this.id, function () {
|
||||
_this.onAbout();
|
||||
});
|
||||
};
|
||||
|
||||
AboutEvent.prototype.stop = function () {
|
||||
this.app.on('mAbout.' + this.id, null);
|
||||
};
|
||||
|
||||
AboutEvent.prototype.onAbout = function () {
|
||||
window.open('http://threejs.org', '_blank');
|
||||
};
|
||||
|
||||
export default AboutEvent;
|
||||
29
src/event/menu/help/SourceCodeEvent.js
Normal file
29
src/event/menu/help/SourceCodeEvent.js
Normal file
@ -0,0 +1,29 @@
|
||||
import MenuEvent from '../MenuEvent';
|
||||
|
||||
/**
|
||||
* 源码事件
|
||||
* @param {*} app
|
||||
*/
|
||||
function SourceCodeEvent(app) {
|
||||
MenuEvent.call(this, app);
|
||||
}
|
||||
|
||||
SourceCodeEvent.prototype = Object.create(MenuEvent.prototype);
|
||||
SourceCodeEvent.prototype.constructor = SourceCodeEvent;
|
||||
|
||||
SourceCodeEvent.prototype.start = function () {
|
||||
var _this = this;
|
||||
this.app.on('mSourceCode.' + this.id, function () {
|
||||
_this.onSourceCode();
|
||||
});
|
||||
};
|
||||
|
||||
SourceCodeEvent.prototype.stop = function () {
|
||||
this.app.on('mSourceCode.' + this.id, null);
|
||||
};
|
||||
|
||||
SourceCodeEvent.prototype.onSourceCode = function () {
|
||||
window.open('https://github.com/mrdoob/three.js/tree/master/editor', '_blank');
|
||||
};
|
||||
|
||||
export default SourceCodeEvent;
|
||||
@ -1,49 +0,0 @@
|
||||
import UI from '../ui/UI';
|
||||
|
||||
/**
|
||||
* @author mrdoob / http://mrdoob.com/
|
||||
*/
|
||||
|
||||
function HelpMenu(editor) {
|
||||
|
||||
var container = new UI.Panel();
|
||||
container.setClass('menu');
|
||||
|
||||
var title = new UI.Panel();
|
||||
title.setClass('title');
|
||||
title.setTextContent('帮助');
|
||||
container.add(title);
|
||||
|
||||
var options = new UI.Panel();
|
||||
options.setClass('options');
|
||||
container.add(options);
|
||||
|
||||
// Source code
|
||||
|
||||
var option = new UI.Row();
|
||||
option.setClass('option');
|
||||
option.setTextContent('源码');
|
||||
option.onClick(function () {
|
||||
|
||||
window.open('https://github.com/mrdoob/three.js/tree/master/editor', '_blank')
|
||||
|
||||
});
|
||||
options.add(option);
|
||||
|
||||
// About
|
||||
|
||||
var option = new UI.Row();
|
||||
option.setClass('option');
|
||||
option.setTextContent('关于');
|
||||
option.onClick(function () {
|
||||
|
||||
window.open('http://threejs.org', '_blank');
|
||||
|
||||
});
|
||||
options.add(option);
|
||||
|
||||
return container;
|
||||
|
||||
};
|
||||
|
||||
export default HelpMenu;
|
||||
Loading…
x
Reference in New Issue
Block a user