-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b45eed3
commit 8ea664a
Showing
80 changed files
with
3,599 additions
and
649 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ configs/version.js | |
slidewiki | ||
migrate | ||
.idea/ | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
[submodule "custom_modules/custom-semantic-ui"] | ||
path = custom_modules/custom-semantic-ui | ||
url = https://github.com/slidewiki/custom-semantic-ui.git | ||
[submodule "custom_modules/simple-draggable"] | ||
path = custom_modules/simple-draggable | ||
url = https://github.com/slidewiki/simple-draggable.git | ||
[submodule "custom_modules/reveal.js"] | ||
path = custom_modules/reveal.js | ||
url = https://github.com/slidewiki/reveal.js | ||
url = https://github.com/slidewiki/reveal.js.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import serviceUnavailable from './error/serviceUnavailable'; | ||
const log = require('./log/clog'); | ||
|
||
export default function loadSupportedLanguages(context, payload, done) { | ||
log.info(context); | ||
context.service.read('translation.supported', payload, {timeout: 20 * 1000}, (err, res) => { | ||
// console.log('Executing loadPresentation action'); | ||
if (err) { | ||
log.error(context, {filepath: __filename, err: err}); | ||
context.executeAction(serviceUnavailable, payload, done); | ||
//context.dispatch('LOAD_FEATURED_FAILURE', err); | ||
} else { | ||
context.dispatch('LOAD_SUPPORTED_LANGS_SUCCESS', res); | ||
} | ||
done(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import UserProfileStore from '../../stores/UserProfileStore'; | ||
import {Microservices} from '../../configs/microservices'; | ||
const log = require('../log/clog'); | ||
|
||
export default function uploadMediaFiles(context, payload, done) { | ||
log.info(context); | ||
|
||
payload.userid = context.getStore(UserProfileStore).userid; | ||
payload.jwt = context.getStore(UserProfileStore).jwt; | ||
|
||
context.dispatch('START_UPLOADING_MEDIA_FILE', {type: payload.type, name: payload.title}); | ||
|
||
context.service.create('media.create', payload, { timeout: 20 * 1000 }, { timeout: 20 * 1000 }, (err, res) => { | ||
if (err) { | ||
// Every file send to the file-service gets checked if its distinct, if so 409 is returned | ||
// All images of all users are regarded thus the 409 response is really common | ||
if (err.statusCode === 409) { | ||
let parts = err.message.split(' '); | ||
let filename = parts[parts.length-1]; | ||
filename = filename.substring(0, filename.length - 4); | ||
payload.url = Microservices.file.uri + '/picture/' + filename; | ||
|
||
let thumbnailName = filename.substring(0, filename.lastIndexOf('.')) + '_thumbnail' + filename.substr(filename.lastIndexOf('.')); | ||
payload.thumbnailUrl = Microservices.file.uri + '/picture/' + thumbnailName; | ||
|
||
delete payload.jwt; | ||
delete payload.userid; | ||
|
||
console.log('Got 409 from file service', payload); | ||
context.dispatch('SUCCESS_UPLOADING_MEDIA_FILE', payload); | ||
} | ||
else { | ||
context.dispatch('FAILURE_UPLOADING_MEDIA_FILE', err); | ||
} | ||
} | ||
else { | ||
payload.url = Microservices.file.uri + '/picture/' + res.fileName; | ||
payload.thumbnailUrl = Microservices.file.uri + '/picture/' + res.thumbnailName; | ||
context.dispatch('SUCCESS_UPLOADING_MEDIA_FILE', payload); | ||
|
||
} | ||
done(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import UserProfileStore from '../stores/UserProfileStore'; | ||
import ContentStore from '../stores/ContentStore'; | ||
import striptags from 'striptags'; | ||
import TreeUtil from '../components/Deck/TreePanel/util/TreeUtil'; | ||
import {navigateAction} from 'fluxible-router'; | ||
import serviceUnavailable from './error/serviceUnavailable'; | ||
import addActivity from './activityfeed/addActivity'; | ||
const log = require('./log/clog'); | ||
const common = require('../common.js'); | ||
|
||
export default function translateDeckRevision(context, payload, done) { | ||
context.dispatch('START_TRANSLATION', 'success'); | ||
log.info(context); | ||
console.log('action translateDeckRevision: got payload', payload); | ||
//enrich with user id | ||
let user = context.getStore(UserProfileStore).userid; | ||
//if (!user) user = '3'; //NEED TO REMOVE THE LINE | ||
|
||
payload.user = user.toString(); | ||
payload.deckId = context.getStore(ContentStore).selector.id; | ||
payload.jwt = context.getStore(UserProfileStore).jwt; | ||
console.log(payload); | ||
//enrich with root deck id if deck to be revised is not uppermost deck | ||
// let parent = TreeUtil.getParentId(payload.selector); | ||
// payload.root_deck = parent; | ||
context.service.create('deck.translate', payload, null, {timeout: 30 * 1000}, (err, res) => { | ||
if (err) { | ||
//context.dispatch('UPDATE_DECKEDIT_VIEW_STATE', 'error'); | ||
//context.dispatch('SAVE_DECK_REVISION_FAILURE', err); | ||
log.error(context, {filepath: __filename, err: err}); | ||
// context.executeAction(serviceUnavailable, payload, done); | ||
done(); | ||
} else { | ||
//console.log('res:' + res.id); | ||
|
||
// let activity = { | ||
// activity_type: 'edit', | ||
// user_id: String(context.getStore(UserProfileStore).userid), | ||
// content_id: String(newSid), | ||
// content_kind: 'deck' | ||
// }; | ||
// context.executeAction(addActivity, {activity: activity}); | ||
|
||
context.dispatch('END_TRANSLATION', 'success'); | ||
|
||
context.executeAction(navigateAction, { | ||
url: '/deck/' + res.root_deck //ADD HERE NEW DECK ID | ||
}); | ||
|
||
done(); | ||
|
||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.