From 943f854fcc9e4c1665e15a023235fb4ee811f34d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 1 Sep 2015 16:57:58 +0200 Subject: [PATCH 01/31] change cdn to fastly --- js/components/ascribe_uploader/react_s3_fine_uploader.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/components/ascribe_uploader/react_s3_fine_uploader.js b/js/components/ascribe_uploader/react_s3_fine_uploader.js index 8ecaf40b..a1f76086 100644 --- a/js/components/ascribe_uploader/react_s3_fine_uploader.js +++ b/js/components/ascribe_uploader/react_s3_fine_uploader.js @@ -125,7 +125,8 @@ var ReactS3FineUploader = React.createClass({ bucket: 'ascribe0' }, request: { - endpoint: 'https://ascribe0.s3.amazonaws.com', + endpoint: 'https://www.ascribe.io.global.prod.fastly.net', + //endpoint: 'https://ascribe0.s3.amazonaws.com', accessKey: 'AKIAIVCZJ33WSCBQ3QDA' }, uploadSuccess: { From a8610fa1082fc6d3d961f025a6fd2596abea75f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Wed, 2 Sep 2015 15:56:27 +0200 Subject: [PATCH 02/31] change ikono contract --- js/components/ascribe_uploader/react_s3_fine_uploader.js | 3 ++- .../ikonotv/ascribe_buttons/ikonotv_submit_button.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/js/components/ascribe_uploader/react_s3_fine_uploader.js b/js/components/ascribe_uploader/react_s3_fine_uploader.js index 8ecaf40b..a1f76086 100644 --- a/js/components/ascribe_uploader/react_s3_fine_uploader.js +++ b/js/components/ascribe_uploader/react_s3_fine_uploader.js @@ -125,7 +125,8 @@ var ReactS3FineUploader = React.createClass({ bucket: 'ascribe0' }, request: { - endpoint: 'https://ascribe0.s3.amazonaws.com', + endpoint: 'https://www.ascribe.io.global.prod.fastly.net', + //endpoint: 'https://ascribe0.s3.amazonaws.com', accessKey: 'AKIAIVCZJ33WSCBQ3QDA' }, uploadSuccess: { diff --git a/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js b/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js index 40d65a2b..41b47a82 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js @@ -58,7 +58,7 @@ let IkonotvSubmitButton = React.createClass({ {' ' + getLangText('I agree to the Terms of Service of IkonoTV Archive') + ' '} - ( + ( {getLangText('read')} ) From 2f5c70eceb28e36d1c84a50b44ddc66ac0500467 Mon Sep 17 00:00:00 2001 From: vrde Date: Wed, 2 Sep 2015 17:36:01 +0200 Subject: [PATCH 03/31] Remove unused ButtonSubmitOrClose and styles --- .../ascribe_buttons/button_submit.js | 27 ---------------- .../ascribe_buttons/button_submit_close.js | 32 ------------------- sass/lib/buttons.scss | 0 sass/main.scss | 13 ++------ 4 files changed, 2 insertions(+), 70 deletions(-) delete mode 100644 js/components/ascribe_buttons/button_submit.js delete mode 100644 js/components/ascribe_buttons/button_submit_close.js create mode 100644 sass/lib/buttons.scss diff --git a/js/components/ascribe_buttons/button_submit.js b/js/components/ascribe_buttons/button_submit.js deleted file mode 100644 index ef5999cd..00000000 --- a/js/components/ascribe_buttons/button_submit.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -import React from 'react'; - -let ButtonSubmitOrClose = React.createClass({ - propTypes: { - submitted: React.PropTypes.bool.isRequired, - text: React.PropTypes.string.isRequired - }, - - render() { - if (this.props.submitted){ - return ( -
- -
- ); - } - return ( -
- -
- ); - } -}); - -export default ButtonSubmitOrClose; diff --git a/js/components/ascribe_buttons/button_submit_close.js b/js/components/ascribe_buttons/button_submit_close.js deleted file mode 100644 index 11d3c0a4..00000000 --- a/js/components/ascribe_buttons/button_submit_close.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -import React from 'react'; - -import AppConstants from '../../constants/application_constants'; -import { getLangText } from '../../utils/lang_utils.js' - -let ButtonSubmitOrClose = React.createClass({ - propTypes: { - submitted: React.PropTypes.bool.isRequired, - text: React.PropTypes.string.isRequired, - onClose: React.PropTypes.func.isRequired - }, - - render() { - if (this.props.submitted){ - return ( -
- -
- ); - } - return ( -
- - -
- ); - } -}); - -export default ButtonSubmitOrClose; diff --git a/sass/lib/buttons.scss b/sass/lib/buttons.scss new file mode 100644 index 00000000..e69de29b diff --git a/sass/main.scss b/sass/main.scss index e8d708e3..6f17792a 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -184,31 +184,22 @@ hr { border: 1px solid $ascribe-brand-danger; } } -.btn-ascribe, .btn-ascribe-inv { +.btn-ascribe { border: 1px solid #444; line-height: 2em; margin-right: 1px; margin-left: 0 !important; font-family: sans-serif !important; border-radius: 0 !important; -} - -.btn-ascribe, .btn-ascribe-inv:active, .btn-ascribe-inv:hover { color: #222 !important; background-color: #FFF; } -.btn-ascribe:active, .btn-ascribe:hover, .btn-ascribe-inv { +.btn-ascribe:active, .btn-ascribe:hover { color: #FFF !important; background-color: #444; } -.btn-ascribe-inv:disabled, .btn-ascribe-inv:focus { - color: #444 !important; - background-color: #BBB !important; - border: 1px solid #444 !important; -} - .btn-ascribe-sm { font-size: 12px; line-height: 1.3em; From 4a4d4ac737d560f2fc1eb6b390426fdc6f920618 Mon Sep 17 00:00:00 2001 From: vrde Date: Thu, 3 Sep 2015 16:11:41 +0200 Subject: [PATCH 04/31] Add support for long file names --- js/components/ascribe_media/media_player.js | 12 ++++++++++-- sass/ascribe_media_player.scss | 7 ++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/js/components/ascribe_media/media_player.js b/js/components/ascribe_media/media_player.js index ad53b61f..e4b69c69 100644 --- a/js/components/ascribe_media/media_player.js +++ b/js/components/ascribe_media/media_player.js @@ -28,12 +28,20 @@ let Other = React.createClass({ }, render() { - let ext = this.props.url.split('.').pop(); + let filename = this.props.url.split('/').pop(); + let tokens = filename.split('.'); + let preview; + + if (tokens.length > 1) { + preview = '.' + tokens.pop(); + } else { + preview = 'file'; + } return (

- .{ext} + {preview}

); diff --git a/sass/ascribe_media_player.scss b/sass/ascribe_media_player.scss index f3b87618..213fbafa 100644 --- a/sass/ascribe_media_player.scss +++ b/sass/ascribe_media_player.scss @@ -12,8 +12,13 @@ } .media-other { - font-size: 500%; color: #cccccc; + font-size: 500%; + p { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } } .audiojs { From a4a0e9d149dd5608bef66eae5655a171bb1fd204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 4 Sep 2015 15:54:49 +0200 Subject: [PATCH 05/31] catch error in onComplete for fineuploader --- js/components/ascribe_uploader/react_s3_fine_uploader.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/components/ascribe_uploader/react_s3_fine_uploader.js b/js/components/ascribe_uploader/react_s3_fine_uploader.js index 8ecaf40b..ff72813b 100644 --- a/js/components/ascribe_uploader/react_s3_fine_uploader.js +++ b/js/components/ascribe_uploader/react_s3_fine_uploader.js @@ -20,7 +20,6 @@ import AppConstants from '../../constants/application_constants'; import { computeHashOfFile } from '../../utils/file_utils'; var ReactS3FineUploader = React.createClass({ - propTypes: { keyRoutine: React.PropTypes.shape({ url: React.PropTypes.string, @@ -125,6 +124,7 @@ var ReactS3FineUploader = React.createClass({ bucket: 'ascribe0' }, request: { + //endpoint: 'https://www.ascribe.io.global.prod.fastly.net', endpoint: 'https://ascribe0.s3.amazonaws.com', accessKey: 'AKIAIVCZJ33WSCBQ3QDA' }, @@ -352,10 +352,11 @@ var ReactS3FineUploader = React.createClass({ }, onComplete(id, name, res, xhr) { + console.log(xhr); // there has been an issue with the server's connection - if(xhr.status === 0) { - - console.logGlobal(new Error('Complete was called but there wasn\t a success'), false, { + if((xhr && xhr.status === 0) || res.error) { + console.log('asdasdas'); + console.logGlobal(new Error(res.error || 'Complete was called but there wasn\t a success'), false, { files: this.state.filesToUpload, chunks: this.state.chunks }); From 7dae23a265b3e4c8a722678f0e0658718f8ea9d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 4 Sep 2015 17:05:17 +0200 Subject: [PATCH 06/31] remove fastly --- js/components/ascribe_uploader/react_s3_fine_uploader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/components/ascribe_uploader/react_s3_fine_uploader.js b/js/components/ascribe_uploader/react_s3_fine_uploader.js index a1f76086..2bb39ca2 100644 --- a/js/components/ascribe_uploader/react_s3_fine_uploader.js +++ b/js/components/ascribe_uploader/react_s3_fine_uploader.js @@ -125,8 +125,8 @@ var ReactS3FineUploader = React.createClass({ bucket: 'ascribe0' }, request: { - endpoint: 'https://www.ascribe.io.global.prod.fastly.net', - //endpoint: 'https://ascribe0.s3.amazonaws.com', + //endpoint: 'https://www.ascribe.io.global.prod.fastly.net', + endpoint: 'https://ascribe0.s3.amazonaws.com', accessKey: 'AKIAIVCZJ33WSCBQ3QDA' }, uploadSuccess: { From 3b61ac5c6a39b2b9f99ebad49f2be8a385b99420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 4 Sep 2015 17:31:58 +0200 Subject: [PATCH 07/31] remove mangle and fix bug in react-fineuploader --- gulpfile.js | 12 +-- .../react_s3_fine_uploader.js | 94 +++++++++---------- 2 files changed, 45 insertions(+), 61 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index c7816a3a..212c39c9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -189,17 +189,7 @@ function bundle(watch) { .pipe(gulpif(!argv.production, sourcemaps.write())) // writes .map file .on('error', notify.onError('Error: <%= error.message %>')) .pipe(gulpif(argv.production, uglify({ - mangle: true, - compress: { - sequences: true, - dead_code: true, - conditionals: true, - booleans: true, - unused: true, - if_return: true, - join_vars: true, - drop_console: true - } + mangle: false }))) .on('error', notify.onError('Error: <%= error.message %>')) .pipe(gulp.dest('./build/js')) diff --git a/js/components/ascribe_uploader/react_s3_fine_uploader.js b/js/components/ascribe_uploader/react_s3_fine_uploader.js index ff72813b..5f616dcf 100644 --- a/js/components/ascribe_uploader/react_s3_fine_uploader.js +++ b/js/components/ascribe_uploader/react_s3_fine_uploader.js @@ -352,66 +352,60 @@ var ReactS3FineUploader = React.createClass({ }, onComplete(id, name, res, xhr) { - console.log(xhr); // there has been an issue with the server's connection if((xhr && xhr.status === 0) || res.error) { - console.log('asdasdas'); console.logGlobal(new Error(res.error || 'Complete was called but there wasn\t a success'), false, { files: this.state.filesToUpload, chunks: this.state.chunks }); + } else { + let files = this.state.filesToUpload; - return; - } + // Set the state of the completed file to 'upload successful' in order to + // remove it from the GUI + files[id].status = 'upload successful'; + files[id].key = this.state.uploader.getKey(id); - let files = this.state.filesToUpload; - - // Set the state of the completed file to 'upload successful' in order to - // remove it from the GUI - files[id].status = 'upload successful'; - files[id].key = this.state.uploader.getKey(id); - - let newState = React.addons.update(this.state, { - filesToUpload: { $set: files } - }); - - this.setState(newState); - - // Only after the blob has been created server-side, we can make the form submittable. - this.createBlob(files[id]) - .then(() => { - // since the form validation props isReadyForFormSubmission, setIsUploadReady and submitKey - // are optional, we'll only trigger them when they're actually defined - if(this.props.submitKey) { - this.props.submitKey(files[id].key); - } else { - console.warn('You didn\'t define submitKey in as a prop in react-s3-fine-uploader'); - } - - // for explanation, check comment of if statement above - if(this.props.isReadyForFormSubmission && this.props.setIsUploadReady) { - // also, lets check if after the completion of this upload, - // the form is ready for submission or not - if(this.props.isReadyForFormSubmission(this.state.filesToUpload)) { - // if so, set uploadstatus to true - this.props.setIsUploadReady(true); - } else { - this.props.setIsUploadReady(false); - } - } else { - console.warn('You didn\'t define the functions isReadyForFormSubmission and/or setIsUploadReady in as a prop in react-s3-fine-uploader'); - } - }) - .catch((err) => { - console.logGlobal(err, false, { - files: this.state.filesToUpload, - chunks: this.state.chunks - }); - let notification = new GlobalNotificationModel(err.message, 'danger', 5000); - GlobalNotificationActions.appendGlobalNotification(notification); + let newState = React.addons.update(this.state, { + filesToUpload: { $set: files } }); - + this.setState(newState); + + // Only after the blob has been created server-side, we can make the form submittable. + this.createBlob(files[id]) + .then(() => { + // since the form validation props isReadyForFormSubmission, setIsUploadReady and submitKey + // are optional, we'll only trigger them when they're actually defined + if(this.props.submitKey) { + this.props.submitKey(files[id].key); + } else { + console.warn('You didn\'t define submitKey in as a prop in react-s3-fine-uploader'); + } + + // for explanation, check comment of if statement above + if(this.props.isReadyForFormSubmission && this.props.setIsUploadReady) { + // also, lets check if after the completion of this upload, + // the form is ready for submission or not + if(this.props.isReadyForFormSubmission(this.state.filesToUpload)) { + // if so, set uploadstatus to true + this.props.setIsUploadReady(true); + } else { + this.props.setIsUploadReady(false); + } + } else { + console.warn('You didn\'t define the functions isReadyForFormSubmission and/or setIsUploadReady in as a prop in react-s3-fine-uploader'); + } + }) + .catch((err) => { + console.logGlobal(err, false, { + files: this.state.filesToUpload, + chunks: this.state.chunks + }); + let notification = new GlobalNotificationModel(err.message, 'danger', 5000); + GlobalNotificationActions.appendGlobalNotification(notification); + }); + } }, onError(id, name, errorReason) { From 4374235c1b87da89175139108171f6fa03759d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Thu, 3 Sep 2015 17:55:15 +0200 Subject: [PATCH 08/31] use log global again --- js/components/ascribe_uploader/react_s3_fine_uploader.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/components/ascribe_uploader/react_s3_fine_uploader.js b/js/components/ascribe_uploader/react_s3_fine_uploader.js index 5f616dcf..8605379c 100644 --- a/js/components/ascribe_uploader/react_s3_fine_uploader.js +++ b/js/components/ascribe_uploader/react_s3_fine_uploader.js @@ -3,6 +3,7 @@ import React from 'react/addons'; import Router from 'react-router'; import Q from 'q'; +import Raven from 'raven-js'; import { getCookie } from '../../utils/fetch_api_utils'; import { getLangText } from '../../utils/lang_utils'; From c1a5790bfe35d5b403035b0ab36a115f8c0e1f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 4 Sep 2015 18:04:03 +0200 Subject: [PATCH 09/31] activate mangling --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 212c39c9..3c92945d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -189,7 +189,7 @@ function bundle(watch) { .pipe(gulpif(!argv.production, sourcemaps.write())) // writes .map file .on('error', notify.onError('Error: <%= error.message %>')) .pipe(gulpif(argv.production, uglify({ - mangle: false + mangle: true }))) .on('error', notify.onError('Error: <%= error.message %>')) .pipe(gulp.dest('./build/js')) From ac28ef4ee023d7a9893e6b93df0d2156e7b7cbb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 4 Sep 2015 18:15:42 +0200 Subject: [PATCH 10/31] remove raven --- js/components/ascribe_uploader/react_s3_fine_uploader.js | 1 - 1 file changed, 1 deletion(-) diff --git a/js/components/ascribe_uploader/react_s3_fine_uploader.js b/js/components/ascribe_uploader/react_s3_fine_uploader.js index 8605379c..5f616dcf 100644 --- a/js/components/ascribe_uploader/react_s3_fine_uploader.js +++ b/js/components/ascribe_uploader/react_s3_fine_uploader.js @@ -3,7 +3,6 @@ import React from 'react/addons'; import Router from 'react-router'; import Q from 'q'; -import Raven from 'raven-js'; import { getCookie } from '../../utils/fetch_api_utils'; import { getLangText } from '../../utils/lang_utils'; From 8e98a7bff7f049cadd3df02af67ac5e38a278bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 4 Sep 2015 14:54:39 +0200 Subject: [PATCH 11/31] show overall progress --- js/app.js | 1 - .../file_drag_and_drop_preview.js | 2 +- .../file_drag_and_drop_preview_iterator.js | 43 +++++++++++-------- .../file_drag_and_drop_preview_progress.js | 38 ++++++++++++++++ .../react_s3_fine_uploader.js | 1 - .../ikonotv_accordion_list_item.js | 3 -- .../whitelabel/wallet/wallet_routes.js | 2 +- js/third_party/ga.js | 1 - sass/ascribe_uploader.scss | 8 ++++ 9 files changed, 72 insertions(+), 27 deletions(-) create mode 100644 js/components/ascribe_uploader/file_drag_and_drop_preview_progress.js diff --git a/js/app.js b/js/app.js index 6dcf58bf..addd0494 100644 --- a/js/app.js +++ b/js/app.js @@ -45,7 +45,6 @@ requests.defaults({ class AppGateway { - start() { let settings; let subdomain = window.location.host.split('.')[0]; diff --git a/js/components/ascribe_uploader/file_drag_and_drop_preview.js b/js/components/ascribe_uploader/file_drag_and_drop_preview.js index 9c6cdbdd..05c4a688 100644 --- a/js/components/ascribe_uploader/file_drag_and_drop_preview.js +++ b/js/components/ascribe_uploader/file_drag_and_drop_preview.js @@ -72,7 +72,7 @@ let FileDragAndDropPreview = React.createClass({ if(this.props.areAssetsEditable) { removeBtn = (
-