Permalink
Browse files

restructure

  • Loading branch information...
1 parent ca265a6 commit 5e7aa9cb4748b064e4c59303e743c7f116141eb6 @nadimtuhin nadimtuhin committed Jul 10, 2015
Showing with 178 additions and 133 deletions.
  1. +0 −33 app/dashbboard.php
  2. +3 −4 app/dashboard.php
  3. +3 −3 engine/{components → App}/App.jsx
  4. +2 −2 engine/{actions → App}/AppActions.js
  5. 0 engine/{constants → App}/AppConstants.js
  6. +1 −1 engine/{dispatchers → App}/AppDispatcher.js
  7. +10 −10 engine/{stores → App}/AppStore.js
  8. +5 −5 engine/{lib → App}/AppSyncService.js
  9. 0 engine/{stores → App}/BaseStore.js
  10. +2 −2 engine/{components/App → App/components}/blocks/Block.jsx
  11. +1 −1 engine/{components/App → App/components}/blocks/BlockCollection.jsx
  12. +6 −4 engine/{components/App/sidebar → App/components/section-list}/Footer.jsx
  13. +2 −2 engine/{components/App → App/components}/section-list/Section.jsx
  14. +3 −3 engine/{components/App → App/components}/section-list/SectionList.jsx
  15. +2 −2 engine/{components/App → App/components}/section-view/SectionView.jsx
  16. +1 −1 engine/{components/App → App/components}/section-view/SectionViewCollection.jsx
  17. +5 −5 engine/{components/App → App/components}/sidebar/AddToMenu.jsx
  18. +7 −7 engine/{components/App → App/components}/sidebar/SectionControls.jsx
  19. +3 −3 engine/{components/App → App/components}/sidebar/Settings.jsx
  20. +6 −6 engine/{components/App → App/components}/sidebar/Sidebar.jsx
  21. +13 −0 engine/Generator/Generator.jsx
  22. +9 −0 engine/Generator/GeneratorActions.js
  23. +20 −0 engine/Generator/GeneratorStore.js
  24. +3 −3 engine/{components → }/Optionspanel/Content.jsx
  25. 0 engine/{actions/OptionsPanelActions.js → Optionspanel/OptionActions.js}
  26. +6 −6 engine/{stores/OptionsPanelStore.js → Optionspanel/OptionStore.js}
  27. +4 −4 engine/{components → Optionspanel}/OptionsPanel.jsx
  28. +1 −1 engine/{components → }/Optionspanel/Tabs.jsx
  29. +3 −3 engine/app.jsx
  30. +8 −0 engine/generator.jsx
  31. BIN engine/images/github-badge.png
  32. +3 −3 engine/optionspanel.jsx
  33. 0 engine/{components/shared → shared/components}/Tab.jsx
  34. 0 engine/{components/shared → shared/components}/TabPane.jsx
  35. 0 engine/{components/shared → shared/components}/form/ColorPicker.jsx
  36. 0 engine/{components/shared → shared/components}/form/Divider.jsx
  37. 0 engine/{components/shared → shared/components}/form/IconSelector.jsx
  38. +2 −2 engine/{components/shared → shared/components}/form/Input.jsx
  39. 0 engine/{components/shared → shared/components}/form/Media.jsx
  40. 0 engine/{components/shared → shared/components}/form/QuillEditor.jsx
  41. 0 engine/{components/shared → shared/components}/form/RepeatInput.jsx
  42. 0 engine/{components/shared → shared/components}/form/Select.jsx
  43. 0 engine/{components/shared → shared/components}/form/Switch.jsx
  44. 0 engine/{components/shared → shared/components}/form/WpMediaFrame.jsx
  45. +2 −2 engine/{components/shared → shared/components}/form/WpSelect.jsx
  46. +1 −1 engine/{components/shared → shared/components}/form/quill-editor.less
  47. +1 −1 engine/{components/shared → shared/components}/repeater/RepeatGroup.jsx
  48. +1 −1 engine/{components/shared → shared/components}/repeater/RepeatGroupHeading.jsx
  49. +1 −1 engine/{components/shared → shared/components}/repeater/Repeater.jsx
  50. 0 engine/{ → shared}/lib/Activity.js
  51. 0 engine/{ → shared}/lib/ODataStore.js
  52. 0 engine/{ → shared}/lib/OptionsPanelSync.js
  53. 0 engine/{ → shared}/lib/SectionTransformer.js
  54. +1 −1 engine/{ → shared}/lib/ShouldSync.js
  55. 0 engine/{ → shared}/lib/_mixins.js
  56. 0 engine/{ → shared}/lib/alert.js
  57. +1 −1 engine/{ → shared}/lib/notify.js
  58. 0 engine/{ → shared}/lib/resize.js
  59. 0 engine/{ → shared}/mixins/ContainedSelectorMixin.js
  60. 0 engine/{ → shared}/mixins/PureMixin.js
  61. BIN engine/{lithium → ui}/images/add-block.png
  62. 0 engine/{ → ui}/images/dashicon-onepager.svg
  63. 0 engine/{ → ui}/images/logo-onepager.svg
  64. 0 engine/{ → ui}/lithium/builder/ui.less
  65. 0 engine/{ → ui}/lithium/builder/variables.less
  66. BIN engine/{ → ui/lithium}/images/add-block.png
  67. +3 −3 engine/{ → ui}/lithium/lithium-builder.less
  68. 0 engine/{ → ui}/lithium/lithium.js
  69. +2 −2 engine/{ → ui}/lithium/lithium.less
  70. 0 engine/{ → ui}/lithium/site/blocks.less
  71. 0 engine/{ → ui}/lithium/site/flex.less
  72. 0 engine/{ → ui}/lithium/site/overlay.less
  73. +25 −0 generator/index.php
  74. +3 −3 gulpfile.js
  75. +1 −0 package.json
  76. +2 −1 webpack.config.js
