-
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
Showing
130 changed files
with
4,435 additions
and
1,110 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM slidewiki/runtime:latest | ||
FROM slidewiki/runtime:nodejs-8-slim | ||
MAINTAINER Ali Khalili "[email protected]" | ||
|
||
ARG BUILD_ENV=local | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import UserProfileStore from '../../stores/UserProfileStore'; | ||
import {Microservices} from '../../configs/microservices'; | ||
const log = require('../log/clog'); | ||
|
||
export default function uploadMediaFile(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) => { | ||
delete payload.jwt; | ||
delete payload.userid; | ||
|
||
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; | ||
|
||
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,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,29 @@ | ||
import UserProfileStore from '../../stores/UserProfileStore'; | ||
import {Microservices} from '../../configs/microservices'; | ||
const log = require('../log/clog'); | ||
|
||
export default function uploadProfilePicture(context, payload, done) { | ||
log.info(context); | ||
|
||
payload.userid = context.getStore(UserProfileStore).userid; | ||
payload.jwt = context.getStore(UserProfileStore).jwt; | ||
payload.username = context.getStore(UserProfileStore).username; | ||
|
||
// console.log('uploadProfilePicture', payload); | ||
context.dispatch('START_UPLOADING_MEDIA_FILE', {type: payload.type, name: 'profile picture'}); | ||
|
||
context.service.create('media.uploadProfilePicture', payload, { timeout: 20 * 1000 }, { timeout: 20 * 1000 }, (err, res) => { | ||
delete payload.jwt; | ||
delete payload.userid; | ||
delete payload.username; | ||
|
||
if (err) { | ||
context.dispatch('FAILURE_UPLOADING_MEDIA_FILE', err); | ||
} | ||
else { | ||
payload.url = res; | ||
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
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 |
---|---|---|
@@ -1,4 +1,34 @@ | ||
/** | ||
* Created by lfernandes on 12.03.17. | ||
*/ | ||
import log from '../log/clog'; | ||
|
||
export default function sendReport(context,payload,done){ | ||
log.info(context); | ||
|
||
context.service.create('email', {subject: payload.subject, message: payload.text}, { timeout: 20 * 1000 }, (err, res) => { | ||
|
||
if (err) { | ||
swal({ | ||
title: payload.swal_messages.title, | ||
text: payload.swal_messages.error_text, | ||
type: 'error', | ||
confirmButtonText: payload.swal_messages.error_confirmButtonText, | ||
confirmButtonClass: 'positive ui button', | ||
allowEscapeKey: false, | ||
allowOutsideClick: false, | ||
buttonsStyling: false | ||
}); | ||
|
||
} else { | ||
swal({ | ||
title: payload.swal_messages.title, | ||
text:payload.swal_messages.text, | ||
type: 'success', | ||
confirmButtonText: payload.swal_messages.confirmButtonText, | ||
confirmButtonClass: 'positive ui button', | ||
allowEscapeKey: false, | ||
allowOutsideClick: false, | ||
buttonsStyling: false | ||
}); | ||
} | ||
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
Oops, something went wrong.