Skip to content

Commit

Permalink
Merge branch 'addMetadataToDeckPage' of https://github.com/slidewiki/…
Browse files Browse the repository at this point in the history
…slidewiki-platform into addMetadataToDeckPage
  • Loading branch information
aoelen committed Dec 14, 2018
2 parents fbcbb4d + 25f4fb4 commit 9bbac8c
Show file tree
Hide file tree
Showing 50 changed files with 2,053 additions and 249 deletions.
11 changes: 10 additions & 1 deletion actions/datasource/updateDataSources.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,22 @@ export default function updateDataSources(context, payload, done) {

// enrich with jwt
payload.jwt = context.getStore(UserProfileStore).jwt;
let dataSources = payload.dataSources;
let dataSourcesToSend = [];
dataSources.forEach((dataSource) => {//send only node datasources
if (dataSource.stype === undefined) {
dataSourcesToSend.push(dataSource);
}
});
payload.dataSources = dataSourcesToSend;

context.service.update('datasource.array', payload, {timeout: 20 * 1000}, (err, res) => {
if (err) {
log.error(context, {filepath: __filename});
context.executeAction(serviceUnavailable, payload, done);
//context.dispatch('UPDATE_DATASOURCES_FAILURE', err);
} else {
context.dispatch('UPDATE_DATASOURCES_SUCCESS', res);
context.dispatch('UPDATE_DATASOURCES_SUCCESS', {dataSources: dataSources});
}

done();
Expand Down
2 changes: 1 addition & 1 deletion actions/loadDeck.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import log from './log/clog';

export default function loadDeck(context, payload, done) {
log.info(context); // do not remove such log messages. If you don't want to see them, change log level in config

context.dispatch('UPDATE_MODE', {mode: 'loading'});
if (!(AllowedPattern.DECK_ID.test(payload.params.id))) {
context.executeAction(deckIdTypeError, payload, done);
return;
Expand Down
7 changes: 7 additions & 0 deletions actions/slide/annotateClick.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {shortTitle} from '../../configs/general';
import serviceUnavailable from '../error/serviceUnavailable';
const log = require('../log/clog');

export default function annotateClick(context, payload, done) {
context.dispatch('ANNOTATE_CLICK', {});
}
7 changes: 7 additions & 0 deletions actions/slide/registerChange.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {shortTitle} from '../../configs/general';
import serviceUnavailable from '../error/serviceUnavailable';
const log = require('../log/clog');

export default function registerChange(context, payload) {
context.dispatch('REGISTER_CHANGE', { hasChanges: payload.hasChanges });
}
19 changes: 19 additions & 0 deletions actions/translation/translateSlideRevision.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {navigateAction} from 'fluxible-router';
import serviceUnavailable from '../error/serviceUnavailable';
const log = require('../log/clog');
const common = require('../../common.js');

export default function translateSlideRevision(context, payload, done) {
context.dispatch('START_TRANSLATION', 'success');
log.info(context);

context.service.create('slide.translate', payload, null, {timeout: 30 * 1000}, (err, res) => {
if (err) {
log.error(context, {filepath: __filename, err: err});
done();
} else {
context.dispatch('UPDATE_SLIDE_CONTENT_AFTER_TRANSLATION', res);

}
});
}
7 changes: 5 additions & 2 deletions assets/ckeditor_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ CKEDITOR.editorConfig = function( config ) {
config.enterMode = CKEDITOR.ENTER_DIV;
config.resize_enabled = false;
config.disableObjectResizing = true;

CKEDITOR.plugins.addExternal( 'semanticannotations', '/assets/semanticannotations/' );

config.toolbar = [

Expand Down Expand Up @@ -67,7 +69,8 @@ CKEDITOR.editorConfig = function( config ) {
//{ name: 'document', items: [ 'Sourcedialog'] },
//{ name: 'document', items: [ 'CodeSnippet'] },
{ name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'] },
{ name: 'tools', items: ['Undo', 'Redo'] }
{ name: 'tools', items: ['Undo', 'Redo'] },
{ name: 'tools', items: ['createManualAnnotation', 'deleteAnnotation'] },

/*{ name: 'styles', items: [ 'FontSize' ] },
{ name: 'basicstyles', items: ['CopyFormatting'] },
Expand Down Expand Up @@ -223,7 +226,7 @@ CKEDITOR.editorConfig = function( config ) {
//config.filebrowserUploadUrl = 'http://importservice.experimental.slidewiki.org/importImage/2';
//config.codeSnippet_theme = 'github';
//config.codeSnippet_theme = 'pojoaque';
config.extraPlugins = 'uploadimage,uploadwidget,codesnippet,youtube,mathjax,symbol,copyformatting';
config.extraPlugins = 'uploadimage,uploadwidget,codesnippet,youtube,mathjax,symbol,copyformatting,semanticannotations';
//config.codeSnippet_theme = 'pojoaque';
//CKEDITOR.config.codeSnippet_theme = 'monokai_sublime';
//config.extraPlugins = 'uploadimage';
Expand Down
10 changes: 10 additions & 0 deletions assets/css/home-custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ textarea:focus{
color: #000;
}

/* LocaleSwitcher: forces text to black. Necessary because the inverted menu defaults text to white */
.locale-switcher.ui.menu.vertical .item {
color: rgba(0,0,0,.87);
}

/*--section--*/

.content-inner {
Expand Down Expand Up @@ -1178,3 +1183,8 @@ textarea:focus{
.banner-container.inner-image img{
float: left;
}

/* react-accessible-accordion styles */
.hidden {
display: none;
}
8 changes: 8 additions & 0 deletions assets/semanticannotations/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
annotation {
background: #0e75de;
color: #fff;
padding: 1px 1px;
border-radius: 3px;
cursor:pointer;
margin:0 -1px;
}
57 changes: 57 additions & 0 deletions assets/semanticannotations/dialogs/annotation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
CKEDITOR.dialog.add( 'annotationDialog', function( editor ) {
return {
title: 'Annotation Properties',
minWidth: 400,
minHeight: 200,
contents: [
{
id: 'tab-basic',
label: 'Settings',
elements: [
{
type: 'text',
id: 'timestamp',
label: 'Type',
validate: CKEDITOR.dialog.validate.notEmpty( "Abbreviation field cannot be empty." )
},
{
type: 'text',
id: 'title',
label: 'Explanation',
validate: CKEDITOR.dialog.validate.notEmpty( "Explanation field cannot be empty." )
}
]
},
{
id: 'tab-adv',
label: 'Advanced Settings',
elements: [
{
type: 'text',
id: 'id',
label: 'Id'
}
]
}
],
onShow: function(e) {
console.log(editor.plugins.semanticannotations);
console.log(e);
//this.getContentElement('tab-basic', 'timestamp').setValue(editor.plugins.semanticannotations.getAnnotationData(editor));
//console.log(editor.plugins.semanticannotations.getAnnotationData(editor));
},
onOk: function() {
var dialog = this;

var abbr = editor.document.createElement( 'abbr' );
abbr.setAttribute( 'title', dialog.getValueOf( 'tab-basic', 'title' ) );
abbr.setText( dialog.getValueOf( 'tab-basic', 'abbr' ) );

var id = dialog.getValueOf( 'tab-adv', 'id' );
if ( id )
abbr.setAttribute( 'id', id );

editor.insertElement( abbr );
}
};
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9bbac8c

Please sign in to comment.