Skip to content

Commit

Permalink
Merged from development
Browse files Browse the repository at this point in the history
  • Loading branch information
bertocode committed Nov 17, 2017
2 parents b7bfc5a + 68217c8 commit 70eaabe
Show file tree
Hide file tree
Showing 130 changed files with 2,295 additions and 986 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
dist
doc/dist
sass
ediphy_server
webpack_plugins
16 changes: 12 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{ "env": {
"browser": true,
"node": true
},
{
"env": {
"browser": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"parser": "babel-eslint",
"plugins": [
"babel",
Expand Down
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ dist/prod/*
webpack.config.js~
*.orig
.sass-cache
dali_server/config.json
dali_server/node_modules
ediphy_server/config.json
ediphy_server/node_modules
doc/esdoc
esdoc
doc/jsdoc
jsdoc
doc/files/*
doc/dist/doc-bundle.js
doc/dist/doc-bundle.js
doc/dist/demo/*bundle.js
doc/dist/demo/*bundle.min.js
doc/dist/demo/lib/*
*.map
nbproject
dist/lib/scorm/scorm.zip
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Ediphy
# Ediphy Editor

**Ediphy** is an open source e-learning authoring tool to create different types of resources (web documents, slides and more coming up soon).
**Ediphy Editor** is an open source e-learning authoring tool to create different types of resources (web documents, slides and more coming up soon).

This software is written in Javascript (ES6), making use of React and Redux.

## Installation and manual

Visit our wiki to see all the available Ediphy instructions.
Visit our wiki to see all the available Ediphy Editor instructions.

In order to install this project you will need `node` 6.x.x (latest), `npm` and git.
First clone the repo and then install the dependencies like so:
Expand Down Expand Up @@ -46,6 +46,6 @@ Copyright 2016 Universidad Politécnica de Madrid

Ediphy is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Ediphy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
Ediphy Editor is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with Ediphy. If not, see http://www.gnu.org/licenses.
You should have received a copy of the GNU Affero General Public License along with Ediphy Editor. If not, see http://www.gnu.org/licenses.
File renamed without changes.
22 changes: 11 additions & 11 deletions _editor/components/autosave/AutoSave.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Dali from '../../../core/editor/main';
import Ediphy from '../../../core/editor/main';
import { CHANGE_DISPLAY_MODE, EXPAND_NAV_ITEM, IMPORT_STATE, INCREASE_LEVEL, INDEX_SELECT, SELECT_BOX, SELECT_NAV_ITEM, SET_BUSY, TOGGLE_TEXT_EDITOR, TOGGLE_TITLE_MODE, UPDATE_NAV_ITEM_EXTRA_FILES, UPDATE_BOX } from './../../../common/actions';

const lang = ['en', 'es'];
/** *
* Component for auto-saving the state of the application periodically and avoid losing changes
*/
Expand Down Expand Up @@ -32,7 +32,7 @@ export default class AutoSave extends Component {
* Timer function set up
* @type {js timer}
*/
this.intervalId = setInterval(this.timer.bind(this), Dali.Config.autosave_time);
this.intervalId = setInterval(this.timer.bind(this), Ediphy.Config.autosave_time);
}

/**
Expand Down Expand Up @@ -102,20 +102,20 @@ export default class AutoSave extends Component {

AutoSave.propTypes = {
/**
* Guarda el estado
*/
* Saves the state
*/
save: PropTypes.func.isRequired,
/**
* Última acción realizada en Redux
*/
* Last Redux action dispatched
*/
lastAction: PropTypes.any,
/**
* Indicador de si hay una operación en curso con el servisor
*/
* Indicates if there is a current server operation
*/
isBusy: PropTypes.any,
/**
* Indicador de si se está en modo previsualización
*/
* Indicates if the preview mode is on or not
*/
visorVisible: PropTypes.bool,

};
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import MarkCreator from '../../rich_plugins/mark_creator/MarkCreator';
import interact from 'interactjs';
import PluginPlaceholder from '../plugin_placeholder/PluginPlaceholder';
import { ADD_BOX, UPDATE_BOX, RESIZE_BOX, EDIT_PLUGIN_TEXT, IMPORT_STATE } from '../../../../common/actions';
import Dali from '../../../../core/editor/main';
import Ediphy from '../../../../core/editor/main';
import i18n from 'i18next';
import { isSortableBox, isSortableContainer, isAncestorOrSibling, isContainedView } from '../../../../common/utils';
import './_daliBox.scss';
import './_editorBox.scss';

/**
* Dali Box component.
* Ediphy Box component.
* @desc It is the main and more complex component by far. It is the one in charge of painting a plugin's template and therefore it has many parts conditioned to the type of plugin.
*/
export default class DaliBox extends Component {
export default class EditorBox extends Component {
/**
* Constructor
* @param props React component props
Expand Down Expand Up @@ -142,7 +142,7 @@ export default class DaliBox extends Component {

let content = toolbar.config.flavor === "react" ? (
<div style={style} {...attrs} className={"boxStyle " + classNames} ref={"content"}>
{Dali.Plugins.get(toolbar.config.name).getRenderTemplate(toolbar.state)}
{Ediphy.Plugins.get(toolbar.config.name).getRenderTemplate(toolbar.state)}
</div>
) : (
<div style={style} {...attrs} className={"boxStyle " + classNames} ref={"content"}>
Expand Down Expand Up @@ -208,7 +208,7 @@ export default class DaliBox extends Component {
<div className={classes} id={'box-' + this.props.id}
onClick={e => {
// If there's no box selected and current's level is 0 (otherwise, it would select a deeper box)
// or -1 (only DaliBoxSortable can have level -1)
// or -1 (only EditorBoxSortable can have level -1)
if((this.props.boxSelected === -1 || this.props.boxLevelSelected === -1) && box.level === 0) {
this.props.onBoxSelected(this.props.id);
e.stopPropagation();
Expand Down Expand Up @@ -236,7 +236,7 @@ export default class DaliBox extends Component {
this.props.onTextEditorToggled(this.props.id, true);
this.refs.textarea.focus();
// Elimina el placeholder "Introduzca texto aquí" cuando se va a editar
// Código duplicado en DaliBox, DaliShortcuts y PluginToolbar. Extraer a common_tools?
// Código duplicado en EditorBox, EditorShortcuts y PluginToolbar. Extraer a common_tools?
let CKstring = CKEDITOR.instances[this.props.id].getData();
let initString = "<p>" + i18n.t("text_here") + "</p>\n";
if(CKstring === initString) {
Expand Down Expand Up @@ -267,7 +267,7 @@ export default class DaliBox extends Component {
containedViews={this.props.containedViews}
toolbar={toolbar ? toolbar : {}}
deleteMarkCreator={this.props.deleteMarkCreator}
parseRichMarkInput={Dali.Plugins.get(toolbar.config.name).parseRichMarkInput}
parseRichMarkInput={Ediphy.Plugins.get(toolbar.config.name).parseRichMarkInput}
markCreatorId={this.props.markCreatorId}
currentId={this.props.id}
pageType={this.props.pageType}
Expand Down Expand Up @@ -367,7 +367,7 @@ export default class DaliBox extends Component {
data = i18n.t("text_here");
CKEDITOR.instances[this.props.id].setData(i18n.t("text_here"));
}
Dali.Plugins.get(toolbar.config.name).forceUpdate(Object.assign({}, toolbar.state, {
Ediphy.Plugins.get(toolbar.config.name).forceUpdate(Object.assign({}, toolbar.state, {
__text: toolbar.config.extraTextConfig ? data : encodeURI(data),
}), this.props.id, EDIT_PLUGIN_TEXT);
}
Expand Down Expand Up @@ -466,13 +466,13 @@ export default class DaliBox extends Component {
window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub]);
}
if (action.type === "@@redux-undo/UNDO") {
Dali.Plugins.get(toolbar.config.name).afterRender(this.refs.content, toolbar.state);
Ediphy.Plugins.get(toolbar.config.name).afterRender(this.refs.content, toolbar.state);

}

if ((action.type === ADD_BOX || action.type === UPDATE_BOX || action.type === RESIZE_BOX || action.type === IMPORT_STATE) &&
((action.payload.id || action.payload.ids.id) === this.props.id)) {
Dali.Plugins.get(toolbar.config.name).afterRender(this.refs.content, toolbar.state);
Ediphy.Plugins.get(toolbar.config.name).afterRender(this.refs.content, toolbar.state);
}

}
Expand All @@ -499,9 +499,9 @@ export default class DaliBox extends Component {
let topO = offsetEl.top || 0;
offsetEl;
let gridTarget = interact.createSnapGrid({ x: 10, y: 10, range: 7.1, offset: { x: leftO, y: topO } });
Dali.Plugins.get(toolbar.config.name).getConfig();
Dali.Plugins.get(toolbar.config.name).afterRender(this.refs.content, toolbar.state);
let dragRestrictionSelector = isSortableContainer(box.container) ? ".daliBoxSortableContainer, .drg" + box.container : "parent";
Ediphy.Plugins.get(toolbar.config.name).getConfig();
Ediphy.Plugins.get(toolbar.config.name).afterRender(this.refs.content, toolbar.state);
let dragRestrictionSelector = isSortableContainer(box.container) ? ".editorBoxSortableContainer, .drg" + box.container : "parent";
interact(ReactDOM.findDOMNode(this))
/* .snap({
actions : ['resizex', 'resizey', 'resizexy', 'resize', 'drag'],
Expand All @@ -527,7 +527,7 @@ export default class DaliBox extends Component {
let iterate = true;
while (iterate) {
parent = parent.parentNode;
if (parent.className && (parent.className.indexOf("daliBoxSortableContainer") !== -1 || parent.className.indexOf("drg" + box.container) !== -1)) {
if (parent.className && (parent.className.indexOf("editorBoxSortableContainer") !== -1 || parent.className.indexOf("drg" + box.container) !== -1)) {
iterate = false;
}
}
Expand Down Expand Up @@ -571,10 +571,10 @@ export default class DaliBox extends Component {
this.props.onBoxSelected(this.props.id);
}

// Hide DaliShortcuts
// Hide EditorShortcuts
let bar = this.props.containedViewSelected === 0 ?
document.getElementById('daliBoxIcons') :
document.getElementById('contained_daliBoxIcons');
document.getElementById('editorBoxIcons') :
document.getElementById('contained_editorBoxIcons');
bar.classList.add('hidden');

// Level has to be the same to drag a box, unless a sortableContainer is selected, then it should allow level 0 boxes
Expand Down Expand Up @@ -692,11 +692,11 @@ export default class DaliBox extends Component {
}
}

// Unhide DaliShortcuts
// Unhide EditorShortcuts

let bar = this.props.containedViewSelected === 0 ?
document.getElementById('daliBoxIcons') :
document.getElementById('contained_daliBoxIcons');
document.getElementById('editorBoxIcons') :
document.getElementById('contained_editorBoxIcons');
bar.classList.remove('hidden');

event.stopPropagation();
Expand All @@ -713,10 +713,10 @@ export default class DaliBox extends Component {
},
edges: { left: true, right: true, bottom: true, top: true },
onstart: (event) => {
// Hide DaliShortcuts
// Hide EditorShortcuts
let bar = this.props.containedViewSelected === 0 ?
document.getElementById('daliBoxIcons') :
document.getElementById('contained_daliBoxIcons');
document.getElementById('editorBoxIcons') :
document.getElementById('contained_editorBoxIcons');
bar.classList.add('hidden');

// Append textbox with actual size
Expand Down Expand Up @@ -806,10 +806,10 @@ export default class DaliBox extends Component {
target.setAttribute('data-x', 0);
target.setAttribute('data-y', 0);

// Unhide DaliShorcuts and remove size textbox
// Unhide EditorShorcuts and remove size textbox
let bar = this.props.containedViewSelected === 0 ?
document.getElementById('daliBoxIcons') :
document.getElementById('contained_daliBoxIcons');
document.getElementById('editorBoxIcons') :
document.getElementById('contained_editorBoxIcons');
bar.classList.remove('hidden');
let span = document.getElementById('sizing');
if (span) {
Expand Down Expand Up @@ -853,7 +853,7 @@ export default class DaliBox extends Component {

}

DaliBox.propTypes = {
EditorBox.propTypes = {
/**
* Identificador único de la caja
*/
Expand Down Expand Up @@ -919,7 +919,7 @@ DaliBox.propTypes = {
*/
onBoxResized: PropTypes.func.isRequired,
/**
* Suelta la caja en una zona de un DaliBoxSortable
* Suelta la caja en una zona de un EditorBoxSortable
*/
onBoxDropped: PropTypes.func.isRequired,
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
z-index: 1;
}

/*Dali Box*/
/*Ediphy Box*/
.boxStyle, .textareaStyle{
width: 100%;
height: 100%;
Expand Down Expand Up @@ -62,12 +62,12 @@
}

/*Box editing shortcuts*/
#daliBoxIcons, #contained_daliBoxIcons{
#editorBoxIcons, #contained_editorBoxIcons{
position: absolute;
text-align: center;
height: 40px;
margin-top: -40px;
.daliTitleButton {
.editorTitleButton {
background-color: #bababa !important;
&:hover {
background-color: $blueprimary !important;
Expand All @@ -93,7 +93,7 @@

}

/* #contained_daliBoxIcons {
/* #contained_editorBoxIcons {
margin-top: 0px;
z-index: 999;
width: 100%;
Expand Down
Loading

0 comments on commit 70eaabe

Please sign in to comment.