View
@@ -1,33 +0,0 @@
-<?php
-
-add_action('admin_menu', function(){
- $icon = onepager()->url( 'assets/images/dashicon-onepager.svg');
- $template = function(){
- echo "<div id='dashboard-mount'></div>";
- };
-
- add_menu_page(
- 'Onepager',
- 'Onepager',
- 'manage_options',
- 'onepager-dashboard',
- $template,
- $icon,
- 4
- );
-});
-
-add_action( 'admin_enqueue_scripts', function(){
- $dashboard = endsWith(get_current_screen()->id, "_page_onepager-dashboard");
- if(!$dashboard) return;
-
- $q = onepager()->asset();
- $q->style( 'tx-bootstrap', asset( 'assets/css/bootstrap.css' ) );
- $q->style( 'tx-animatecss', asset( 'assets/css/animate.css' ) );
- $q->style( 'tx-fontawesome', asset( 'assets/css/font-awesome.css' ) );
- $q->style( 'tx-flexbox', asset( 'assets/css/lithium.css' ) );
- $q->script( 'tx-bootstrap', asset( 'assets/js/bootstrap.js' ), [ 'jquery' ] );
- $q->script( 'tx-nicescroll', asset('assets/js/jquery.nicescroll.js'), array( 'jquery' ) );
- $q->script( 'onepager-dashboard', asset('assets/dashboard.bundle.js'), array( 'jquery' ) );
-});
-
View
@@ -37,8 +37,7 @@ function tx_add_tutorials_page()
'Tutorial',
'edit_theme_options',
'onepager-tutorial',
- $template,
- 4
+ $template
);
}
@@ -58,6 +57,6 @@ function tx_rename_onepager_dashboard_submenu_name(){
function tx_add_onepager_dashboard_scripts()
{
- $dashboard = endsWith(get_current_screen()->id, "_page_onepager-dashboard");
- if (!$dashboard) return;
+// $dashboard = endsWith(get_current_screen()->id, "_page_onepager-");
+// if (!$dashboard) return;
}
@@ -1,7 +1,7 @@
const React = require('react');
-const AppStore = require('../stores/AppStore');
-const Sidebar = require('./App/sidebar/Sidebar.jsx');
-const SectionViewCollection = require('./App/section-view/SectionViewCollection.jsx');
+const AppStore = require('./AppStore');
+const Sidebar = require('./components/sidebar/Sidebar.jsx');
+const SectionViewCollection = require('./components/section-view/SectionViewCollection.jsx');
const _ = require('underscore');
let App = React.createClass({
@@ -1,5 +1,5 @@
-var AppDispatcher = require('../dispatchers/AppDispatcher');
-var Constants = require('../constants/AppConstants');
+var AppDispatcher = require('./AppDispatcher.js');
+var Constants = require('./AppConstants.js');
module.exports = {
addSection (section) {
File renamed without changes.
@@ -1,5 +1,5 @@
const Dispatcher = require('flux').Dispatcher;
-const Constants = require('../constants/AppConstants');
+const Constants = require('./AppConstants.js');
const assign = require('object-assign');
let AppDispatcher = assign(new Dispatcher(), {
@@ -3,16 +3,16 @@
const $ = jQuery; //jshint ignore: line
const _ = require('underscore');
const assign = require('object-assign');
-const AppDispatcher = require('../dispatchers/AppDispatcher');
-const Constants = require('../constants/AppConstants');
-const SectionTransformer = require('../lib/SectionTransformer');
-const ShouldSync = require('../lib/ShouldSync');
-const Activity = require('../lib/Activity');
-const ODataStore = require('../lib/ODataStore');
-const BaseStore = require('./BaseStore');
-const SyncService = require('../lib/AppSyncService');
-
-require('../lib/_mixins');
+const AppDispatcher = require('./AppDispatcher.js');
+const Constants = require('./AppConstants.js');
+const SectionTransformer = require('../shared/lib/SectionTransformer.js');
+const ShouldSync = require('../shared/lib/ShouldSync.js');
+const Activity = require('../shared/lib/Activity.js');
+const ODataStore = require('../shared/lib/ODataStore.js');
+const BaseStore = require('./BaseStore.js');
+const SyncService = require('./AppSyncService.js');
+
+require('../shared/lib/_mixins.js');
// data storage
@@ -1,11 +1,11 @@
const async = require('async');
const $ = jQuery; //jshint ignore: line
-const notify = require('./notify');
-const ODataStore = require('./ODataStore');
-const SectionTransformer = require('./SectionTransformer');
-const AppActions = require('../actions/AppActions');
+const notify = require('./../shared/lib/notify');
+const ODataStore = require('./../shared/lib/ODataStore');
+const SectionTransformer = require('./../shared/lib/SectionTransformer');
+const AppActions = require('./AppActions');
-require('./_mixins');
+require('./../shared/lib/_mixins');
function AppSyncService(pageId, inactive, shouldSectionsSync) {
File renamed without changes.
@@ -1,7 +1,7 @@
const React = require('react');
const PureMixin = require('react/lib/ReactComponentWithPureRenderMixin');
-const AppActions = require('../../../actions/AppActions');
-const AppStore = require('../../../stores/AppStore');
+const AppActions = require('../../AppActions.js');
+const AppStore = require('../../AppStore.js');
let Block = React.createClass({
mixins: [PureMixin],
@@ -4,7 +4,7 @@ const Alert = require('react-bootstrap/lib/Alert');
const Button = require('react-bootstrap/lib/Button');
const PureMixin = require('react/lib/ReactComponentWithPureRenderMixin');
const Block = require('./Block.jsx');
-const Select = require("../../shared/form/Select.jsx");
+const Select = require("../../../shared/components/form/Select.jsx");
// const AppStore = require('../../stores/AppStore');
@@ -1,7 +1,7 @@
const React = require('react');
const PureMixin = require('react/lib/ReactComponentWithPureRenderMixin');
-const Tab = require('../../shared/Tab.jsx');
-const ODataStore = require('../../../lib/ODataStore.js');
+const Tab = require('../../../shared/components/Tab.jsx');
+const ODataStore = require('../../../shared/lib/ODataStore.js');
let Footer = React.createClass({
@@ -24,8 +24,10 @@ let Footer = React.createClass({
return (
<div className="footer flex flex-space-between">
<a href={ODataStore.disable}><span className="fa fa-close"></span> Close</a>
- <a href="http://docs.getonepager.com" target="_blank"><span className="fa fa-video-camera"></span> Video
- Tutorial</a>
+ <a href="http://docs.getonepager.com" target="_blank">
+ <span className="fa fa-video-camera"></span>
+ Video Tutorial
+ </a>
</div>
);
}
@@ -2,8 +2,8 @@ const React = require('react');
const swal = require('sweetalert');
const Input = require('react-bootstrap/lib/Input');
const cx = require('classnames');
-const PureMixin = require('../../../mixins/PureMixin.js');
-const AppActions = require('../../../actions/AppActions');
+const PureMixin = require('../../../shared/mixins/PureMixin.js');
+const AppActions = require('../../AppActions.js');
function confirmDelete(proceed) {
swal({
@@ -5,11 +5,11 @@ const SortableMixin = require('sortablejs/react-sortable-mixin');
const Button = require('react-bootstrap/lib/Button');
const SectionLi = require('./Section.jsx');
const BlockCollection = require('../blocks/BlockCollection.jsx');
-const AppStore = require('../../../stores/AppStore.js');
-const AppActions = require('../../../actions/AppActions.js');
+const AppStore = require('../../AppStore.js');
+const AppActions = require('../../AppActions.js');
// const PureMixin = require('../../../mixins/PureMixin.js');
const PureMixin = require('react/lib/ReactComponentWithPureRenderMixin');
-const Footer = require('../sidebar/Footer.jsx');
+const Footer = require('./Footer.jsx');
let SectionList = React.createClass({
mixins: [SortableMixin, PureMixin],
@@ -1,8 +1,8 @@
const $ = jQuery; //jshint ignore:line
const React = require('react');
const cx = require('classnames');
-const AppActions = require('../../../actions/AppActions');
-const PureMixin = require('../../../mixins/PureMixin.js');
+const AppActions = require('../../AppActions.js');
+const PureMixin = require('../../../shared/mixins/PureMixin.js');
let Section = React.createClass({
mixins: [PureMixin],
@@ -1,7 +1,7 @@
const React = require('react');
const _ = require('underscore');
const SectionView = require('./SectionView.jsx');
-const PureMixin = require('../../../mixins/PureMixin.js');
+const PureMixin = require('../../../shared/mixins/PureMixin.js');
let SectionViewCollection = React.createClass({
mixins: [PureMixin],
@@ -4,11 +4,11 @@ const PureComponent = require('react/lib/ReactComponentWithPureRenderMixin');
const React = require("react");
const _ = require("underscore");
const Button = require('react-bootstrap/lib/Button');
-const Input = require("../../shared/form/Input.jsx");
-const ODataStore = require('../../../lib/ODataStore');
-const notify = require('../../../lib/notify');
-const AppStore = require('../../../stores/AppStore');
-const AppActions = require('../../../actions/AppActions');
+const Input = require("../../../shared/components/form/Input.jsx");
+const ODataStore = require('../../../shared/lib/ODataStore.js');
+const notify = require('../../../shared/lib/notify.js');
+const AppStore = require('../../AppStore.js');
+const AppActions = require('../../AppActions.js');
let AddToMenu = React.createClass({
@@ -1,12 +1,12 @@
const React = require('react');
const _ = require('underscore');
-const Divider = require('../../shared/form/Divider.jsx');
-const Input = require('../../shared/form/Input.jsx');
-const RepeatInput = require('../../shared/form/RepeatInput.jsx');
-const Repeater = require('../../shared/repeater/Repeater.jsx');
-const PureMixin = require('../../../mixins/PureMixin.js');
-const Tab = require('../../shared/Tab.jsx');
-const TabPane = require('../../shared/TabPane.jsx');
+const Divider = require('../../../shared/components/form/Divider.jsx');
+const Input = require('../../../shared/components/form/Input.jsx');
+const RepeatInput = require('../../../shared/components/form/RepeatInput.jsx');
+const Repeater = require('../../../shared/components/repeater/Repeater.jsx');
+const PureMixin = require('../../../shared/mixins/PureMixin.js');
+const Tab = require('../../../shared/components/Tab.jsx');
+const TabPane = require('../../../shared/components/TabPane.jsx');
let SectionControls = React.createClass({
// mixins: [PureMixin],
@@ -2,9 +2,9 @@ const React = require('react');
const Reflux = require('reflux');
const PureMixin = require('react/lib/ReactComponentWithPureRenderMixin');
-const OptionsPanelStore = require('../../../stores/OptionsPanelStore.js');
-const Content = require('../../Optionspanel/Content.jsx');
-const Tabs = require('../../Optionspanel/Tabs.jsx');
+const OptionsPanelStore = require('../../../Optionspanel/OptionStore.js');
+const Content = require('../../../Optionspanel/Content.jsx');
+const Tabs = require('../../../Optionspanel/Tabs.jsx');
let Admin = React.createClass({
mixins: [PureMixin, Reflux.connect(OptionsPanelStore)],
@@ -1,15 +1,15 @@
const _ = require('underscore');
const swal = require('sweetalert');
const React = require('react');
-const Tab = require('../../shared/Tab.jsx');
-const TabPane = require('../../shared/TabPane.jsx');
+const Tab = require('../../../shared/components/Tab.jsx');
+const TabPane = require('../../../shared/components/TabPane.jsx');
const SectionList = require('../section-list/SectionList.jsx');
const SectionControls = require('./SectionControls.jsx');
const AddToMenu = require('./AddToMenu.jsx');
-const AppActions = require('../../../actions/AppActions');
-const AdminActions = require('../../../actions/OptionsPanelActions');
-const SectionTransformer = require('../../../lib/SectionTransformer');
-const AppStore = require('../../../stores/AppStore');
+const AppActions = require('../../AppActions.js');
+const AdminActions = require('../../../Optionspanel/OptionActions.js');
+const SectionTransformer = require('../../../shared/lib/SectionTransformer.js');
+const AppStore = require('../../AppStore.js');
// const PureMixin = require('../../mixins/PureMixin.js');
const $s = require('string');
const $ = jQuery;
@@ -0,0 +1,13 @@
+import React from 'react';
+
+const Generator = React.createClass({
+ render() {
+ return (
+ <div>
+ Hello world from generator
+ </div>
+ );
+ }
+});
+
+export default Generator;
@@ -0,0 +1,9 @@
+import alt from 'alt';
+
+class GeneratorActions {
+ addControl(control) {
+ return control;
+ }
+}
+
+export default alt.createActions(GeneratorActions);
@@ -0,0 +1,20 @@
+import alt from 'alt';
+import GeneratorActions from 'GeneratorActions';
+
+class GeneratorStore {
+ constructor() {
+ this.bindListeners({
+ addControl: GeneratorActions.addControl
+ });
+
+ this.state = {
+ controls: []
+ };
+ }
+
+ addControl(control) {
+ this.setState({ controls: this.state.controls.concat(control) });
+ }
+}
+
+export default alt.createStore(GeneratorStore, 'GeneratorStore');
@@ -1,9 +1,9 @@
const React = require("react");
const PureMixin = require('react/lib/ReactComponentWithPureRenderMixin');
-const Input = require("./../shared/form/Input.jsx");
-const Divider = require('./../shared/form/Divider.jsx');
-const OptionsPanelActions = require('../../actions/OptionsPanelActions.js');
+const Input = require("../shared/components/form/Input.jsx");
+const Divider = require('../shared/components/form/Divider.jsx');
+const OptionsPanelActions = require('./OptionActions.js');
let Content = React.createClass({
@@ -1,13 +1,13 @@
const _ = require('underscore');
-require('../lib/_mixins');
+require('../shared/lib/_mixins.js');
const Reflux = require('reflux');
const Immutable = require('immutable');
-const AdminActions = require('../actions/OptionsPanelActions');
-const Sync = require("../lib/OptionsPanelSync");
-const notify = require("../lib/notify");
+const OptionActions = require('./OptionActions.js');
+const Sync = require("../shared/lib/OptionsPanelSync.js");
+const notify = require("../shared/lib/notify.js");
-const ODataStore = require('../lib/ODataStore');
+const ODataStore = require('../shared/lib/ODataStore.js');
let options = ODataStore.options;
let sync = Sync(ODataStore.ajaxUrl, ODataStore.page);
/*jshint ignore:line*/
@@ -43,7 +43,7 @@ AppState.tabs = AppState.optionPanel.map(tab=> {
let OptionsPanelStore = Reflux.createStore({
- listenables: [AdminActions],
+ listenables: [OptionActions],
data : AppState,
getInitialState(){
return this.data;
@@ -2,10 +2,10 @@ const React = require('react');
const Reflux = require('reflux');
const PureMixin = require('react/lib/ReactComponentWithPureRenderMixin');
-const AdminActions = require('../actions/OptionsPanelActions');
-const OptionsPanelStore = require('../stores/OptionsPanelStore.js');
-const Content = require('./Optionspanel/Content.jsx');
-const Tabs = require('./Optionspanel/Tabs.jsx');
+const AdminActions = require('./OptionActions');
+const OptionsPanelStore = require('./OptionStore.js');
+const Content = require('./Content.jsx');
+const Tabs = require('./Tabs.jsx');
let OptionsPanel = React.createClass({
mixins: [PureMixin, Reflux.connect(OptionsPanelStore)],
@@ -1,6 +1,6 @@
const React = require('react');
const PureMixin = require('react/lib/ReactComponentWithPureRenderMixin');
-const AdminActions = require('../../actions/OptionsPanelActions.js');
+const AdminActions = require('./OptionActions.js');
let Tabs = React.createClass({
mixins: [PureMixin],
Oops, something went wrong.

0 comments on commit 5e7aa9c

Please sign in to comment.