diff --git a/.bowerrc b/.bowerrc deleted file mode 100644 index 0c16bd5a..00000000 --- a/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "browser/vendor/" -} diff --git a/.gitignore b/.gitignore index 3f4e490c..727c5017 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,4 @@ -build/ -node_modules/ -electron_build/ .env -dist/ -vendor/ +node_modules/* +!node_modules/boost Boost-darwin-x64/ diff --git a/finder-window.js b/atom-lib/finder-window.js similarity index 100% rename from finder-window.js rename to atom-lib/finder-window.js diff --git a/main-window.js b/atom-lib/main-window.js similarity index 74% rename from main-window.js rename to atom-lib/main-window.js index b2a5b56d..5c6f70eb 100644 --- a/main-window.js +++ b/atom-lib/main-window.js @@ -1,4 +1,5 @@ var BrowserWindow = require('browser-window') +var path = require('path') var mainWindow = new BrowserWindow({ width: 1080, @@ -10,7 +11,9 @@ var mainWindow = new BrowserWindow({ 'standard-window': false }) -mainWindow.loadUrl('file://' + __dirname + '/browser/main/index.html') +var url = path.resolve(__dirname, '../browser/main/index.html') + +mainWindow.loadUrl('file://' + url) mainWindow.setVisibleOnAllWorkspaces(true) diff --git a/modules/menu-template.js b/atom-lib/menu-template.js similarity index 100% rename from modules/menu-template.js rename to atom-lib/menu-template.js diff --git a/updater.js b/atom-lib/updater.js similarity index 100% rename from updater.js rename to atom-lib/updater.js diff --git a/bower.json b/bower.json deleted file mode 100644 index 85708203..00000000 --- a/bower.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "codexen-app", - "dependencies": { - "react": "~0.13.3", - "fontawesome": "~4.3.0", - "react-router": "~0.13.3", - "reflux": "~0.2.8", - "moment": "~2.10.3", - "markdown-it": "~4.3.1" - } -} diff --git a/browser/main/Components/AboutModal.jsx b/browser/main/Components/AboutModal.jsx deleted file mode 100644 index 030700c0..00000000 --- a/browser/main/Components/AboutModal.jsx +++ /dev/null @@ -1,38 +0,0 @@ -var React = require('react') - -var ExternalLink = require('../Mixins/ExternalLink') -var KeyCaster = require('../Mixins/KeyCaster') - -module.exports = React.createClass({ - mixins: [ExternalLink, KeyCaster('aboutModal')], - propTypes: { - close: React.PropTypes.func - }, - onKeyCast: function (e) { - switch (e.status) { - case 'closeModal': - this.props.close() - break - } - }, - render: function () { - var version = global.version - return ( -
-
- -
Boost {version == null || version.length === 0 ? 'DEV version' : 'v' + version}
-
- -
-
External links
- -
-
- ) - } -}) diff --git a/browser/main/Components/AddMemberModal.jsx b/browser/main/Components/AddMemberModal.jsx deleted file mode 100644 index 9a173f1a..00000000 --- a/browser/main/Components/AddMemberModal.jsx +++ /dev/null @@ -1,99 +0,0 @@ -var React = require('react') -var Select = require('react-select') - -var LinkedState = require('../Mixins/LinkedState') - -var Hq = require('../Services/Hq') - -var KeyCaster = require('../Mixins/KeyCaster') - -var getOptions = function (input, callback) { - Hq.searchUser(input) - .then(function (res) { - callback(null, { - options: res.body.map(function (user) { - return { - label: user.name, - value: user.name - } - }), - complete: false - }) - }) - .catch(function (err) { - console.error(err) - }) -} - -module.exports = React.createClass({ - mixins: [LinkedState, KeyCaster('addMemberModal')], - propTypes: { - team: React.PropTypes.object, - close: React.PropTypes.func - }, - getInitialState: function () { - return { - userName: '', - role: 'member' - } - }, - onKeyCast: function (e) { - switch (e.status) { - case 'closeModal': - this.props.close() - break - case 'submitAddMemberModal': - this.handleSubmit() - break - } - }, - handleSubmit: function () { - this.setState({errorMessage: null}, function () { - Hq - .addMember(this.props.team.name, { - userName: this.state.userName, - role: this.state.role - }) - .then(function (res) { - console.log(res.body) - this.props.close() - }.bind(this)) - .catch(function (err) { - console.error(err) - if (err.status === 403) { - this.setState({errorMessage: err.response.body.message}) - } - }.bind(this)) - }) - }, - handleChange: function (value) { - this.setState({userName: value}) - }, - render: function () { - return ( -
- - - - - role -
- - {this.state.errorMessage != null ? (

{this.state.errorMessage}

) : null} - - - - ) - } -}) diff --git a/browser/main/Components/ArticleDetail.jsx b/browser/main/Components/ArticleDetail.jsx deleted file mode 100644 index 4cb67b75..00000000 --- a/browser/main/Components/ArticleDetail.jsx +++ /dev/null @@ -1,209 +0,0 @@ -var React = require('react') -var moment = require('moment') -var _ = require('lodash') - -var CodeEditor = require('./CodeEditor') -var MarkdownPreview = require('./MarkdownPreview') -var ModeIcon = require('./ModeIcon') -var Select = require('react-select') - -var Modal = require('../Mixins/Modal') -var ForceUpdate = require('../Mixins/ForceUpdate') -var LinkedState = require('../Mixins/LinkedState') - -var aceModes = require('../../../modules/ace-modes') - -var modeOptions = aceModes.map(function (mode) { - return { - label: mode, - value: mode - } -}) - -module.exports = React.createClass({ - mixins: [ForceUpdate(60000), Modal, LinkedState], - propTypes: { - currentArticle: React.PropTypes.object, - showOnlyWithTag: React.PropTypes.func, - planet: React.PropTypes.object, - switchDetailMode: React.PropTypes.func, - user: React.PropTypes.shape({ - id: React.PropTypes.number, - name: React.PropTypes.string, - Folders: React.PropTypes.array - }), - article: React.PropTypes.object, - saveCurrentArticle: React.PropTypes.func, - detailMode: React.PropTypes.string - }, - getInitialState: function () { - var article = this.props.currentArticle != null ? { - id: this.props.currentArticle.id, - title: this.props.currentArticle.title, - content: this.props.currentArticle.CurrentRevision.title, - tags: this.props.currentArticle.Tags.map(function (tag) { - return tag.name - }), - mode: this.props.currentArticle.mode, - status: this.props.currentArticle.status - } : null - // console.log('init staet') - // console.log(article) - return { - isEditModalOpen: false, - article: article - } - }, - componentWillReceiveProps: function (nextProps) { - if (nextProps.detailMode === 'edit') { - var article = { - id: nextProps.currentArticle.id, - title: nextProps.currentArticle.title, - content: nextProps.currentArticle.CurrentRevision.content, - tags: nextProps.currentArticle.Tags.map(function (tag) { - return tag.name - }), - mode: nextProps.currentArticle.mode, - FolderId: nextProps.currentArticle.FolderId, - status: nextProps.currentArticle.status - } - this.setState({article: article}) - } - }, - openDeleteModal: function () { - if (this.props.article == null) return - }, - handleFolderIdChange: function (FolderId) { - this.state.article.FolderId = FolderId - this.setState({article: this.state.article}) - }, - handleTagsChange: function (tag, tags) { - tags = _.uniq(tags, function (tag) { - return tag.value - }) - - this.state.article.tags = tags.map(function (tag) { - return tag.value - }) - this.setState({article: this.state.article}) - }, - handleModeChange: function (mode) { - this.state.article.mode = mode - this.setState({article: this.state.article}) - }, - handleContentChange: function (e, value) { - var article = this.state.article - article.content = value - this.setState({article: article}) - }, - saveArticle: function () { - if (this.state.article.mode === '') { - return this.refs.mode.focus() - } - if (this.state.article.FolderId === '') { - return this.refs.folder.focus() - } - this.props.saveCurrentArticle(this.state.article) - }, - render: function () { - if (this.props.currentArticle == null) { - return ( -
- Nothing selected -
- ) - } - - if (this.props.detailMode === 'show') { - return this.renderViewer() - } - if (this.state.article == null) { - return ( -
- Nothing selected -
- ) - } - return this.renderEditor() - }, - renderEditor: function () { - var article = this.state.article - - var folderOptions = this.props.user.Folders.map(function (folder) { - return { - label: folder.name, - value: folder.id - } - }) - - return ( -
-
-
- -
-
- - -
-
-
-
-
-
- -
-