Merge pull request #456 from lbryio/incorporate-components
Move React code back into spee.ch codebase
This commit is contained in:
commit
97067f00db
238 changed files with 12130 additions and 31 deletions
|
@ -3,3 +3,4 @@ exports/
|
||||||
index.js
|
index.js
|
||||||
test/
|
test/
|
||||||
server/render/build
|
server/render/build
|
||||||
|
client/build
|
||||||
|
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,4 +1,6 @@
|
||||||
node_modules
|
node_modules
|
||||||
.idea
|
.DS_Store
|
||||||
|
*.log
|
||||||
|
.idea/
|
||||||
/devConfig/sequelizeCliConfig.js
|
/devConfig/sequelizeCliConfig.js
|
||||||
/devConfig/testingConfig.js
|
/devConfig/testingConfig.js
|
||||||
|
|
3
.npmignore
Normal file
3
.npmignore
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
client/src
|
||||||
|
server/render/src
|
||||||
|
.babelrc
|
36
client/build/actions/channel.js
Normal file
36
client/build/actions/channel.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.updateLoggedInChannel = updateLoggedInChannel;
|
||||||
|
exports.checkForLoggedInChannel = checkForLoggedInChannel;
|
||||||
|
exports.logOutChannel = logOutChannel;
|
||||||
|
|
||||||
|
var actions = _interopRequireWildcard(require("../constants/channel_action_types"));
|
||||||
|
|
||||||
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||||
|
|
||||||
|
// export action creators
|
||||||
|
function updateLoggedInChannel(name, shortId, longId) {
|
||||||
|
return {
|
||||||
|
type: actions.CHANNEL_UPDATE,
|
||||||
|
data: {
|
||||||
|
name: name,
|
||||||
|
shortId: shortId,
|
||||||
|
longId: longId
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkForLoggedInChannel() {
|
||||||
|
return {
|
||||||
|
type: actions.CHANNEL_LOGIN_CHECK
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function logOutChannel() {
|
||||||
|
return {
|
||||||
|
type: actions.CHANNEL_LOGOUT
|
||||||
|
};
|
||||||
|
}
|
55
client/build/actions/channelCreate.js
Normal file
55
client/build/actions/channelCreate.js
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.updateChannelCreateName = updateChannelCreateName;
|
||||||
|
exports.updateChannelCreatePassword = updateChannelCreatePassword;
|
||||||
|
exports.updateChannelCreateStatus = updateChannelCreateStatus;
|
||||||
|
exports.updateChannelAvailability = updateChannelAvailability;
|
||||||
|
exports.createChannel = createChannel;
|
||||||
|
|
||||||
|
var actions = _interopRequireWildcard(require("../constants/channel_create_action_types"));
|
||||||
|
|
||||||
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||||
|
|
||||||
|
// export action creators
|
||||||
|
function updateChannelCreateName(name, value) {
|
||||||
|
return {
|
||||||
|
type: actions.CHANNEL_CREATE_UPDATE_NAME,
|
||||||
|
data: {
|
||||||
|
name: name,
|
||||||
|
value: value
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateChannelCreatePassword(name, value) {
|
||||||
|
return {
|
||||||
|
type: actions.CHANNEL_CREATE_UPDATE_PASSWORD,
|
||||||
|
data: {
|
||||||
|
name: name,
|
||||||
|
value: value
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateChannelCreateStatus(status) {
|
||||||
|
return {
|
||||||
|
type: actions.CHANNEL_CREATE_UPDATE_STATUS,
|
||||||
|
data: status
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateChannelAvailability(channel) {
|
||||||
|
return {
|
||||||
|
type: actions.CHANNEL_AVAILABILITY,
|
||||||
|
data: channel
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function createChannel() {
|
||||||
|
return {
|
||||||
|
type: actions.CHANNEL_CREATE
|
||||||
|
};
|
||||||
|
}
|
15
client/build/actions/index.js
Normal file
15
client/build/actions/index.js
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _show = require("./show");
|
||||||
|
|
||||||
|
// import { } from './channel';
|
||||||
|
// import { } from './publish';
|
||||||
|
var _default = {
|
||||||
|
onHandleShowPageUri: _show.onHandleShowPageUri
|
||||||
|
};
|
||||||
|
exports.default = _default;
|
118
client/build/actions/publish.js
Normal file
118
client/build/actions/publish.js
Normal file
|
@ -0,0 +1,118 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.selectFile = selectFile;
|
||||||
|
exports.clearFile = clearFile;
|
||||||
|
exports.updateMetadata = updateMetadata;
|
||||||
|
exports.updateClaim = updateClaim;
|
||||||
|
exports.setPublishInChannel = setPublishInChannel;
|
||||||
|
exports.updatePublishStatus = updatePublishStatus;
|
||||||
|
exports.updateError = updateError;
|
||||||
|
exports.updateSelectedChannel = updateSelectedChannel;
|
||||||
|
exports.toggleMetadataInputs = toggleMetadataInputs;
|
||||||
|
exports.onNewThumbnail = onNewThumbnail;
|
||||||
|
exports.startPublish = startPublish;
|
||||||
|
exports.validateClaim = validateClaim;
|
||||||
|
|
||||||
|
var actions = _interopRequireWildcard(require("../constants/publish_action_types"));
|
||||||
|
|
||||||
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||||
|
|
||||||
|
// export action creators
|
||||||
|
function selectFile(file) {
|
||||||
|
return {
|
||||||
|
type: actions.FILE_SELECTED,
|
||||||
|
data: file
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearFile() {
|
||||||
|
return {
|
||||||
|
type: actions.FILE_CLEAR
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateMetadata(name, value) {
|
||||||
|
return {
|
||||||
|
type: actions.METADATA_UPDATE,
|
||||||
|
data: {
|
||||||
|
name: name,
|
||||||
|
value: value
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateClaim(value) {
|
||||||
|
return {
|
||||||
|
type: actions.CLAIM_UPDATE,
|
||||||
|
data: value
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function setPublishInChannel(channel) {
|
||||||
|
return {
|
||||||
|
type: actions.SET_PUBLISH_IN_CHANNEL,
|
||||||
|
channel: channel
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function updatePublishStatus(status, message) {
|
||||||
|
return {
|
||||||
|
type: actions.PUBLISH_STATUS_UPDATE,
|
||||||
|
data: {
|
||||||
|
status: status,
|
||||||
|
message: message
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateError(name, value) {
|
||||||
|
return {
|
||||||
|
type: actions.ERROR_UPDATE,
|
||||||
|
data: {
|
||||||
|
name: name,
|
||||||
|
value: value
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateSelectedChannel(channelName) {
|
||||||
|
return {
|
||||||
|
type: actions.SELECTED_CHANNEL_UPDATE,
|
||||||
|
data: channelName
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleMetadataInputs(showMetadataInputs) {
|
||||||
|
return {
|
||||||
|
type: actions.TOGGLE_METADATA_INPUTS,
|
||||||
|
data: showMetadataInputs
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function onNewThumbnail(file) {
|
||||||
|
return {
|
||||||
|
type: actions.THUMBNAIL_NEW,
|
||||||
|
data: file
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function startPublish(history) {
|
||||||
|
return {
|
||||||
|
type: actions.PUBLISH_START,
|
||||||
|
data: {
|
||||||
|
history: history
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function validateClaim(claim) {
|
||||||
|
return {
|
||||||
|
type: actions.CLAIM_AVAILABILITY,
|
||||||
|
data: claim
|
||||||
|
};
|
||||||
|
}
|
192
client/build/actions/show.js
Normal file
192
client/build/actions/show.js
Normal file
|
@ -0,0 +1,192 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.onHandleShowPageUri = onHandleShowPageUri;
|
||||||
|
exports.onRequestError = onRequestError;
|
||||||
|
exports.onNewChannelRequest = onNewChannelRequest;
|
||||||
|
exports.onNewAssetRequest = onNewAssetRequest;
|
||||||
|
exports.onRequestUpdate = onRequestUpdate;
|
||||||
|
exports.addRequestToRequestList = addRequestToRequestList;
|
||||||
|
exports.addAssetToAssetList = addAssetToAssetList;
|
||||||
|
exports.addNewChannelToChannelList = addNewChannelToChannelList;
|
||||||
|
exports.onUpdateChannelClaims = onUpdateChannelClaims;
|
||||||
|
exports.updateChannelClaims = updateChannelClaims;
|
||||||
|
exports.fileRequested = fileRequested;
|
||||||
|
exports.updateFileAvailability = updateFileAvailability;
|
||||||
|
exports.updateDisplayAssetError = updateDisplayAssetError;
|
||||||
|
|
||||||
|
var actions = _interopRequireWildcard(require("../constants/show_action_types"));
|
||||||
|
|
||||||
|
var _show_request_types = require("../constants/show_request_types");
|
||||||
|
|
||||||
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||||
|
|
||||||
|
// basic request parsing
|
||||||
|
function onHandleShowPageUri(params) {
|
||||||
|
return {
|
||||||
|
type: actions.HANDLE_SHOW_URI,
|
||||||
|
data: params
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function onRequestError(error) {
|
||||||
|
return {
|
||||||
|
type: actions.REQUEST_ERROR,
|
||||||
|
data: error
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function onNewChannelRequest(channelName, channelId) {
|
||||||
|
var requestType = _show_request_types.CHANNEL;
|
||||||
|
var requestId = "cr#".concat(channelName, "#").concat(channelId);
|
||||||
|
return {
|
||||||
|
type: actions.CHANNEL_REQUEST_NEW,
|
||||||
|
data: {
|
||||||
|
requestType: requestType,
|
||||||
|
requestId: requestId,
|
||||||
|
channelName: channelName,
|
||||||
|
channelId: channelId
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function onNewAssetRequest(name, id, channelName, channelId, extension) {
|
||||||
|
var requestType = extension ? _show_request_types.ASSET_LITE : _show_request_types.ASSET_DETAILS;
|
||||||
|
var requestId = "ar#".concat(name, "#").concat(id, "#").concat(channelName, "#").concat(channelId);
|
||||||
|
return {
|
||||||
|
type: actions.ASSET_REQUEST_NEW,
|
||||||
|
data: {
|
||||||
|
requestType: requestType,
|
||||||
|
requestId: requestId,
|
||||||
|
name: name,
|
||||||
|
modifier: {
|
||||||
|
id: id,
|
||||||
|
channel: {
|
||||||
|
name: channelName,
|
||||||
|
id: channelId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function onRequestUpdate(requestType, requestId) {
|
||||||
|
return {
|
||||||
|
type: actions.REQUEST_UPDATE,
|
||||||
|
data: {
|
||||||
|
requestType: requestType,
|
||||||
|
requestId: requestId
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function addRequestToRequestList(id, error, key) {
|
||||||
|
return {
|
||||||
|
type: actions.REQUEST_LIST_ADD,
|
||||||
|
data: {
|
||||||
|
id: id,
|
||||||
|
error: error,
|
||||||
|
key: key
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
; // asset actions
|
||||||
|
|
||||||
|
function addAssetToAssetList(id, error, name, claimId, shortId, claimData) {
|
||||||
|
return {
|
||||||
|
type: actions.ASSET_ADD,
|
||||||
|
data: {
|
||||||
|
id: id,
|
||||||
|
error: error,
|
||||||
|
name: name,
|
||||||
|
claimId: claimId,
|
||||||
|
shortId: shortId,
|
||||||
|
claimData: claimData
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} // channel actions
|
||||||
|
|
||||||
|
|
||||||
|
function addNewChannelToChannelList(id, name, shortId, longId, claimsData) {
|
||||||
|
return {
|
||||||
|
type: actions.CHANNEL_ADD,
|
||||||
|
data: {
|
||||||
|
id: id,
|
||||||
|
name: name,
|
||||||
|
shortId: shortId,
|
||||||
|
longId: longId,
|
||||||
|
claimsData: claimsData
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function onUpdateChannelClaims(channelKey, name, longId, page) {
|
||||||
|
return {
|
||||||
|
type: actions.CHANNEL_CLAIMS_UPDATE_ASYNC,
|
||||||
|
data: {
|
||||||
|
channelKey: channelKey,
|
||||||
|
name: name,
|
||||||
|
longId: longId,
|
||||||
|
page: page
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function updateChannelClaims(channelListId, claimsData) {
|
||||||
|
return {
|
||||||
|
type: actions.CHANNEL_CLAIMS_UPDATE_SUCCESS,
|
||||||
|
data: {
|
||||||
|
channelListId: channelListId,
|
||||||
|
claimsData: claimsData
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
; // display a file
|
||||||
|
|
||||||
|
function fileRequested(name, claimId) {
|
||||||
|
return {
|
||||||
|
type: actions.FILE_REQUESTED,
|
||||||
|
data: {
|
||||||
|
name: name,
|
||||||
|
claimId: claimId
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function updateFileAvailability(status) {
|
||||||
|
return {
|
||||||
|
type: actions.FILE_AVAILABILITY_UPDATE,
|
||||||
|
data: status
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function updateDisplayAssetError(error) {
|
||||||
|
return {
|
||||||
|
type: actions.DISPLAY_ASSET_ERROR,
|
||||||
|
data: error
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
60
client/build/api/assetApi.js
Normal file
60
client/build/api/assetApi.js
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.getLongClaimId = getLongClaimId;
|
||||||
|
exports.getShortId = getShortId;
|
||||||
|
exports.getClaimData = getClaimData;
|
||||||
|
exports.checkClaimAvailability = checkClaimAvailability;
|
||||||
|
|
||||||
|
var _request = _interopRequireDefault(require("../utils/request"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function getLongClaimId(host, name, modifier) {
|
||||||
|
var body = {}; // create request params
|
||||||
|
|
||||||
|
if (modifier) {
|
||||||
|
if (modifier.id) {
|
||||||
|
body['claimId'] = modifier.id;
|
||||||
|
} else {
|
||||||
|
body['channelName'] = modifier.channel.name;
|
||||||
|
body['channelClaimId'] = modifier.channel.id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
body['claimName'] = name;
|
||||||
|
var params = {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify(body)
|
||||||
|
}; // create url
|
||||||
|
|
||||||
|
var url = "".concat(host, "/api/claim/long-id"); // return the request promise
|
||||||
|
|
||||||
|
return (0, _request.default)(url, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function getShortId(host, name, claimId) {
|
||||||
|
var url = "".concat(host, "/api/claim/short-id/").concat(claimId, "/").concat(name);
|
||||||
|
return (0, _request.default)(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function getClaimData(host, name, claimId) {
|
||||||
|
var url = "".concat(host, "/api/claim/data/").concat(name, "/").concat(claimId);
|
||||||
|
return (0, _request.default)(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function checkClaimAvailability(claim) {
|
||||||
|
var url = "/api/claim/availability/".concat(claim);
|
||||||
|
return (0, _request.default)(url);
|
||||||
|
}
|
27
client/build/api/authApi.js
Normal file
27
client/build/api/authApi.js
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.checkForLoggedInChannelApi = checkForLoggedInChannelApi;
|
||||||
|
exports.channelLogoutApi = channelLogoutApi;
|
||||||
|
|
||||||
|
var _request = _interopRequireDefault(require("../utils/request"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function checkForLoggedInChannelApi() {
|
||||||
|
var url = "/user";
|
||||||
|
var params = {
|
||||||
|
credentials: 'include'
|
||||||
|
};
|
||||||
|
return (0, _request.default)(url, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
function channelLogoutApi() {
|
||||||
|
var url = "/logout";
|
||||||
|
var params = {
|
||||||
|
credentials: 'include'
|
||||||
|
};
|
||||||
|
return (0, _request.default)(url, params);
|
||||||
|
}
|
45
client/build/api/channelApi.js
Normal file
45
client/build/api/channelApi.js
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.getChannelData = getChannelData;
|
||||||
|
exports.getChannelClaims = getChannelClaims;
|
||||||
|
exports.checkChannelAvailability = checkChannelAvailability;
|
||||||
|
exports.makeCreateChannelRequest = makeCreateChannelRequest;
|
||||||
|
|
||||||
|
var _request = _interopRequireDefault(require("../utils/request"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function getChannelData(host, name, id) {
|
||||||
|
if (!id) id = 'none';
|
||||||
|
var url = "".concat(host, "/api/channel/data/").concat(name, "/").concat(id);
|
||||||
|
return (0, _request.default)(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getChannelClaims(host, name, longId, page) {
|
||||||
|
if (!page) page = 1;
|
||||||
|
var url = "".concat(host, "/api/channel/claims/").concat(name, "/").concat(longId, "/").concat(page);
|
||||||
|
return (0, _request.default)(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkChannelAvailability(channel) {
|
||||||
|
var url = "/api/channel/availability/".concat(channel);
|
||||||
|
return (0, _request.default)(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
function makeCreateChannelRequest(username, password) {
|
||||||
|
var params = {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify({
|
||||||
|
username: username,
|
||||||
|
password: password
|
||||||
|
}),
|
||||||
|
headers: new Headers({
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}),
|
||||||
|
credentials: 'include'
|
||||||
|
};
|
||||||
|
return (0, _request.default)('/signup', params);
|
||||||
|
}
|
21
client/build/api/fileApi.js
Normal file
21
client/build/api/fileApi.js
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.checkFileAvailability = checkFileAvailability;
|
||||||
|
exports.triggerClaimGet = triggerClaimGet;
|
||||||
|
|
||||||
|
var _request = _interopRequireDefault(require("../utils/request"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function checkFileAvailability(claimId, host, name) {
|
||||||
|
var url = "".concat(host, "/api/file/availability/").concat(name, "/").concat(claimId);
|
||||||
|
return (0, _request.default)(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
function triggerClaimGet(claimId, host, name) {
|
||||||
|
var url = "".concat(host, "/api/claim/get/").concat(name, "/").concat(claimId);
|
||||||
|
return (0, _request.default)(url);
|
||||||
|
}
|
57
client/build/app.js
Normal file
57
client/build/app.js
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _reactRouterDom = require("react-router-dom");
|
||||||
|
|
||||||
|
var _HomePage = _interopRequireDefault(require("@pages/HomePage"));
|
||||||
|
|
||||||
|
var _AboutPage = _interopRequireDefault(require("@pages/AboutPage"));
|
||||||
|
|
||||||
|
var _LoginPage = _interopRequireDefault(require("@pages/LoginPage"));
|
||||||
|
|
||||||
|
var _ShowPage = _interopRequireDefault(require("@pages/ShowPage"));
|
||||||
|
|
||||||
|
var _FourOhFourPage = _interopRequireDefault(require("@pages/FourOhFourPage"));
|
||||||
|
|
||||||
|
var _MultisitePage = _interopRequireDefault(require("@pages/MultisitePage"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var customizedApp = function customizedApp() {
|
||||||
|
return _react.default.createElement(_reactRouterDom.Switch, null, _react.default.createElement(_reactRouterDom.Route, {
|
||||||
|
exact: true,
|
||||||
|
path: "/",
|
||||||
|
component: _HomePage.default
|
||||||
|
}), _react.default.createElement(_reactRouterDom.Route, {
|
||||||
|
exact: true,
|
||||||
|
path: "/about",
|
||||||
|
component: _AboutPage.default
|
||||||
|
}), _react.default.createElement(_reactRouterDom.Route, {
|
||||||
|
exact: true,
|
||||||
|
path: "/login",
|
||||||
|
component: _LoginPage.default
|
||||||
|
}), _react.default.createElement(_reactRouterDom.Route, {
|
||||||
|
exact: true,
|
||||||
|
path: "/multisite",
|
||||||
|
component: _MultisitePage.default
|
||||||
|
}), _react.default.createElement(_reactRouterDom.Route, {
|
||||||
|
exact: true,
|
||||||
|
path: "/:identifier/:claim",
|
||||||
|
component: _ShowPage.default
|
||||||
|
}), _react.default.createElement(_reactRouterDom.Route, {
|
||||||
|
exact: true,
|
||||||
|
path: "/:claim",
|
||||||
|
component: _ShowPage.default
|
||||||
|
}), _react.default.createElement(_reactRouterDom.Route, {
|
||||||
|
component: _FourOhFourPage.default
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = customizedApp;
|
||||||
|
exports.default = _default;
|
72
client/build/channels/publish.js
Normal file
72
client/build/channels/publish.js
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.makePublishRequestChannel = void 0;
|
||||||
|
|
||||||
|
var _reduxSaga = require("redux-saga");
|
||||||
|
|
||||||
|
var makePublishRequestChannel = function makePublishRequestChannel(fd) {
|
||||||
|
return (0, _reduxSaga.eventChannel)(function (emitter) {
|
||||||
|
var uri = '/api/claim/publish';
|
||||||
|
var xhr = new XMLHttpRequest(); // add event listeners
|
||||||
|
|
||||||
|
var onLoadStart = function onLoadStart() {
|
||||||
|
emitter({
|
||||||
|
loadStart: true
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var onProgress = function onProgress(event) {
|
||||||
|
if (event.lengthComputable) {
|
||||||
|
var percentage = Math.round(event.loaded * 100 / event.total);
|
||||||
|
emitter({
|
||||||
|
progress: percentage
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var onLoad = function onLoad() {
|
||||||
|
emitter({
|
||||||
|
load: true
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.upload.addEventListener('loadstart', onLoadStart);
|
||||||
|
xhr.upload.addEventListener('progress', onProgress);
|
||||||
|
xhr.upload.addEventListener('load', onLoad); // set state change handler
|
||||||
|
|
||||||
|
xhr.onreadystatechange = function () {
|
||||||
|
if (xhr.readyState === 4) {
|
||||||
|
var response = JSON.parse(xhr.response);
|
||||||
|
|
||||||
|
if (xhr.status === 200 && response.success) {
|
||||||
|
emitter({
|
||||||
|
success: response
|
||||||
|
});
|
||||||
|
emitter(_reduxSaga.END);
|
||||||
|
} else {
|
||||||
|
emitter({
|
||||||
|
error: new Error(response.message)
|
||||||
|
});
|
||||||
|
emitter(_reduxSaga.END);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}; // open and send
|
||||||
|
|
||||||
|
|
||||||
|
xhr.open('POST', uri, true);
|
||||||
|
xhr.send(fd); // clean up
|
||||||
|
|
||||||
|
return function () {
|
||||||
|
xhr.upload.removeEventListener('loadstart', onLoadStart);
|
||||||
|
xhr.upload.removeEventListener('progress', onProgress);
|
||||||
|
xhr.upload.removeEventListener('load', onLoad);
|
||||||
|
xhr.onreadystatechange = null;
|
||||||
|
xhr.abort();
|
||||||
|
};
|
||||||
|
}, _reduxSaga.buffers.sliding(2));
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.makePublishRequestChannel = makePublishRequestChannel;
|
19
client/build/components/ActiveStatusBar/index.js
Normal file
19
client/build/components/ActiveStatusBar/index.js
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var ActiveStatusBar = function ActiveStatusBar() {
|
||||||
|
return _react.default.createElement("span", {
|
||||||
|
className: "progress-bar progress-bar--active"
|
||||||
|
}, "| ");
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = ActiveStatusBar;
|
||||||
|
exports.default = _default;
|
23
client/build/components/AssetPreview/index.js
Normal file
23
client/build/components/AssetPreview/index.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var defaultThumbnail = _ref.site.defaultThumbnail;
|
||||||
|
return {
|
||||||
|
defaultThumbnail: defaultThumbnail
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
54
client/build/components/AssetPreview/view.js
Normal file
54
client/build/components/AssetPreview/view.js
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _reactRouterDom = require("react-router-dom");
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var AssetPreview = function AssetPreview(_ref) {
|
||||||
|
var defaultThumbnail = _ref.defaultThumbnail,
|
||||||
|
_ref$claimData = _ref.claimData,
|
||||||
|
name = _ref$claimData.name,
|
||||||
|
claimId = _ref$claimData.claimId,
|
||||||
|
fileExt = _ref$claimData.fileExt,
|
||||||
|
contentType = _ref$claimData.contentType,
|
||||||
|
thumbnail = _ref$claimData.thumbnail;
|
||||||
|
var directSourceLink = "".concat(claimId, "/").concat(name, ".").concat(fileExt);
|
||||||
|
var showUrlLink = "/".concat(claimId, "/").concat(name);
|
||||||
|
return _react.default.createElement("div", {
|
||||||
|
className: "asset-holder"
|
||||||
|
}, _react.default.createElement(_reactRouterDom.Link, {
|
||||||
|
to: showUrlLink
|
||||||
|
}, function () {
|
||||||
|
switch (contentType) {
|
||||||
|
case 'image/jpeg':
|
||||||
|
case 'image/jpg':
|
||||||
|
case 'image/png':
|
||||||
|
case 'image/gif':
|
||||||
|
return _react.default.createElement("img", {
|
||||||
|
className: 'asset-preview',
|
||||||
|
src: directSourceLink,
|
||||||
|
alt: name
|
||||||
|
});
|
||||||
|
|
||||||
|
case 'video/mp4':
|
||||||
|
return _react.default.createElement("img", {
|
||||||
|
className: 'asset-preview video',
|
||||||
|
src: thumbnail || defaultThumbnail,
|
||||||
|
alt: name
|
||||||
|
});
|
||||||
|
|
||||||
|
default:
|
||||||
|
return _react.default.createElement("p", null, "unsupported file type");
|
||||||
|
}
|
||||||
|
}()));
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = AssetPreview;
|
||||||
|
exports.default = _default;
|
94
client/build/components/ExpandingTextArea/index.js
Normal file
94
client/build/components/ExpandingTextArea/index.js
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireWildcard(require("react"));
|
||||||
|
|
||||||
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
var ExpandingTextarea =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_Component) {
|
||||||
|
function ExpandingTextarea(props) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, ExpandingTextarea);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(ExpandingTextarea).call(this, props));
|
||||||
|
_this._handleChange = _this._handleChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(ExpandingTextarea, [{
|
||||||
|
key: "componentDidMount",
|
||||||
|
value: function componentDidMount() {
|
||||||
|
this.adjustTextarea({});
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "_handleChange",
|
||||||
|
value: function _handleChange(event) {
|
||||||
|
var onChange = this.props.onChange;
|
||||||
|
if (onChange) onChange(event);
|
||||||
|
this.adjustTextarea(event);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "adjustTextarea",
|
||||||
|
value: function adjustTextarea(_ref) {
|
||||||
|
var _ref$target = _ref.target,
|
||||||
|
target = _ref$target === void 0 ? this.el : _ref$target;
|
||||||
|
target.style.height = 0;
|
||||||
|
target.style.height = "".concat(target.scrollHeight, "px");
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
var rest = _extends({}, this.props);
|
||||||
|
|
||||||
|
return _react.default.createElement("textarea", _extends({}, rest, {
|
||||||
|
ref: function ref(x) {
|
||||||
|
return _this2.el = x;
|
||||||
|
},
|
||||||
|
onChange: this._handleChange
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(ExpandingTextarea, _Component);
|
||||||
|
|
||||||
|
return ExpandingTextarea;
|
||||||
|
}(_react.Component);
|
||||||
|
|
||||||
|
ExpandingTextarea.propTypes = {
|
||||||
|
onChange: _propTypes.default.func
|
||||||
|
};
|
||||||
|
var _default = ExpandingTextarea;
|
||||||
|
exports.default = _default;
|
79
client/build/components/GAListener/index.js
Normal file
79
client/build/components/GAListener/index.js
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _reactGa = _interopRequireDefault(require("react-ga"));
|
||||||
|
|
||||||
|
var _reactRouterDom = require("react-router-dom");
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var customGAListener = function customGAListener(siteConfig) {
|
||||||
|
var googleId = siteConfig.analytics.googleId;
|
||||||
|
|
||||||
|
_reactGa.default.initialize(googleId);
|
||||||
|
|
||||||
|
var GAListener =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function GAListener() {
|
||||||
|
_classCallCheck(this, GAListener);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(GAListener).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(GAListener, [{
|
||||||
|
key: "componentDidMount",
|
||||||
|
value: function componentDidMount() {
|
||||||
|
this.sendPageView(this.props.history.location);
|
||||||
|
this.props.history.listen(this.sendPageView);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "sendPageView",
|
||||||
|
value: function sendPageView(location) {
|
||||||
|
_reactGa.default.set({
|
||||||
|
page: location.pathname
|
||||||
|
});
|
||||||
|
|
||||||
|
_reactGa.default.pageview(location.pathname);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
return this.props.children;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(GAListener, _React$Component);
|
||||||
|
|
||||||
|
return GAListener;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
return (0, _reactRouterDom.withRouter)(GAListener);
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = customGAListener;
|
||||||
|
exports.default = _default;
|
19
client/build/components/InactiveStatusBar/index.js
Normal file
19
client/build/components/InactiveStatusBar/index.js
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var InactiveStatusBar = function InactiveStatusBar() {
|
||||||
|
return _react.default.createElement("span", {
|
||||||
|
className: "progress-bar progress-bar--inactive"
|
||||||
|
}, "| ");
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = InactiveStatusBar;
|
||||||
|
exports.default = _default;
|
81
client/build/components/Logo/index.js
Normal file
81
client/build/components/Logo/index.js
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _reactRouterDom = require("react-router-dom");
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function Logo() {
|
||||||
|
return _react.default.createElement("svg", {
|
||||||
|
version: "1.1",
|
||||||
|
id: "Layer_1",
|
||||||
|
x: "0px",
|
||||||
|
y: "0px",
|
||||||
|
height: "24px",
|
||||||
|
viewBox: "0 0 80 31",
|
||||||
|
enableBackground: "new 0 0 80 31",
|
||||||
|
className: "nav-bar-logo"
|
||||||
|
}, _react.default.createElement(_reactRouterDom.Link, {
|
||||||
|
to: "/"
|
||||||
|
}, _react.default.createElement("title", null, "Logo"), _react.default.createElement("desc", null, "Spee.ch logo"), _react.default.createElement("g", {
|
||||||
|
id: "About"
|
||||||
|
}, _react.default.createElement("g", {
|
||||||
|
id: "Publish-Form-V2-_x28_filled_x29_",
|
||||||
|
transform: "translate(-42.000000, -23.000000)"
|
||||||
|
}, _react.default.createElement("g", {
|
||||||
|
id: "Group-17",
|
||||||
|
transform: "translate(42.000000, 22.000000)"
|
||||||
|
}, _react.default.createElement("text", {
|
||||||
|
transform: "matrix(1 0 0 1 0 20)",
|
||||||
|
fontSize: "25",
|
||||||
|
fontFamily: "Roboto"
|
||||||
|
}, "Spee<h"), _react.default.createElement("g", {
|
||||||
|
id: "Group-16",
|
||||||
|
transform: "translate(0.000000, 30.000000)"
|
||||||
|
}, _react.default.createElement("path", {
|
||||||
|
id: "Line-8",
|
||||||
|
fill: "none",
|
||||||
|
stroke: "#09F911",
|
||||||
|
strokeWidth: "1",
|
||||||
|
strokeLinecap: "square",
|
||||||
|
d: "M0.5,1.5h15"
|
||||||
|
}), _react.default.createElement("path", {
|
||||||
|
id: "Line-8-Copy",
|
||||||
|
fill: "none",
|
||||||
|
stroke: "#029D74",
|
||||||
|
strokeWidth: "1",
|
||||||
|
strokeLinecap: "square",
|
||||||
|
d: "M16.5,1.5h15"
|
||||||
|
}), _react.default.createElement("path", {
|
||||||
|
id: "Line-8-Copy-2",
|
||||||
|
fill: "none",
|
||||||
|
stroke: "#E35BD8",
|
||||||
|
strokeWidth: "1",
|
||||||
|
strokeLinecap: "square",
|
||||||
|
d: "M32.5,1.5h15"
|
||||||
|
}), _react.default.createElement("path", {
|
||||||
|
id: "Line-8-Copy-3",
|
||||||
|
fill: "none",
|
||||||
|
stroke: "#4156C5",
|
||||||
|
strokeWidth: "1",
|
||||||
|
strokeLinecap: "square",
|
||||||
|
d: "M48.5,1.5h15"
|
||||||
|
}), _react.default.createElement("path", {
|
||||||
|
id: "Line-8-Copy-4",
|
||||||
|
fill: "none",
|
||||||
|
stroke: "#635688",
|
||||||
|
strokeWidth: "1",
|
||||||
|
strokeLinecap: "square",
|
||||||
|
d: "M64.5,1.5h15"
|
||||||
|
})))))));
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = Logo;
|
||||||
|
exports.default = _default;
|
|
@ -0,0 +1,35 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function NavBarChannelDropdown(_ref) {
|
||||||
|
var channelName = _ref.channelName,
|
||||||
|
handleSelection = _ref.handleSelection,
|
||||||
|
defaultSelection = _ref.defaultSelection,
|
||||||
|
VIEW = _ref.VIEW,
|
||||||
|
LOGOUT = _ref.LOGOUT;
|
||||||
|
return _react.default.createElement("select", {
|
||||||
|
type: "text",
|
||||||
|
id: "nav-bar-channel-select",
|
||||||
|
className: "select select--arrow link--nav",
|
||||||
|
onChange: handleSelection,
|
||||||
|
value: defaultSelection
|
||||||
|
}, _react.default.createElement("option", {
|
||||||
|
id: "nav-bar-channel-select-channel-option"
|
||||||
|
}, channelName), _react.default.createElement("option", {
|
||||||
|
value: VIEW
|
||||||
|
}, "View"), _react.default.createElement("option", {
|
||||||
|
value: LOGOUT
|
||||||
|
}, "Logout"));
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = NavBarChannelDropdown;
|
||||||
|
exports.default = _default;
|
145
client/build/components/ProgressBar/index.js
Normal file
145
client/build/components/ProgressBar/index.js
Normal file
|
@ -0,0 +1,145 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
||||||
|
|
||||||
|
var _ActiveStatusBar = _interopRequireDefault(require("../ActiveStatusBar"));
|
||||||
|
|
||||||
|
var _InactiveStatusBar = _interopRequireDefault(require("../InactiveStatusBar"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
var ProgressBar =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function ProgressBar(props) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, ProgressBar);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(ProgressBar).call(this, props));
|
||||||
|
_this.state = {
|
||||||
|
bars: [],
|
||||||
|
index: 0,
|
||||||
|
incrementer: 1
|
||||||
|
};
|
||||||
|
_this.createBars = _this.createBars.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.startProgressBar = _this.startProgressBar.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.updateProgressBar = _this.updateProgressBar.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.stopProgressBar = _this.stopProgressBar.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(ProgressBar, [{
|
||||||
|
key: "componentDidMount",
|
||||||
|
value: function componentDidMount() {
|
||||||
|
this.createBars();
|
||||||
|
this.startProgressBar();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "componentWillUnmount",
|
||||||
|
value: function componentWillUnmount() {
|
||||||
|
this.stopProgressBar();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "createBars",
|
||||||
|
value: function createBars() {
|
||||||
|
var bars = [];
|
||||||
|
|
||||||
|
for (var i = 0; i <= this.props.size; i++) {
|
||||||
|
bars.push({
|
||||||
|
isActive: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
bars: bars
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "startProgressBar",
|
||||||
|
value: function startProgressBar() {
|
||||||
|
this.updateInterval = setInterval(this.updateProgressBar.bind(this), 300);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "updateProgressBar",
|
||||||
|
value: function updateProgressBar() {
|
||||||
|
var index = this.state.index;
|
||||||
|
var incrementer = this.state.incrementer;
|
||||||
|
var bars = this.state.bars; // flip incrementer if necessary, to stay in bounds
|
||||||
|
|
||||||
|
if (index < 0 || index > this.props.size) {
|
||||||
|
incrementer = incrementer * -1;
|
||||||
|
index += incrementer;
|
||||||
|
} // update the indexed bar
|
||||||
|
|
||||||
|
|
||||||
|
if (incrementer > 0) {
|
||||||
|
bars[index].isActive = true;
|
||||||
|
} else {
|
||||||
|
bars[index].isActive = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
; // increment index
|
||||||
|
|
||||||
|
index += incrementer; // update state
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
bars: bars,
|
||||||
|
incrementer: incrementer,
|
||||||
|
index: index
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "stopProgressBar",
|
||||||
|
value: function stopProgressBar() {
|
||||||
|
clearInterval(this.updateInterval);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
return _react.default.createElement("div", null, this.state.bars.map(function (bar, index) {
|
||||||
|
return bar.isActive ? _react.default.createElement(_ActiveStatusBar.default, {
|
||||||
|
key: index
|
||||||
|
}) : _react.default.createElement(_InactiveStatusBar.default, {
|
||||||
|
key: index
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(ProgressBar, _React$Component);
|
||||||
|
|
||||||
|
return ProgressBar;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
ProgressBar.propTypes = {
|
||||||
|
size: _propTypes.default.number.isRequired
|
||||||
|
};
|
||||||
|
var _default = ProgressBar;
|
||||||
|
exports.default = _default;
|
123
client/build/components/PublishPreview/index.js
Normal file
123
client/build/components/PublishPreview/index.js
Normal file
|
@ -0,0 +1,123 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var PublishPreview =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function PublishPreview(props) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, PublishPreview);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(PublishPreview).call(this, props));
|
||||||
|
_this.state = {
|
||||||
|
imgSource: '',
|
||||||
|
defaultThumbnail: '/assets/img/video_thumb_default.png'
|
||||||
|
};
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(PublishPreview, [{
|
||||||
|
key: "componentDidMount",
|
||||||
|
value: function componentDidMount() {
|
||||||
|
this.setPreviewImageSource(this.props.file);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "componentWillReceiveProps",
|
||||||
|
value: function componentWillReceiveProps(newProps) {
|
||||||
|
if (newProps.file !== this.props.file) {
|
||||||
|
this.setPreviewImageSource(newProps.file);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newProps.thumbnail !== this.props.thumbnail) {
|
||||||
|
if (newProps.thumbnail) {
|
||||||
|
this.setPreviewImageSourceFromFile(newProps.thumbnail);
|
||||||
|
} else {
|
||||||
|
this.setState({
|
||||||
|
imgSource: this.state.defaultThumbnail
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "setPreviewImageSourceFromFile",
|
||||||
|
value: function setPreviewImageSourceFromFile(file) {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
var previewReader = new FileReader();
|
||||||
|
previewReader.readAsDataURL(file);
|
||||||
|
|
||||||
|
previewReader.onloadend = function () {
|
||||||
|
_this2.setState({
|
||||||
|
imgSource: previewReader.result
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "setPreviewImageSource",
|
||||||
|
value: function setPreviewImageSource(file) {
|
||||||
|
if (file.type !== 'video/mp4') {
|
||||||
|
this.setPreviewImageSourceFromFile(file);
|
||||||
|
} else {
|
||||||
|
if (this.props.thumbnail) {
|
||||||
|
this.setPreviewImageSourceFromFile(this.props.thumbnail);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
imgSource: this.state.defaultThumbnail
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
return _react.default.createElement("img", {
|
||||||
|
id: "dropzone-preview",
|
||||||
|
src: this.state.imgSource,
|
||||||
|
className: this.props.dimPreview ? 'dim' : '',
|
||||||
|
alt: "publish preview"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(PublishPreview, _React$Component);
|
||||||
|
|
||||||
|
return PublishPreview;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
PublishPreview.propTypes = {
|
||||||
|
dimPreview: _propTypes.default.bool.isRequired,
|
||||||
|
file: _propTypes.default.object.isRequired,
|
||||||
|
thumbnail: _propTypes.default.object
|
||||||
|
};
|
||||||
|
var _default = PublishPreview;
|
||||||
|
exports.default = _default;
|
50
client/build/components/PublishUrlMiddleDisplay/index.js
Normal file
50
client/build/components/PublishUrlMiddleDisplay/index.js
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function UrlMiddle(_ref) {
|
||||||
|
var publishInChannel = _ref.publishInChannel,
|
||||||
|
selectedChannel = _ref.selectedChannel,
|
||||||
|
loggedInChannelName = _ref.loggedInChannelName,
|
||||||
|
loggedInChannelShortId = _ref.loggedInChannelShortId;
|
||||||
|
|
||||||
|
if (publishInChannel) {
|
||||||
|
if (selectedChannel === loggedInChannelName) {
|
||||||
|
return _react.default.createElement("span", {
|
||||||
|
id: "url-channel",
|
||||||
|
className: "url-text--secondary"
|
||||||
|
}, loggedInChannelName, ":", loggedInChannelShortId, " /");
|
||||||
|
}
|
||||||
|
|
||||||
|
return _react.default.createElement("span", {
|
||||||
|
id: "url-channel-placeholder",
|
||||||
|
className: "url-text--secondary tooltip"
|
||||||
|
}, "@channel", _react.default.createElement("span", {
|
||||||
|
className: "tooltip-text"
|
||||||
|
}, "Select a channel below"), " /");
|
||||||
|
}
|
||||||
|
|
||||||
|
return _react.default.createElement("span", {
|
||||||
|
id: "url-no-channel-placeholder",
|
||||||
|
className: "url-text--secondary tooltip"
|
||||||
|
}, "xyz", _react.default.createElement("span", {
|
||||||
|
className: "tooltip-text"
|
||||||
|
}, "This will be a random id"), " /");
|
||||||
|
}
|
||||||
|
|
||||||
|
UrlMiddle.propTypes = {
|
||||||
|
publishInChannel: _propTypes.default.bool.isRequired,
|
||||||
|
loggedInChannelName: _propTypes.default.string,
|
||||||
|
loggedInChannelShortId: _propTypes.default.string
|
||||||
|
};
|
||||||
|
var _default = UrlMiddle;
|
||||||
|
exports.default = _default;
|
34
client/build/components/SEO/index.js
Normal file
34
client/build/components/SEO/index.js
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var site = _ref.site;
|
||||||
|
var defaultDescription = site.defaultDescription,
|
||||||
|
defaultThumbnail = site.defaultThumbnail,
|
||||||
|
siteDescription = site.description,
|
||||||
|
siteHost = site.host,
|
||||||
|
siteTitle = site.title,
|
||||||
|
siteTwitter = site.twitter;
|
||||||
|
return {
|
||||||
|
defaultDescription: defaultDescription,
|
||||||
|
defaultThumbnail: defaultThumbnail,
|
||||||
|
siteDescription: siteDescription,
|
||||||
|
siteHost: siteHost,
|
||||||
|
siteTitle: siteTitle,
|
||||||
|
siteTwitter: siteTwitter
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
95
client/build/components/SEO/view.js
Normal file
95
client/build/components/SEO/view.js
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _reactHelmet = _interopRequireDefault(require("react-helmet"));
|
||||||
|
|
||||||
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
||||||
|
|
||||||
|
var _pageTitle = require("../../utils/pageTitle");
|
||||||
|
|
||||||
|
var _metaTags = require("../../utils/metaTags");
|
||||||
|
|
||||||
|
var _canonicalLink = require("../../utils/canonicalLink");
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var SEO =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function SEO() {
|
||||||
|
_classCallCheck(this, SEO);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(SEO).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(SEO, [{
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
// props from state
|
||||||
|
var _this$props = this.props,
|
||||||
|
defaultDescription = _this$props.defaultDescription,
|
||||||
|
defaultThumbnail = _this$props.defaultThumbnail,
|
||||||
|
siteDescription = _this$props.siteDescription,
|
||||||
|
siteHost = _this$props.siteHost,
|
||||||
|
siteTitle = _this$props.siteTitle,
|
||||||
|
siteTwitter = _this$props.siteTwitter; // props from parent
|
||||||
|
|
||||||
|
var _this$props2 = this.props,
|
||||||
|
asset = _this$props2.asset,
|
||||||
|
channel = _this$props2.channel,
|
||||||
|
pageUri = _this$props2.pageUri;
|
||||||
|
var pageTitle = this.props.pageTitle; // create page title, tags, and canonical link
|
||||||
|
|
||||||
|
pageTitle = (0, _pageTitle.createPageTitle)(siteTitle, pageTitle);
|
||||||
|
var metaTags = (0, _metaTags.createMetaTags)(siteDescription, siteHost, siteTitle, siteTwitter, asset, channel, defaultDescription, defaultThumbnail);
|
||||||
|
var canonicalLink = (0, _canonicalLink.createCanonicalLink)(asset, channel, pageUri, siteHost); // render results
|
||||||
|
|
||||||
|
return _react.default.createElement(_reactHelmet.default, {
|
||||||
|
title: pageTitle,
|
||||||
|
meta: metaTags,
|
||||||
|
link: [{
|
||||||
|
rel: 'canonical',
|
||||||
|
href: canonicalLink
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(SEO, _React$Component);
|
||||||
|
|
||||||
|
return SEO;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
SEO.propTypes = {
|
||||||
|
pageTitle: _propTypes.default.string,
|
||||||
|
pageUri: _propTypes.default.string,
|
||||||
|
channel: _propTypes.default.object,
|
||||||
|
asset: _propTypes.default.object
|
||||||
|
};
|
||||||
|
var _default = SEO;
|
||||||
|
exports.default = _default;
|
14
client/build/constants/asset_display_states.js
Normal file
14
client/build/constants/asset_display_states.js
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.AVAILABLE = exports.ERROR = exports.UNAVAILABLE = exports.LOCAL_CHECK = void 0;
|
||||||
|
var LOCAL_CHECK = 'LOCAL_CHECK';
|
||||||
|
exports.LOCAL_CHECK = LOCAL_CHECK;
|
||||||
|
var UNAVAILABLE = 'UNAVAILABLE';
|
||||||
|
exports.UNAVAILABLE = UNAVAILABLE;
|
||||||
|
var ERROR = 'ERROR';
|
||||||
|
exports.ERROR = ERROR;
|
||||||
|
var AVAILABLE = 'AVAILABLE';
|
||||||
|
exports.AVAILABLE = AVAILABLE;
|
12
client/build/constants/channel_action_types.js
Normal file
12
client/build/constants/channel_action_types.js
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.CHANNEL_LOGOUT = exports.CHANNEL_LOGIN_CHECK = exports.CHANNEL_UPDATE = void 0;
|
||||||
|
var CHANNEL_UPDATE = 'CHANNEL_UPDATE';
|
||||||
|
exports.CHANNEL_UPDATE = CHANNEL_UPDATE;
|
||||||
|
var CHANNEL_LOGIN_CHECK = 'CHANNEL_LOGIN_CHECK';
|
||||||
|
exports.CHANNEL_LOGIN_CHECK = CHANNEL_LOGIN_CHECK;
|
||||||
|
var CHANNEL_LOGOUT = 'CHANNEL_LOGOUT';
|
||||||
|
exports.CHANNEL_LOGOUT = CHANNEL_LOGOUT;
|
16
client/build/constants/channel_create_action_types.js
Normal file
16
client/build/constants/channel_create_action_types.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.CHANNEL_CREATE = exports.CHANNEL_AVAILABILITY = exports.CHANNEL_CREATE_UPDATE_STATUS = exports.CHANNEL_CREATE_UPDATE_PASSWORD = exports.CHANNEL_CREATE_UPDATE_NAME = void 0;
|
||||||
|
var CHANNEL_CREATE_UPDATE_NAME = 'CHANNEL_CREATE_UPDATE_NAME';
|
||||||
|
exports.CHANNEL_CREATE_UPDATE_NAME = CHANNEL_CREATE_UPDATE_NAME;
|
||||||
|
var CHANNEL_CREATE_UPDATE_PASSWORD = 'CHANNEL_CREATE_UPDATE_PASSWORD';
|
||||||
|
exports.CHANNEL_CREATE_UPDATE_PASSWORD = CHANNEL_CREATE_UPDATE_PASSWORD;
|
||||||
|
var CHANNEL_CREATE_UPDATE_STATUS = 'CHANNEL_CREATE_UPDATE_STATUS';
|
||||||
|
exports.CHANNEL_CREATE_UPDATE_STATUS = CHANNEL_CREATE_UPDATE_STATUS;
|
||||||
|
var CHANNEL_AVAILABILITY = 'CHANNEL_AVAILABILITY';
|
||||||
|
exports.CHANNEL_AVAILABILITY = CHANNEL_AVAILABILITY;
|
||||||
|
var CHANNEL_CREATE = 'CHANNEL_CREATE';
|
||||||
|
exports.CHANNEL_CREATE = CHANNEL_CREATE;
|
30
client/build/constants/publish_action_types.js
Normal file
30
client/build/constants/publish_action_types.js
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.CLAIM_AVAILABILITY = exports.PUBLISH_START = exports.THUMBNAIL_NEW = exports.TOGGLE_METADATA_INPUTS = exports.SELECTED_CHANNEL_UPDATE = exports.ERROR_UPDATE = exports.PUBLISH_STATUS_UPDATE = exports.SET_PUBLISH_IN_CHANNEL = exports.CLAIM_UPDATE = exports.METADATA_UPDATE = exports.FILE_CLEAR = exports.FILE_SELECTED = void 0;
|
||||||
|
var FILE_SELECTED = 'FILE_SELECTED';
|
||||||
|
exports.FILE_SELECTED = FILE_SELECTED;
|
||||||
|
var FILE_CLEAR = 'FILE_CLEAR';
|
||||||
|
exports.FILE_CLEAR = FILE_CLEAR;
|
||||||
|
var METADATA_UPDATE = 'METADATA_UPDATE';
|
||||||
|
exports.METADATA_UPDATE = METADATA_UPDATE;
|
||||||
|
var CLAIM_UPDATE = 'CLAIM_UPDATE';
|
||||||
|
exports.CLAIM_UPDATE = CLAIM_UPDATE;
|
||||||
|
var SET_PUBLISH_IN_CHANNEL = 'SET_PUBLISH_IN_CHANNEL';
|
||||||
|
exports.SET_PUBLISH_IN_CHANNEL = SET_PUBLISH_IN_CHANNEL;
|
||||||
|
var PUBLISH_STATUS_UPDATE = 'PUBLISH_STATUS_UPDATE';
|
||||||
|
exports.PUBLISH_STATUS_UPDATE = PUBLISH_STATUS_UPDATE;
|
||||||
|
var ERROR_UPDATE = 'ERROR_UPDATE';
|
||||||
|
exports.ERROR_UPDATE = ERROR_UPDATE;
|
||||||
|
var SELECTED_CHANNEL_UPDATE = 'SELECTED_CHANNEL_UPDATE';
|
||||||
|
exports.SELECTED_CHANNEL_UPDATE = SELECTED_CHANNEL_UPDATE;
|
||||||
|
var TOGGLE_METADATA_INPUTS = 'TOGGLE_METADATA_INPUTS';
|
||||||
|
exports.TOGGLE_METADATA_INPUTS = TOGGLE_METADATA_INPUTS;
|
||||||
|
var THUMBNAIL_NEW = 'THUMBNAIL_NEW';
|
||||||
|
exports.THUMBNAIL_NEW = THUMBNAIL_NEW;
|
||||||
|
var PUBLISH_START = 'PUBLISH_START';
|
||||||
|
exports.PUBLISH_START = PUBLISH_START;
|
||||||
|
var CLAIM_AVAILABILITY = 'CLAIM_AVAILABILITY';
|
||||||
|
exports.CLAIM_AVAILABILITY = CLAIM_AVAILABILITY;
|
10
client/build/constants/publish_channel_select_states.js
Normal file
10
client/build/constants/publish_channel_select_states.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.CREATE = exports.LOGIN = void 0;
|
||||||
|
var LOGIN = 'Existing';
|
||||||
|
exports.LOGIN = LOGIN;
|
||||||
|
var CREATE = 'New';
|
||||||
|
exports.CREATE = CREATE;
|
16
client/build/constants/publish_claim_states.js
Normal file
16
client/build/constants/publish_claim_states.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.FAILED = exports.SUCCESS = exports.PUBLISHING = exports.LOADING = exports.LOAD_START = void 0;
|
||||||
|
var LOAD_START = 'LOAD_START';
|
||||||
|
exports.LOAD_START = LOAD_START;
|
||||||
|
var LOADING = 'LOADING';
|
||||||
|
exports.LOADING = LOADING;
|
||||||
|
var PUBLISHING = 'PUBLISHING';
|
||||||
|
exports.PUBLISHING = PUBLISHING;
|
||||||
|
var SUCCESS = 'SUCCESS';
|
||||||
|
exports.SUCCESS = SUCCESS;
|
||||||
|
var FAILED = 'FAILED';
|
||||||
|
exports.FAILED = FAILED;
|
36
client/build/constants/show_action_types.js
Normal file
36
client/build/constants/show_action_types.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.DISPLAY_ASSET_ERROR = exports.FILE_AVAILABILITY_UPDATE = exports.FILE_REQUESTED = exports.CHANNEL_CLAIMS_UPDATE_SUCCESS = exports.CHANNEL_CLAIMS_UPDATE_ASYNC = exports.CHANNEL_ADD = exports.ASSET_ADD = exports.REQUEST_LIST_ADD = exports.CHANNEL_REQUEST_NEW = exports.ASSET_REQUEST_NEW = exports.REQUEST_UPDATE = exports.REQUEST_ERROR = exports.HANDLE_SHOW_URI = void 0;
|
||||||
|
// request actions
|
||||||
|
var HANDLE_SHOW_URI = 'HANDLE_SHOW_URI';
|
||||||
|
exports.HANDLE_SHOW_URI = HANDLE_SHOW_URI;
|
||||||
|
var REQUEST_ERROR = 'REQUEST_ERROR';
|
||||||
|
exports.REQUEST_ERROR = REQUEST_ERROR;
|
||||||
|
var REQUEST_UPDATE = 'REQUEST_UPDATE';
|
||||||
|
exports.REQUEST_UPDATE = REQUEST_UPDATE;
|
||||||
|
var ASSET_REQUEST_NEW = 'ASSET_REQUEST_NEW';
|
||||||
|
exports.ASSET_REQUEST_NEW = ASSET_REQUEST_NEW;
|
||||||
|
var CHANNEL_REQUEST_NEW = 'CHANNEL_REQUEST_NEW';
|
||||||
|
exports.CHANNEL_REQUEST_NEW = CHANNEL_REQUEST_NEW;
|
||||||
|
var REQUEST_LIST_ADD = 'REQUEST_LIST_ADD'; // asset actions
|
||||||
|
|
||||||
|
exports.REQUEST_LIST_ADD = REQUEST_LIST_ADD;
|
||||||
|
var ASSET_ADD = "ASSET_ADD"; // channel actions
|
||||||
|
|
||||||
|
exports.ASSET_ADD = ASSET_ADD;
|
||||||
|
var CHANNEL_ADD = 'CHANNEL_ADD';
|
||||||
|
exports.CHANNEL_ADD = CHANNEL_ADD;
|
||||||
|
var CHANNEL_CLAIMS_UPDATE_ASYNC = 'CHANNEL_CLAIMS_UPDATE_ASYNC';
|
||||||
|
exports.CHANNEL_CLAIMS_UPDATE_ASYNC = CHANNEL_CLAIMS_UPDATE_ASYNC;
|
||||||
|
var CHANNEL_CLAIMS_UPDATE_SUCCESS = 'CHANNEL_CLAIMS_UPDATE_SUCCESS'; // asset/file display actions
|
||||||
|
|
||||||
|
exports.CHANNEL_CLAIMS_UPDATE_SUCCESS = CHANNEL_CLAIMS_UPDATE_SUCCESS;
|
||||||
|
var FILE_REQUESTED = 'FILE_REQUESTED';
|
||||||
|
exports.FILE_REQUESTED = FILE_REQUESTED;
|
||||||
|
var FILE_AVAILABILITY_UPDATE = 'FILE_AVAILABILITY_UPDATE';
|
||||||
|
exports.FILE_AVAILABILITY_UPDATE = FILE_AVAILABILITY_UPDATE;
|
||||||
|
var DISPLAY_ASSET_ERROR = 'DISPLAY_ASSET_ERROR';
|
||||||
|
exports.DISPLAY_ASSET_ERROR = DISPLAY_ASSET_ERROR;
|
12
client/build/constants/show_request_types.js
Normal file
12
client/build/constants/show_request_types.js
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.ASSET_DETAILS = exports.ASSET_LITE = exports.CHANNEL = void 0;
|
||||||
|
var CHANNEL = 'CHANNEL';
|
||||||
|
exports.CHANNEL = CHANNEL;
|
||||||
|
var ASSET_LITE = 'ASSET_LITE';
|
||||||
|
exports.ASSET_LITE = ASSET_LITE;
|
||||||
|
var ASSET_DETAILS = 'ASSET_DETAILS';
|
||||||
|
exports.ASSET_DETAILS = ASSET_DETAILS;
|
43
client/build/containers/AssetDisplay/index.js
Normal file
43
client/build/containers/AssetDisplay/index.js
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
var _show = require("../../actions/show");
|
||||||
|
|
||||||
|
var _show2 = require("../../selectors/show");
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var show = _ref.show;
|
||||||
|
// select error and status
|
||||||
|
var error = show.displayAsset.error;
|
||||||
|
var status = show.displayAsset.status; // select asset
|
||||||
|
|
||||||
|
var asset = (0, _show2.selectAsset)(show); // return props
|
||||||
|
|
||||||
|
return {
|
||||||
|
error: error,
|
||||||
|
status: status,
|
||||||
|
asset: asset
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
||||||
|
return {
|
||||||
|
onFileRequest: function onFileRequest(name, claimId) {
|
||||||
|
dispatch((0, _show.fileRequested)(name, claimId));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
118
client/build/containers/AssetDisplay/view.js
Normal file
118
client/build/containers/AssetDisplay/view.js
Normal file
|
@ -0,0 +1,118 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _ProgressBar = _interopRequireDefault(require("@components/ProgressBar"));
|
||||||
|
|
||||||
|
var _asset_display_states = require("../../constants/asset_display_states");
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var AssetDisplay =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function AssetDisplay() {
|
||||||
|
_classCallCheck(this, AssetDisplay);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(AssetDisplay).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(AssetDisplay, [{
|
||||||
|
key: "componentDidMount",
|
||||||
|
value: function componentDidMount() {
|
||||||
|
var _this$props$asset$cla = this.props.asset.claimData,
|
||||||
|
name = _this$props$asset$cla.name,
|
||||||
|
claimId = _this$props$asset$cla.claimId;
|
||||||
|
this.props.onFileRequest(name, claimId);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var _this$props = this.props,
|
||||||
|
status = _this$props.status,
|
||||||
|
error = _this$props.error,
|
||||||
|
_this$props$asset$cla2 = _this$props.asset.claimData,
|
||||||
|
name = _this$props$asset$cla2.name,
|
||||||
|
claimId = _this$props$asset$cla2.claimId,
|
||||||
|
contentType = _this$props$asset$cla2.contentType,
|
||||||
|
fileExt = _this$props$asset$cla2.fileExt,
|
||||||
|
thumbnail = _this$props$asset$cla2.thumbnail;
|
||||||
|
return _react.default.createElement("div", {
|
||||||
|
id: "asset-display-component"
|
||||||
|
}, status === _asset_display_states.LOCAL_CHECK && _react.default.createElement("div", null, _react.default.createElement("p", null, "Checking to see if Spee.ch has your asset locally...")), status === _asset_display_states.UNAVAILABLE && _react.default.createElement("div", null, _react.default.createElement("p", null, "Sit tight, we're searching the LBRY blockchain for your asset!"), _react.default.createElement(_ProgressBar.default, {
|
||||||
|
size: 12
|
||||||
|
}), _react.default.createElement("p", null, "Curious what magic is happening here? ", _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
target: "blank",
|
||||||
|
href: "https://lbry.io/faq/what-is-lbry"
|
||||||
|
}, "Learn more."))), status === _asset_display_states.ERROR && _react.default.createElement("div", null, _react.default.createElement("p", null, "Unfortunately, we couldn't download your asset from LBRY. You can help us out by sharing the below error message in the ", _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
href: "https://chat.lbry.io",
|
||||||
|
target: "_blank"
|
||||||
|
}, "LBRY discord"), "."), _react.default.createElement("i", null, _react.default.createElement("p", {
|
||||||
|
id: "error-message"
|
||||||
|
}, error))), status === _asset_display_states.AVAILABLE && function () {
|
||||||
|
switch (contentType) {
|
||||||
|
case 'image/jpeg':
|
||||||
|
case 'image/jpg':
|
||||||
|
case 'image/png':
|
||||||
|
return _react.default.createElement("img", {
|
||||||
|
className: "asset",
|
||||||
|
src: "/".concat(claimId, "/").concat(name, ".").concat(fileExt),
|
||||||
|
alt: name
|
||||||
|
});
|
||||||
|
|
||||||
|
case 'image/gif':
|
||||||
|
return _react.default.createElement("img", {
|
||||||
|
className: "asset",
|
||||||
|
src: "/".concat(claimId, "/").concat(name, ".").concat(fileExt),
|
||||||
|
alt: name
|
||||||
|
});
|
||||||
|
|
||||||
|
case 'video/mp4':
|
||||||
|
return _react.default.createElement("video", {
|
||||||
|
className: "asset video",
|
||||||
|
controls: true,
|
||||||
|
poster: thumbnail
|
||||||
|
}, _react.default.createElement("source", {
|
||||||
|
src: "/".concat(claimId, "/").concat(name, ".").concat(fileExt)
|
||||||
|
}), _react.default.createElement("p", null, "Your browser does not support the ", _react.default.createElement("code", null, "video"), " element."));
|
||||||
|
|
||||||
|
default:
|
||||||
|
return _react.default.createElement("p", null, "Unsupported file type");
|
||||||
|
}
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(AssetDisplay, _React$Component);
|
||||||
|
|
||||||
|
return AssetDisplay;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = AssetDisplay;
|
||||||
|
exports.default = _default;
|
28
client/build/containers/AssetInfo/index.js
Normal file
28
client/build/containers/AssetInfo/index.js
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
var _show = require("../../selectors/show");
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var show = _ref.show;
|
||||||
|
// select asset
|
||||||
|
var asset = (0, _show.selectAsset)(show); // return props
|
||||||
|
|
||||||
|
return {
|
||||||
|
asset: asset
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
219
client/build/containers/AssetInfo/view.js
Normal file
219
client/build/containers/AssetInfo/view.js
Normal file
|
@ -0,0 +1,219 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _reactRouterDom = require("react-router-dom");
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
var AssetInfo =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function AssetInfo(props) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, AssetInfo);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(AssetInfo).call(this, props));
|
||||||
|
_this.copyToClipboard = _this.copyToClipboard.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(AssetInfo, [{
|
||||||
|
key: "copyToClipboard",
|
||||||
|
value: function copyToClipboard(event) {
|
||||||
|
var elementToCopy = event.target.dataset.elementtocopy;
|
||||||
|
var element = document.getElementById(elementToCopy);
|
||||||
|
element.select();
|
||||||
|
|
||||||
|
try {
|
||||||
|
document.execCommand('copy');
|
||||||
|
} catch (err) {
|
||||||
|
this.setState({
|
||||||
|
error: 'Oops, unable to copy'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var _this$props$asset = this.props.asset,
|
||||||
|
shortId = _this$props$asset.shortId,
|
||||||
|
_this$props$asset$cla = _this$props$asset.claimData,
|
||||||
|
channelName = _this$props$asset$cla.channelName,
|
||||||
|
certificateId = _this$props$asset$cla.certificateId,
|
||||||
|
description = _this$props$asset$cla.description,
|
||||||
|
name = _this$props$asset$cla.name,
|
||||||
|
claimId = _this$props$asset$cla.claimId,
|
||||||
|
fileExt = _this$props$asset$cla.fileExt,
|
||||||
|
contentType = _this$props$asset$cla.contentType,
|
||||||
|
thumbnail = _this$props$asset$cla.thumbnail,
|
||||||
|
host = _this$props$asset$cla.host;
|
||||||
|
return _react.default.createElement("div", null, channelName && _react.default.createElement("div", {
|
||||||
|
className: "row row--padded row--wide row--no-top"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--2 column--med-10"
|
||||||
|
}, _react.default.createElement("span", {
|
||||||
|
className: "text"
|
||||||
|
}, "Channel:")), _react.default.createElement("div", {
|
||||||
|
className: "column column--8 column--med-10"
|
||||||
|
}, _react.default.createElement("span", {
|
||||||
|
className: "text"
|
||||||
|
}, _react.default.createElement(_reactRouterDom.Link, {
|
||||||
|
to: "/".concat(channelName, ":").concat(certificateId)
|
||||||
|
}, channelName)))), description && _react.default.createElement("div", {
|
||||||
|
className: "row row--padded row--wide row--no-top"
|
||||||
|
}, _react.default.createElement("span", {
|
||||||
|
className: "text"
|
||||||
|
}, description)), _react.default.createElement("div", {
|
||||||
|
id: "show-share-buttons"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "row row--padded row--wide row--no-top"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--2 column--med-10"
|
||||||
|
}, _react.default.createElement("span", {
|
||||||
|
className: "text"
|
||||||
|
}, "Share:")), _react.default.createElement("div", {
|
||||||
|
className: "column column--8 column--med-10"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "row row--short row--wide flex-container--row flex-container--space-between-bottom flex-container--wrap"
|
||||||
|
}, _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
target: "_blank",
|
||||||
|
href: "https://twitter.com/intent/tweet?text=".concat(host, "/").concat(shortId, "/").concat(name)
|
||||||
|
}, "twitter"), _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
target: "_blank",
|
||||||
|
href: "https://www.facebook.com/sharer/sharer.php?u=".concat(host, "/").concat(shortId, "/").concat(name)
|
||||||
|
}, "facebook"), _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
target: "_blank",
|
||||||
|
href: "http://tumblr.com/widgets/share/tool?canonicalUrl=".concat(host, "/").concat(shortId, "/").concat(name)
|
||||||
|
}, "tumblr"), _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
target: "_blank",
|
||||||
|
href: "https://www.reddit.com/submit?url=".concat(host, "/").concat(shortId, "/").concat(name, "&title=").concat(name)
|
||||||
|
}, "reddit"))))), _react.default.createElement("div", {
|
||||||
|
className: "row row--padded row--wide row--no-top"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
id: "show-short-link"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--2 column--med-10"
|
||||||
|
}, _react.default.createElement("span", {
|
||||||
|
className: "text"
|
||||||
|
}, "Link:")), _react.default.createElement("div", {
|
||||||
|
className: "column column--8 column--med-10"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "row row--short row--wide"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--7"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "input-error",
|
||||||
|
id: "input-error-copy-short-link",
|
||||||
|
hidden: "true"
|
||||||
|
}, "error here"), _react.default.createElement("input", {
|
||||||
|
type: "text",
|
||||||
|
id: "short-link",
|
||||||
|
className: "input-disabled input-text--full-width",
|
||||||
|
readOnly: true,
|
||||||
|
spellCheck: "false",
|
||||||
|
value: "".concat(host, "/").concat(shortId, "/").concat(name, ".").concat(fileExt),
|
||||||
|
onClick: this.select
|
||||||
|
})), _react.default.createElement("div", {
|
||||||
|
className: "column column--1"
|
||||||
|
}), _react.default.createElement("div", {
|
||||||
|
className: "column column--2"
|
||||||
|
}, _react.default.createElement("button", {
|
||||||
|
className: "button--primary button--wide",
|
||||||
|
"data-elementtocopy": "short-link",
|
||||||
|
onClick: this.copyToClipboard
|
||||||
|
}, "copy"))))), _react.default.createElement("div", {
|
||||||
|
id: "show-embed-code"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--2 column--med-10"
|
||||||
|
}, _react.default.createElement("span", {
|
||||||
|
className: "text"
|
||||||
|
}, "Embed:")), _react.default.createElement("div", {
|
||||||
|
className: "column column--8 column--med-10"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "row row--short row--wide"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--7"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "input-error",
|
||||||
|
id: "input-error-copy-embed-text",
|
||||||
|
hidden: "true"
|
||||||
|
}, "error here"), contentType === 'video/mp4' ? _react.default.createElement("input", {
|
||||||
|
type: "text",
|
||||||
|
id: "embed-text",
|
||||||
|
className: "input-disabled input-text--full-width",
|
||||||
|
readOnly: true,
|
||||||
|
onClick: this.select,
|
||||||
|
spellCheck: "false",
|
||||||
|
value: "<video width=\"100%\" controls poster=\"".concat(thumbnail, "\" src=\"").concat(host, "/").concat(claimId, "/").concat(name, ".").concat(fileExt, "\"/></video>")
|
||||||
|
}) : _react.default.createElement("input", {
|
||||||
|
type: "text",
|
||||||
|
id: "embed-text",
|
||||||
|
className: "input-disabled input-text--full-width",
|
||||||
|
readOnly: true,
|
||||||
|
onClick: this.select,
|
||||||
|
spellCheck: "false",
|
||||||
|
value: "<img src=\"".concat(host, "/").concat(claimId, "/").concat(name, ".").concat(fileExt, "\"/>")
|
||||||
|
})), _react.default.createElement("div", {
|
||||||
|
className: "column column--1"
|
||||||
|
}), _react.default.createElement("div", {
|
||||||
|
className: "column column--2"
|
||||||
|
}, _react.default.createElement("button", {
|
||||||
|
className: "button--primary button--wide",
|
||||||
|
"data-elementtocopy": "embed-text",
|
||||||
|
onClick: this.copyToClipboard
|
||||||
|
}, "copy")))))), _react.default.createElement("div", {
|
||||||
|
className: "flex-container--row flex-container--space-between-bottom"
|
||||||
|
}, _react.default.createElement(_reactRouterDom.Link, {
|
||||||
|
className: "link--primary",
|
||||||
|
to: "/".concat(shortId, "/").concat(name, ".").concat(fileExt)
|
||||||
|
}, _react.default.createElement("span", {
|
||||||
|
className: "text"
|
||||||
|
}, "Direct Link")), _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
href: "".concat(host, "/").concat(claimId, "/").concat(name, ".").concat(fileExt),
|
||||||
|
download: name
|
||||||
|
}, "Download"), _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
target: "_blank",
|
||||||
|
href: "https://lbry.io/dmca"
|
||||||
|
}, "Report")));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(AssetInfo, _React$Component);
|
||||||
|
|
||||||
|
return AssetInfo;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = AssetInfo;
|
||||||
|
exports.default = _default;
|
29
client/build/containers/AssetTitle/index.js
Normal file
29
client/build/containers/AssetTitle/index.js
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
var _show = require("../../selectors/show");
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var show = _ref.show;
|
||||||
|
|
||||||
|
var _selectAsset = (0, _show.selectAsset)(show),
|
||||||
|
title = _selectAsset.claimData.title;
|
||||||
|
|
||||||
|
return {
|
||||||
|
title: title
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
20
client/build/containers/AssetTitle/view.js
Normal file
20
client/build/containers/AssetTitle/view.js
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var AssetTitle = function AssetTitle(_ref) {
|
||||||
|
var title = _ref.title;
|
||||||
|
return _react.default.createElement("div", null, _react.default.createElement("span", {
|
||||||
|
className: "text--large"
|
||||||
|
}, title));
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = AssetTitle;
|
||||||
|
exports.default = _default;
|
36
client/build/containers/ChannelClaimsDisplay/index.js
Normal file
36
client/build/containers/ChannelClaimsDisplay/index.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _show = require("../../actions/show");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var show = _ref.show;
|
||||||
|
// select channel key
|
||||||
|
var request = show.requestList[show.request.id];
|
||||||
|
var channelKey = request.key; // select channel claims
|
||||||
|
|
||||||
|
var channel = show.channelList[channelKey] || null; // return props
|
||||||
|
|
||||||
|
return {
|
||||||
|
channelKey: channelKey,
|
||||||
|
channel: channel
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var mapDispatchToProps = {
|
||||||
|
onUpdateChannelClaims: _show.onUpdateChannelClaims
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
101
client/build/containers/ChannelClaimsDisplay/view.js
Normal file
101
client/build/containers/ChannelClaimsDisplay/view.js
Normal file
|
@ -0,0 +1,101 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _AssetPreview = _interopRequireDefault(require("@components/AssetPreview"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
var ChannelClaimsDisplay =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function ChannelClaimsDisplay(props) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, ChannelClaimsDisplay);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(ChannelClaimsDisplay).call(this, props));
|
||||||
|
_this.showNextResultsPage = _this.showNextResultsPage.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.showPreviousResultsPage = _this.showPreviousResultsPage.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(ChannelClaimsDisplay, [{
|
||||||
|
key: "showPreviousResultsPage",
|
||||||
|
value: function showPreviousResultsPage() {
|
||||||
|
var currentPage = this.props.channel.claimsData.currentPage;
|
||||||
|
var previousPage = parseInt(currentPage) - 1;
|
||||||
|
this.showNewPage(previousPage);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "showNextResultsPage",
|
||||||
|
value: function showNextResultsPage() {
|
||||||
|
var currentPage = this.props.channel.claimsData.currentPage;
|
||||||
|
var nextPage = parseInt(currentPage) + 1;
|
||||||
|
this.showNewPage(nextPage);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "showNewPage",
|
||||||
|
value: function showNewPage(page) {
|
||||||
|
var _this$props = this.props,
|
||||||
|
channelKey = _this$props.channelKey,
|
||||||
|
_this$props$channel = _this$props.channel,
|
||||||
|
name = _this$props$channel.name,
|
||||||
|
longId = _this$props$channel.longId;
|
||||||
|
this.props.onUpdateChannelClaims(channelKey, name, longId, page);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var _this$props$channel$c = this.props.channel.claimsData,
|
||||||
|
claims = _this$props$channel$c.claims,
|
||||||
|
currentPage = _this$props$channel$c.currentPage,
|
||||||
|
totalPages = _this$props$channel$c.totalPages;
|
||||||
|
return _react.default.createElement("div", {
|
||||||
|
className: "row row--tall"
|
||||||
|
}, claims.length > 0 ? _react.default.createElement("div", null, claims.map(function (claim, index) {
|
||||||
|
return _react.default.createElement(_AssetPreview.default, {
|
||||||
|
claimData: claim,
|
||||||
|
key: "".concat(claim.name, "-").concat(index)
|
||||||
|
});
|
||||||
|
}), _react.default.createElement("div", null, currentPage > 1 && _react.default.createElement("button", {
|
||||||
|
className: 'button--secondary',
|
||||||
|
onClick: this.showPreviousResultsPage
|
||||||
|
}, "Previous Page"), currentPage < totalPages && _react.default.createElement("button", {
|
||||||
|
className: 'button--secondary',
|
||||||
|
onClick: this.showNextResultsPage
|
||||||
|
}, "Next Page"))) : _react.default.createElement("p", null, "There are no claims in this channel"));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(ChannelClaimsDisplay, _React$Component);
|
||||||
|
|
||||||
|
return ChannelClaimsDisplay;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = ChannelClaimsDisplay;
|
||||||
|
exports.default = _default;
|
39
client/build/containers/ChannelCreateForm/index.js
Normal file
39
client/build/containers/ChannelCreateForm/index.js
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
var _channelCreate = require("../../actions/channelCreate");
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var _ref$channelCreate = _ref.channelCreate,
|
||||||
|
name = _ref$channelCreate.name,
|
||||||
|
password = _ref$channelCreate.password,
|
||||||
|
error = _ref$channelCreate.error,
|
||||||
|
status = _ref$channelCreate.status;
|
||||||
|
return {
|
||||||
|
name: name,
|
||||||
|
password: password,
|
||||||
|
error: error,
|
||||||
|
status: status
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var mapDispatchToProps = {
|
||||||
|
updateChannelAvailability: _channelCreate.updateChannelAvailability,
|
||||||
|
updateChannelCreateName: _channelCreate.updateChannelCreateName,
|
||||||
|
updateChannelCreatePassword: _channelCreate.updateChannelCreatePassword,
|
||||||
|
createChannel: _channelCreate.createChannel
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
186
client/build/containers/ChannelCreateForm/view.js
Normal file
186
client/build/containers/ChannelCreateForm/view.js
Normal file
|
@ -0,0 +1,186 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _ProgressBar = _interopRequireDefault(require("@components/ProgressBar"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
var ChannelCreateForm =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function ChannelCreateForm(props) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, ChannelCreateForm);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(ChannelCreateForm).call(this, props));
|
||||||
|
_this.handleNameInput = _this.handleNameInput.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.handlePasswordInput = _this.handlePasswordInput.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.handleSubmit = _this.handleSubmit.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(ChannelCreateForm, [{
|
||||||
|
key: "cleanseNameInput",
|
||||||
|
value: function cleanseNameInput(input) {
|
||||||
|
input = input.replace(/\s+/g, '-'); // replace spaces with dashes
|
||||||
|
|
||||||
|
input = input.replace(/[^A-Za-z0-9-]/g, ''); // remove all characters that are not A-Z, a-z, 0-9, or '-'
|
||||||
|
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "cleansePasswordInput",
|
||||||
|
value: function cleansePasswordInput(input) {
|
||||||
|
input = input.replace(/\s+/g, ''); // replace spaces
|
||||||
|
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleNameInput",
|
||||||
|
value: function handleNameInput(event) {
|
||||||
|
var value = this.cleanseNameInput(event.target.value);
|
||||||
|
|
||||||
|
if (!value) {
|
||||||
|
this.props.updateChannelCreateName('error', 'Please enter a channel name');
|
||||||
|
} else {
|
||||||
|
this.props.updateChannelAvailability(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.props.updateChannelCreateName('value', value);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handlePasswordInput",
|
||||||
|
value: function handlePasswordInput(event) {
|
||||||
|
var value = this.cleansePasswordInput(event.target.value);
|
||||||
|
|
||||||
|
if (!value) {
|
||||||
|
this.props.updateChannelCreatePassword('error', 'Please enter a password');
|
||||||
|
} else {
|
||||||
|
this.props.updateChannelCreatePassword('error', null);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.props.updateChannelCreatePassword('value', value);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleSubmit",
|
||||||
|
value: function handleSubmit(event) {
|
||||||
|
console.log('handling submit');
|
||||||
|
event.preventDefault();
|
||||||
|
this.props.createChannel();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "returnErrors",
|
||||||
|
value: function returnErrors() {
|
||||||
|
if (this.props.name.error) {
|
||||||
|
return this.props.name.error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.props.password.error) {
|
||||||
|
return this.props.password.error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var _this$props = this.props,
|
||||||
|
name = _this$props.name,
|
||||||
|
password = _this$props.password,
|
||||||
|
status = _this$props.status;
|
||||||
|
var formError = this.returnErrors();
|
||||||
|
return _react.default.createElement("div", null, !status ? _react.default.createElement("form", {
|
||||||
|
id: "publish-channel-form"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "row row--wide row--short"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--3 column--sml-10"
|
||||||
|
}, _react.default.createElement("label", {
|
||||||
|
className: "label",
|
||||||
|
htmlFor: "new-channel-name"
|
||||||
|
}, "Name:")), _react.default.createElement("div", {
|
||||||
|
className: "column column--6 column--sml-10"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "input-text--primary flex-container--row flex-container--left-bottom span--relative"
|
||||||
|
}, _react.default.createElement("span", null, "@"), _react.default.createElement("input", {
|
||||||
|
type: "text",
|
||||||
|
name: "channel",
|
||||||
|
id: "new-channel-name",
|
||||||
|
className: "input-text",
|
||||||
|
placeholder: "exampleChannelName",
|
||||||
|
value: name.value,
|
||||||
|
onChange: this.handleNameInput
|
||||||
|
}), name.value && !name.error && _react.default.createElement("span", {
|
||||||
|
id: "input-success-channel-name",
|
||||||
|
className: "info-message--success span--absolute"
|
||||||
|
}, "\u2713"), name.error && _react.default.createElement("span", {
|
||||||
|
id: "input-success-channel-name",
|
||||||
|
className: "info-message--failure span--absolute"
|
||||||
|
}, "\u2716")))), _react.default.createElement("div", {
|
||||||
|
className: "row row--wide row--short"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--3 column--sml-10"
|
||||||
|
}, _react.default.createElement("label", {
|
||||||
|
className: "label",
|
||||||
|
htmlFor: "new-channel-password"
|
||||||
|
}, "Password:")), _react.default.createElement("div", {
|
||||||
|
className: "column column--6 column--sml-10"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "input-text--primary"
|
||||||
|
}, _react.default.createElement("input", {
|
||||||
|
type: "password",
|
||||||
|
name: "password",
|
||||||
|
id: "new-channel-password",
|
||||||
|
className: "input-text",
|
||||||
|
placeholder: "",
|
||||||
|
value: password.value,
|
||||||
|
onChange: this.handlePasswordInput
|
||||||
|
})))), formError ? _react.default.createElement("p", {
|
||||||
|
className: "info-message--failure"
|
||||||
|
}, formError) : _react.default.createElement("p", {
|
||||||
|
className: "info-message"
|
||||||
|
}, "Choose a name and password for your channel"), _react.default.createElement("div", {
|
||||||
|
className: "row row--wide"
|
||||||
|
}, _react.default.createElement("button", {
|
||||||
|
className: "button--primary",
|
||||||
|
onClick: this.handleSubmit
|
||||||
|
}, "Create Channel"))) : _react.default.createElement("div", null, _react.default.createElement("p", {
|
||||||
|
className: "fine-print"
|
||||||
|
}, status), _react.default.createElement(_ProgressBar.default, {
|
||||||
|
size: 12
|
||||||
|
})));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(ChannelCreateForm, _React$Component);
|
||||||
|
|
||||||
|
return ChannelCreateForm;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
var _default = ChannelCreateForm;
|
||||||
|
exports.default = _default;
|
29
client/build/containers/ChannelLoginForm/index.js
Normal file
29
client/build/containers/ChannelLoginForm/index.js
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _channel = require("../../actions/channel");
|
||||||
|
|
||||||
|
var _publish = require("../../actions/publish");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
||||||
|
return {
|
||||||
|
onChannelLogin: function onChannelLogin(name, shortId, longId) {
|
||||||
|
dispatch((0, _channel.updateLoggedInChannel)(name, shortId, longId));
|
||||||
|
dispatch((0, _publish.updateSelectedChannel)(name));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(null, mapDispatchToProps)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
167
client/build/containers/ChannelLoginForm/view.js
Normal file
167
client/build/containers/ChannelLoginForm/view.js
Normal file
|
@ -0,0 +1,167 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _request = _interopRequireDefault(require("../../utils/request"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
var ChannelLoginForm =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function ChannelLoginForm(props) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, ChannelLoginForm);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(ChannelLoginForm).call(this, props));
|
||||||
|
_this.state = {
|
||||||
|
error: null,
|
||||||
|
name: '',
|
||||||
|
password: ''
|
||||||
|
};
|
||||||
|
_this.handleInput = _this.handleInput.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.loginToChannel = _this.loginToChannel.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(ChannelLoginForm, [{
|
||||||
|
key: "handleInput",
|
||||||
|
value: function handleInput(event) {
|
||||||
|
var name = event.target.name;
|
||||||
|
var value = event.target.value;
|
||||||
|
this.setState(_defineProperty({}, name, value));
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "loginToChannel",
|
||||||
|
value: function loginToChannel(event) {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
var params = {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify({
|
||||||
|
username: this.state.name,
|
||||||
|
password: this.state.password
|
||||||
|
}),
|
||||||
|
headers: new Headers({
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}),
|
||||||
|
credentials: 'include'
|
||||||
|
};
|
||||||
|
(0, _request.default)('login', params).then(function (_ref) {
|
||||||
|
var success = _ref.success,
|
||||||
|
channelName = _ref.channelName,
|
||||||
|
shortChannelId = _ref.shortChannelId,
|
||||||
|
channelClaimId = _ref.channelClaimId,
|
||||||
|
message = _ref.message;
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
_this2.props.onChannelLogin(channelName, shortChannelId, channelClaimId);
|
||||||
|
} else {
|
||||||
|
_this2.setState({
|
||||||
|
'error': message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
}).catch(function (error) {
|
||||||
|
if (error.message) {
|
||||||
|
_this2.setState({
|
||||||
|
'error': error.message
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
_this2.setState({
|
||||||
|
'error': error
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
return _react.default.createElement("form", {
|
||||||
|
id: "channel-login-form"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "row row--wide row--short"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--3 column--sml-10"
|
||||||
|
}, _react.default.createElement("label", {
|
||||||
|
className: "label",
|
||||||
|
htmlFor: "channel-login-name-input"
|
||||||
|
}, "Name:")), _react.default.createElement("div", {
|
||||||
|
className: "column column--6 column--sml-10"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "input-text--primary flex-container--row flex-container--left-bottom"
|
||||||
|
}, _react.default.createElement("span", null, "@"), _react.default.createElement("input", {
|
||||||
|
type: "text",
|
||||||
|
id: "channel-login-name-input",
|
||||||
|
className: "input-text",
|
||||||
|
name: "name",
|
||||||
|
placeholder: "Your Channel Name",
|
||||||
|
value: this.state.channelName,
|
||||||
|
onChange: this.handleInput
|
||||||
|
})))), _react.default.createElement("div", {
|
||||||
|
className: "row row--wide row--short"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--3 column--sml-10"
|
||||||
|
}, _react.default.createElement("label", {
|
||||||
|
className: "label",
|
||||||
|
htmlFor: "channel-login-password-input"
|
||||||
|
}, "Password:")), _react.default.createElement("div", {
|
||||||
|
className: "column column--6 column--sml-10"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "input-text--primary"
|
||||||
|
}, _react.default.createElement("input", {
|
||||||
|
type: "password",
|
||||||
|
id: "channel-login-password-input",
|
||||||
|
name: "password",
|
||||||
|
className: "input-text",
|
||||||
|
placeholder: "",
|
||||||
|
value: this.state.channelPassword,
|
||||||
|
onChange: this.handleInput
|
||||||
|
})))), this.state.error ? _react.default.createElement("p", {
|
||||||
|
className: "info-message--failure"
|
||||||
|
}, this.state.error) : _react.default.createElement("p", {
|
||||||
|
className: "info-message"
|
||||||
|
}, "Enter the name and password for your channel"), _react.default.createElement("div", {
|
||||||
|
className: "row row--wide"
|
||||||
|
}, _react.default.createElement("button", {
|
||||||
|
className: "button--primary",
|
||||||
|
onClick: this.loginToChannel
|
||||||
|
}, "Authenticate")));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(ChannelLoginForm, _React$Component);
|
||||||
|
|
||||||
|
return ChannelLoginForm;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
var _default = ChannelLoginForm;
|
||||||
|
exports.default = _default;
|
42
client/build/containers/ChannelSelect/index.js
Normal file
42
client/build/containers/ChannelSelect/index.js
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _publish = require("../../actions/publish");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var channel = _ref.channel,
|
||||||
|
publish = _ref.publish;
|
||||||
|
return {
|
||||||
|
loggedInChannelName: channel.loggedInChannel.name,
|
||||||
|
publishInChannel: publish.publishInChannel,
|
||||||
|
selectedChannel: publish.selectedChannel,
|
||||||
|
channelError: publish.error.channel
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
||||||
|
return {
|
||||||
|
onPublishInChannelChange: function onPublishInChannelChange(value) {
|
||||||
|
dispatch((0, _publish.updateError)('channel', null));
|
||||||
|
dispatch((0, _publish.setPublishInChannel)(value));
|
||||||
|
},
|
||||||
|
onChannelSelect: function onChannelSelect(value) {
|
||||||
|
dispatch((0, _publish.updateError)('channel', null));
|
||||||
|
dispatch((0, _publish.updateSelectedChannel)(value));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
132
client/build/containers/ChannelSelect/view.js
Normal file
132
client/build/containers/ChannelSelect/view.js
Normal file
|
@ -0,0 +1,132 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _ChannelLoginForm = _interopRequireDefault(require("@containers/ChannelLoginForm"));
|
||||||
|
|
||||||
|
var _ChannelCreateForm = _interopRequireDefault(require("@containers/ChannelCreateForm"));
|
||||||
|
|
||||||
|
var states = _interopRequireWildcard(require("../../constants/publish_channel_select_states"));
|
||||||
|
|
||||||
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
var ChannelSelect =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function ChannelSelect(props) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, ChannelSelect);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(ChannelSelect).call(this, props));
|
||||||
|
_this.toggleAnonymousPublish = _this.toggleAnonymousPublish.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.handleSelection = _this.handleSelection.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(ChannelSelect, [{
|
||||||
|
key: "toggleAnonymousPublish",
|
||||||
|
value: function toggleAnonymousPublish(event) {
|
||||||
|
var value = event.target.value;
|
||||||
|
|
||||||
|
if (value === 'anonymous') {
|
||||||
|
this.props.onPublishInChannelChange(false);
|
||||||
|
} else {
|
||||||
|
this.props.onPublishInChannelChange(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleSelection",
|
||||||
|
value: function handleSelection(event) {
|
||||||
|
var selectedOption = event.target.selectedOptions[0].value;
|
||||||
|
this.props.onChannelSelect(selectedOption);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
return _react.default.createElement("div", null, _react.default.createElement("form", null, _react.default.createElement("div", {
|
||||||
|
className: "column column--3 column--med-10"
|
||||||
|
}, _react.default.createElement("input", {
|
||||||
|
type: "radio",
|
||||||
|
name: "anonymous-or-channel",
|
||||||
|
id: "anonymous-radio",
|
||||||
|
className: "input-radio",
|
||||||
|
value: "anonymous",
|
||||||
|
checked: !this.props.publishInChannel,
|
||||||
|
onChange: this.toggleAnonymousPublish
|
||||||
|
}), _react.default.createElement("label", {
|
||||||
|
className: "label label--pointer",
|
||||||
|
htmlFor: "anonymous-radio"
|
||||||
|
}, "Anonymous")), _react.default.createElement("div", {
|
||||||
|
className: "column column--7 column--med-10"
|
||||||
|
}, _react.default.createElement("input", {
|
||||||
|
type: "radio",
|
||||||
|
name: "anonymous-or-channel",
|
||||||
|
id: "channel-radio",
|
||||||
|
className: "input-radio",
|
||||||
|
value: "in a channel",
|
||||||
|
checked: this.props.publishInChannel,
|
||||||
|
onChange: this.toggleAnonymousPublish
|
||||||
|
}), _react.default.createElement("label", {
|
||||||
|
className: "label label--pointer",
|
||||||
|
htmlFor: "channel-radio"
|
||||||
|
}, "In a channel")), this.props.channelError ? _react.default.createElement("p", {
|
||||||
|
className: "info-message--failure"
|
||||||
|
}, this.props.channelError) : _react.default.createElement("p", {
|
||||||
|
className: "info-message"
|
||||||
|
}, "Publish anonymously or in a channel")), this.props.publishInChannel && _react.default.createElement("div", null, _react.default.createElement("div", {
|
||||||
|
className: "column column--3"
|
||||||
|
}, _react.default.createElement("label", {
|
||||||
|
className: "label",
|
||||||
|
htmlFor: "channel-name-select"
|
||||||
|
}, "Channel:")), _react.default.createElement("div", {
|
||||||
|
className: "column column--7"
|
||||||
|
}, _react.default.createElement("select", {
|
||||||
|
type: "text",
|
||||||
|
id: "channel-name-select",
|
||||||
|
className: "select select--arrow",
|
||||||
|
value: this.props.selectedChannel,
|
||||||
|
onChange: this.handleSelection
|
||||||
|
}, this.props.loggedInChannelName && _react.default.createElement("option", {
|
||||||
|
value: this.props.loggedInChannelName,
|
||||||
|
id: "publish-channel-select-channel-option"
|
||||||
|
}, this.props.loggedInChannelName), _react.default.createElement("option", {
|
||||||
|
value: states.LOGIN
|
||||||
|
}, "Existing"), _react.default.createElement("option", {
|
||||||
|
value: states.CREATE
|
||||||
|
}, "New"))), this.props.selectedChannel === states.LOGIN && _react.default.createElement(_ChannelLoginForm.default, null), this.props.selectedChannel === states.CREATE && _react.default.createElement(_ChannelCreateForm.default, null)));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(ChannelSelect, _React$Component);
|
||||||
|
|
||||||
|
return ChannelSelect;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
var _default = ChannelSelect;
|
||||||
|
exports.default = _default;
|
39
client/build/containers/Dropzone/index.js
Normal file
39
client/build/containers/Dropzone/index.js
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _publish = require("../../actions/publish");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var publish = _ref.publish;
|
||||||
|
return {
|
||||||
|
file: publish.file,
|
||||||
|
thumbnail: publish.thumbnail,
|
||||||
|
fileError: publish.error.file
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
||||||
|
return {
|
||||||
|
selectFile: function selectFile(file) {
|
||||||
|
dispatch((0, _publish.selectFile)(file));
|
||||||
|
},
|
||||||
|
setFileError: function setFileError(value) {
|
||||||
|
dispatch((0, _publish.clearFile)());
|
||||||
|
dispatch((0, _publish.updateError)('file', value));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
226
client/build/containers/Dropzone/view.js
Normal file
226
client/build/containers/Dropzone/view.js
Normal file
|
@ -0,0 +1,226 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _file = require("../../utils/file");
|
||||||
|
|
||||||
|
var _PublishPreview = _interopRequireDefault(require("@components/PublishPreview"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
var Dropzone =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function Dropzone(props) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, Dropzone);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(Dropzone).call(this, props));
|
||||||
|
_this.state = {
|
||||||
|
dragOver: false,
|
||||||
|
mouseOver: false,
|
||||||
|
dimPreview: false
|
||||||
|
};
|
||||||
|
_this.handleDrop = _this.handleDrop.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.handleDragOver = _this.handleDragOver.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.handleDragEnd = _this.handleDragEnd.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.handleDragEnter = _this.handleDragEnter.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.handleDragLeave = _this.handleDragLeave.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.handleMouseEnter = _this.handleMouseEnter.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.handleMouseLeave = _this.handleMouseLeave.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.handleFileInput = _this.handleFileInput.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.chooseFile = _this.chooseFile.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(Dropzone, [{
|
||||||
|
key: "handleDrop",
|
||||||
|
value: function handleDrop(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
this.setState({
|
||||||
|
dragOver: false
|
||||||
|
}); // if dropped items aren't files, reject them
|
||||||
|
|
||||||
|
var dt = event.dataTransfer;
|
||||||
|
|
||||||
|
if (dt.items) {
|
||||||
|
if (dt.items[0].kind === 'file') {
|
||||||
|
var droppedFile = dt.items[0].getAsFile();
|
||||||
|
this.chooseFile(droppedFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleDragOver",
|
||||||
|
value: function handleDragOver(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleDragEnd",
|
||||||
|
value: function handleDragEnd(event) {
|
||||||
|
var dt = event.dataTransfer;
|
||||||
|
|
||||||
|
if (dt.items) {
|
||||||
|
for (var i = 0; i < dt.items.length; i++) {
|
||||||
|
dt.items.remove(i);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
event.dataTransfer.clearData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleDragEnter",
|
||||||
|
value: function handleDragEnter() {
|
||||||
|
this.setState({
|
||||||
|
dragOver: true,
|
||||||
|
dimPreview: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleDragLeave",
|
||||||
|
value: function handleDragLeave() {
|
||||||
|
this.setState({
|
||||||
|
dragOver: false,
|
||||||
|
dimPreview: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleMouseEnter",
|
||||||
|
value: function handleMouseEnter() {
|
||||||
|
this.setState({
|
||||||
|
mouseOver: true,
|
||||||
|
dimPreview: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleMouseLeave",
|
||||||
|
value: function handleMouseLeave() {
|
||||||
|
this.setState({
|
||||||
|
mouseOver: false,
|
||||||
|
dimPreview: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleClick",
|
||||||
|
value: function handleClick(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
document.getElementById('file_input').click();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleFileInput",
|
||||||
|
value: function handleFileInput(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
var fileList = event.target.files;
|
||||||
|
this.chooseFile(fileList[0]);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "chooseFile",
|
||||||
|
value: function chooseFile(file) {
|
||||||
|
if (file) {
|
||||||
|
try {
|
||||||
|
(0, _file.validateFile)(file); // validate the file's name, type, and size
|
||||||
|
} catch (error) {
|
||||||
|
return this.props.setFileError(error.message);
|
||||||
|
} // stage it so it will be ready when the publish button is clicked
|
||||||
|
|
||||||
|
|
||||||
|
this.props.selectFile(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
return _react.default.createElement("div", {
|
||||||
|
className: "row row--tall flex-container--column"
|
||||||
|
}, _react.default.createElement("form", null, _react.default.createElement("input", {
|
||||||
|
className: "input-file",
|
||||||
|
type: "file",
|
||||||
|
id: "file_input",
|
||||||
|
name: "file_input",
|
||||||
|
accept: "video/*,image/*",
|
||||||
|
onChange: this.handleFileInput,
|
||||||
|
encType: "multipart/form-data"
|
||||||
|
})), _react.default.createElement("div", {
|
||||||
|
id: "preview-dropzone",
|
||||||
|
className: 'row row--padded row--tall dropzone' + (this.state.dragOver ? ' dropzone--drag-over' : ''),
|
||||||
|
onDrop: this.handleDrop,
|
||||||
|
onDragOver: this.handleDragOver,
|
||||||
|
onDragEnd: this.handleDragEnd,
|
||||||
|
onDragEnter: this.handleDragEnter,
|
||||||
|
onDragLeave: this.handleDragLeave,
|
||||||
|
onMouseEnter: this.handleMouseEnter,
|
||||||
|
onMouseLeave: this.handleMouseLeave,
|
||||||
|
onClick: this.handleClick
|
||||||
|
}, this.props.file ? _react.default.createElement("div", null, _react.default.createElement(_PublishPreview.default, {
|
||||||
|
dimPreview: this.state.dimPreview,
|
||||||
|
file: this.props.file,
|
||||||
|
thumbnail: this.props.thumbnail
|
||||||
|
}), _react.default.createElement("div", {
|
||||||
|
id: "dropzone-text-holder",
|
||||||
|
className: 'flex-container--column flex-container--center-center'
|
||||||
|
}, this.state.dragOver ? _react.default.createElement("div", {
|
||||||
|
id: "dropzone-dragover"
|
||||||
|
}, _react.default.createElement("p", {
|
||||||
|
className: "blue"
|
||||||
|
}, "Drop it.")) : null, this.state.mouseOver ? _react.default.createElement("div", {
|
||||||
|
id: "dropzone-instructions"
|
||||||
|
}, _react.default.createElement("p", {
|
||||||
|
className: "info-message-placeholder info-message--failure",
|
||||||
|
id: "input-error-file-selection"
|
||||||
|
}, this.props.fileError), _react.default.createElement("p", null, "Drag & drop image or video here to publish"), _react.default.createElement("p", {
|
||||||
|
className: "fine-print"
|
||||||
|
}, "OR"), _react.default.createElement("p", {
|
||||||
|
className: "blue--underlined"
|
||||||
|
}, "CHOOSE FILE")) : null)) : _react.default.createElement("div", {
|
||||||
|
id: "dropzone-text-holder",
|
||||||
|
className: 'flex-container--column flex-container--center-center'
|
||||||
|
}, this.state.dragOver ? _react.default.createElement("div", {
|
||||||
|
id: "dropzone-dragover"
|
||||||
|
}, _react.default.createElement("p", {
|
||||||
|
className: "blue"
|
||||||
|
}, "Drop it.")) : _react.default.createElement("div", {
|
||||||
|
id: "dropzone-instructions"
|
||||||
|
}, _react.default.createElement("p", {
|
||||||
|
className: "info-message-placeholder info-message--failure",
|
||||||
|
id: "input-error-file-selection"
|
||||||
|
}, this.props.fileError), _react.default.createElement("p", null, "Drag & drop image or video here to publish"), _react.default.createElement("p", {
|
||||||
|
className: "fine-print"
|
||||||
|
}, "OR"), _react.default.createElement("p", {
|
||||||
|
className: "blue--underlined"
|
||||||
|
}, "CHOOSE FILE")))));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(Dropzone, _React$Component);
|
||||||
|
|
||||||
|
return Dropzone;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = Dropzone;
|
||||||
|
exports.default = _default;
|
34
client/build/containers/NavBar/index.js
Normal file
34
client/build/containers/NavBar/index.js
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _channel = require("../../actions/channel");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var channel = _ref.channel,
|
||||||
|
site = _ref.site;
|
||||||
|
return {
|
||||||
|
channelName: channel.loggedInChannel.name,
|
||||||
|
channelShortId: channel.loggedInChannel.shortId,
|
||||||
|
channelLongId: channel.loggedInChannel.longId,
|
||||||
|
siteDescription: site.description
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var mapDispatchToProps = {
|
||||||
|
checkForLoggedInChannel: _channel.checkForLoggedInChannel,
|
||||||
|
logOutChannel: _channel.logOutChannel
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
121
client/build/containers/NavBar/view.js
Normal file
121
client/build/containers/NavBar/view.js
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _reactRouterDom = require("react-router-dom");
|
||||||
|
|
||||||
|
var _Logo = _interopRequireDefault(require("@components/Logo"));
|
||||||
|
|
||||||
|
var _NavBarChannelOptionsDropdown = _interopRequireDefault(require("@components/NavBarChannelOptionsDropdown"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
var VIEW = 'VIEW';
|
||||||
|
var LOGOUT = 'LOGOUT';
|
||||||
|
|
||||||
|
var NavBar =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function NavBar(props) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, NavBar);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(NavBar).call(this, props));
|
||||||
|
_this.handleSelection = _this.handleSelection.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(NavBar, [{
|
||||||
|
key: "componentDidMount",
|
||||||
|
value: function componentDidMount() {
|
||||||
|
this.props.checkForLoggedInChannel();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleSelection",
|
||||||
|
value: function handleSelection(event) {
|
||||||
|
var value = event.target.selectedOptions[0].value;
|
||||||
|
|
||||||
|
switch (value) {
|
||||||
|
case LOGOUT:
|
||||||
|
this.props.logOutChannel();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VIEW:
|
||||||
|
// redirect to channel page
|
||||||
|
this.props.history.push("/".concat(this.props.channelName, ":").concat(this.props.channelLongId));
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var siteDescription = this.props.siteDescription;
|
||||||
|
return _react.default.createElement("div", {
|
||||||
|
className: "row row--wide nav-bar"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "row row--padded row--short flex-container--row flex-container--space-between-center"
|
||||||
|
}, _react.default.createElement(_Logo.default, null), _react.default.createElement("div", {
|
||||||
|
className: "nav-bar--center"
|
||||||
|
}, _react.default.createElement("span", {
|
||||||
|
className: "nav-bar-tagline"
|
||||||
|
}, siteDescription)), _react.default.createElement("div", {
|
||||||
|
className: "nav-bar--right"
|
||||||
|
}, _react.default.createElement(_reactRouterDom.NavLink, {
|
||||||
|
className: "nav-bar-link link--nav",
|
||||||
|
activeClassName: "link--nav-active",
|
||||||
|
to: "/",
|
||||||
|
exact: true
|
||||||
|
}, "Publish"), _react.default.createElement(_reactRouterDom.NavLink, {
|
||||||
|
className: "nav-bar-link link--nav",
|
||||||
|
activeClassName: "link--nav-active",
|
||||||
|
to: "/about"
|
||||||
|
}, "About"), this.props.channelName ? _react.default.createElement(_NavBarChannelOptionsDropdown.default, {
|
||||||
|
channelName: this.props.channelName,
|
||||||
|
handleSelection: this.handleSelection,
|
||||||
|
defaultSelection: this.props.channelName,
|
||||||
|
VIEW: VIEW,
|
||||||
|
LOGOUT: LOGOUT
|
||||||
|
}) : _react.default.createElement(_reactRouterDom.NavLink, {
|
||||||
|
id: "nav-bar-login-link",
|
||||||
|
className: "nav-bar-link link--nav",
|
||||||
|
activeClassName: "link--nav-active",
|
||||||
|
to: "/login"
|
||||||
|
}, "Channel"))));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(NavBar, _React$Component);
|
||||||
|
|
||||||
|
return NavBar;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
var _default = (0, _reactRouterDom.withRouter)(NavBar);
|
||||||
|
|
||||||
|
exports.default = _default;
|
31
client/build/containers/PublishDetails/index.js
Normal file
31
client/build/containers/PublishDetails/index.js
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _publish = require("../../actions/publish");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var channel = _ref.channel,
|
||||||
|
publish = _ref.publish;
|
||||||
|
return {
|
||||||
|
file: publish.file
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var mapDispatchToProps = {
|
||||||
|
clearFile: _publish.clearFile,
|
||||||
|
startPublish: _publish.startPublish
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
118
client/build/containers/PublishDetails/view.js
Normal file
118
client/build/containers/PublishDetails/view.js
Normal file
|
@ -0,0 +1,118 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _reactRouterDom = require("react-router-dom");
|
||||||
|
|
||||||
|
var _Dropzone = _interopRequireDefault(require("@containers/Dropzone"));
|
||||||
|
|
||||||
|
var _PublishTitleInput = _interopRequireDefault(require("@containers/PublishTitleInput"));
|
||||||
|
|
||||||
|
var _PublishUrlInput = _interopRequireDefault(require("@containers/PublishUrlInput"));
|
||||||
|
|
||||||
|
var _PublishThumbnailInput = _interopRequireDefault(require("@containers/PublishThumbnailInput"));
|
||||||
|
|
||||||
|
var _PublishMetadataInputs = _interopRequireDefault(require("@containers/PublishMetadataInputs"));
|
||||||
|
|
||||||
|
var _ChannelSelect = _interopRequireDefault(require("@containers/ChannelSelect"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
var PublishDetails =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function PublishDetails(props) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, PublishDetails);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(PublishDetails).call(this, props));
|
||||||
|
_this.onPublishSubmit = _this.onPublishSubmit.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(PublishDetails, [{
|
||||||
|
key: "onPublishSubmit",
|
||||||
|
value: function onPublishSubmit() {
|
||||||
|
this.props.startPublish(this.props.history);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
return _react.default.createElement("div", {
|
||||||
|
className: "row row--no-bottom"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--10"
|
||||||
|
}, _react.default.createElement(_PublishTitleInput.default, null)), _react.default.createElement("div", {
|
||||||
|
className: "column column--5 column--sml-10"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "row row--padded"
|
||||||
|
}, _react.default.createElement(_Dropzone.default, null))), _react.default.createElement("div", {
|
||||||
|
className: "column column--5 column--sml-10 align-content-top"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
id: "publish-active-area",
|
||||||
|
className: "row row--padded"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "row row--padded row--no-top row--wide"
|
||||||
|
}, _react.default.createElement(_PublishUrlInput.default, null)), _react.default.createElement("div", {
|
||||||
|
className: "row row--padded row--no-top row--wide"
|
||||||
|
}, _react.default.createElement(_ChannelSelect.default, null)), this.props.file.type === 'video/mp4' && _react.default.createElement("div", {
|
||||||
|
className: "row row--padded row--no-top row--wide "
|
||||||
|
}, _react.default.createElement(_PublishThumbnailInput.default, null)), _react.default.createElement("div", {
|
||||||
|
className: "row row--padded row--no-top row--no-bottom row--wide"
|
||||||
|
}, _react.default.createElement(_PublishMetadataInputs.default, null)), _react.default.createElement("div", {
|
||||||
|
className: "row row--wide align-content-center"
|
||||||
|
}, _react.default.createElement("button", {
|
||||||
|
id: "publish-submit",
|
||||||
|
className: "button--primary button--large",
|
||||||
|
onClick: this.onPublishSubmit
|
||||||
|
}, "Publish")), _react.default.createElement("div", {
|
||||||
|
className: "row row--padded row--no-bottom align-content-center"
|
||||||
|
}, _react.default.createElement("button", {
|
||||||
|
className: "button--cancel",
|
||||||
|
onClick: this.props.clearFile
|
||||||
|
}, "Cancel")), _react.default.createElement("div", {
|
||||||
|
className: "row row--short align-content-center"
|
||||||
|
}, _react.default.createElement("p", {
|
||||||
|
className: "fine-print"
|
||||||
|
}, "By clicking 'Publish', you affirm that you have the rights to publish this content to the LBRY network, and that you understand the properties of publishing it to a decentralized, user-controlled network. ", _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
target: "_blank",
|
||||||
|
href: "https://lbry.io/learn"
|
||||||
|
}, "Read more."))))));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(PublishDetails, _React$Component);
|
||||||
|
|
||||||
|
return PublishDetails;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
var _default = (0, _reactRouterDom.withRouter)(PublishDetails);
|
||||||
|
|
||||||
|
exports.default = _default;
|
23
client/build/containers/PublishDisabledMessage/index.js
Normal file
23
client/build/containers/PublishDisabledMessage/index.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var publish = _ref.publish;
|
||||||
|
return {
|
||||||
|
message: publish.disabledMessage
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
59
client/build/containers/PublishDisabledMessage/view.js
Normal file
59
client/build/containers/PublishDisabledMessage/view.js
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var PublishDisabledMessage =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function PublishDisabledMessage() {
|
||||||
|
_classCallCheck(this, PublishDisabledMessage);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(PublishDisabledMessage).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(PublishDisabledMessage, [{
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var message = this.props.message;
|
||||||
|
return _react.default.createElement("div", {
|
||||||
|
className: "row dropzone--disabled row--tall flex-container--column flex-container--center-center"
|
||||||
|
}, _react.default.createElement("p", {
|
||||||
|
className: "text--disabled"
|
||||||
|
}, "Publishing is currently disabled."), _react.default.createElement("p", {
|
||||||
|
className: "text--disabled"
|
||||||
|
}, message));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(PublishDisabledMessage, _React$Component);
|
||||||
|
|
||||||
|
return PublishDisabledMessage;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
var _default = PublishDisabledMessage;
|
||||||
|
exports.default = _default;
|
39
client/build/containers/PublishMetadataInputs/index.js
Normal file
39
client/build/containers/PublishMetadataInputs/index.js
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _publish = require("../../actions/publish");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var publish = _ref.publish;
|
||||||
|
return {
|
||||||
|
showMetadataInputs: publish.showMetadataInputs,
|
||||||
|
description: publish.metadata.description,
|
||||||
|
license: publish.metadata.license,
|
||||||
|
nsfw: publish.metadata.nsfw
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
||||||
|
return {
|
||||||
|
onMetadataChange: function onMetadataChange(name, value) {
|
||||||
|
dispatch((0, _publish.updateMetadata)(name, value));
|
||||||
|
},
|
||||||
|
onToggleMetadataInputs: function onToggleMetadataInputs(value) {
|
||||||
|
dispatch((0, _publish.toggleMetadataInputs)(value));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
144
client/build/containers/PublishMetadataInputs/view.js
Normal file
144
client/build/containers/PublishMetadataInputs/view.js
Normal file
|
@ -0,0 +1,144 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _ExpandingTextArea = _interopRequireDefault(require("@components/ExpandingTextArea"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
var PublishMetadataInputs =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function PublishMetadataInputs(props) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, PublishMetadataInputs);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(PublishMetadataInputs).call(this, props));
|
||||||
|
_this.toggleShowInputs = _this.toggleShowInputs.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.handleInput = _this.handleInput.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.handleSelect = _this.handleSelect.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(PublishMetadataInputs, [{
|
||||||
|
key: "toggleShowInputs",
|
||||||
|
value: function toggleShowInputs() {
|
||||||
|
this.props.onToggleMetadataInputs(!this.props.showMetadataInputs);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleInput",
|
||||||
|
value: function handleInput(event) {
|
||||||
|
var target = event.target;
|
||||||
|
var value = target.type === 'checkbox' ? target.checked : target.value;
|
||||||
|
var name = target.name;
|
||||||
|
this.props.onMetadataChange(name, value);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleSelect",
|
||||||
|
value: function handleSelect(event) {
|
||||||
|
var name = event.target.name;
|
||||||
|
var selectedOption = event.target.selectedOptions[0].value;
|
||||||
|
this.props.onMetadataChange(name, selectedOption);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
return _react.default.createElement("div", {
|
||||||
|
id: "publish-details",
|
||||||
|
className: "row row--padded row--no-top row--wide"
|
||||||
|
}, this.props.showMetadataInputs && _react.default.createElement("div", null, _react.default.createElement("div", {
|
||||||
|
className: "row row--no-top"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--3 column--med-10 align-content-top"
|
||||||
|
}, _react.default.createElement("label", {
|
||||||
|
htmlFor: "publish-license",
|
||||||
|
className: "label"
|
||||||
|
}, "Description:")), _react.default.createElement("div", {
|
||||||
|
className: "column column--7 column--sml-10"
|
||||||
|
}, _react.default.createElement(_ExpandingTextArea.default, {
|
||||||
|
id: "publish-description",
|
||||||
|
className: "textarea textarea--primary textarea--full-width",
|
||||||
|
rows: 1,
|
||||||
|
maxLength: 2000,
|
||||||
|
style: {
|
||||||
|
maxHeight: 200
|
||||||
|
},
|
||||||
|
name: "description",
|
||||||
|
placeholder: "Optional description",
|
||||||
|
value: this.props.description,
|
||||||
|
onChange: this.handleInput
|
||||||
|
}))), _react.default.createElement("div", {
|
||||||
|
className: "row row--no-top"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--3 column--med-10"
|
||||||
|
}, _react.default.createElement("label", {
|
||||||
|
htmlFor: "publish-license",
|
||||||
|
className: "label"
|
||||||
|
}, "License:")), _react.default.createElement("div", {
|
||||||
|
className: "column column--7 column--sml-10"
|
||||||
|
}, _react.default.createElement("select", {
|
||||||
|
type: "text",
|
||||||
|
name: "license",
|
||||||
|
id: "publish-license",
|
||||||
|
className: "select select--primary",
|
||||||
|
onChange: this.handleSelect
|
||||||
|
}, _react.default.createElement("option", {
|
||||||
|
value: " "
|
||||||
|
}, "Unspecified"), _react.default.createElement("option", {
|
||||||
|
value: "Public Domain"
|
||||||
|
}, "Public Domain"), _react.default.createElement("option", {
|
||||||
|
value: "Creative Commons"
|
||||||
|
}, "Creative Commons")))), _react.default.createElement("div", {
|
||||||
|
className: "row row--no-top"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--3"
|
||||||
|
}, _react.default.createElement("label", {
|
||||||
|
htmlFor: "publish-nsfw",
|
||||||
|
className: "label"
|
||||||
|
}, "Mature:")), _react.default.createElement("div", {
|
||||||
|
className: "column column--7"
|
||||||
|
}, _react.default.createElement("input", {
|
||||||
|
className: "input-checkbox",
|
||||||
|
type: "checkbox",
|
||||||
|
id: "publish-nsfw",
|
||||||
|
name: "nsfw",
|
||||||
|
value: this.props.nsfw,
|
||||||
|
onChange: this.handleInput
|
||||||
|
})))), _react.default.createElement("button", {
|
||||||
|
className: "button--secondary",
|
||||||
|
onClick: this.toggleShowInputs
|
||||||
|
}, this.props.showMetadataInputs ? 'less' : 'more'));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(PublishMetadataInputs, _React$Component);
|
||||||
|
|
||||||
|
return PublishMetadataInputs;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
var _default = PublishMetadataInputs;
|
||||||
|
exports.default = _default;
|
30
client/build/containers/PublishStatus/index.js
Normal file
30
client/build/containers/PublishStatus/index.js
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _publish = require("../../actions/publish");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var publish = _ref.publish;
|
||||||
|
return {
|
||||||
|
status: publish.status.status,
|
||||||
|
message: publish.status.message
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var mapDispatchToProps = {
|
||||||
|
clearFile: _publish.clearFile
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
96
client/build/containers/PublishStatus/view.js
Normal file
96
client/build/containers/PublishStatus/view.js
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _ProgressBar = _interopRequireDefault(require("@components/ProgressBar"));
|
||||||
|
|
||||||
|
var publishStates = _interopRequireWildcard(require("../../constants/publish_claim_states"));
|
||||||
|
|
||||||
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var PublishStatus =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function PublishStatus() {
|
||||||
|
_classCallCheck(this, PublishStatus);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(PublishStatus).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(PublishStatus, [{
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var _this$props = this.props,
|
||||||
|
status = _this$props.status,
|
||||||
|
message = _this$props.message,
|
||||||
|
clearFile = _this$props.clearFile;
|
||||||
|
return _react.default.createElement("div", {
|
||||||
|
className: "row row--tall flex-container--column flex-container--center-center"
|
||||||
|
}, status === publishStates.LOAD_START && _react.default.createElement("div", {
|
||||||
|
className: "row align-content-center"
|
||||||
|
}, _react.default.createElement("p", null, "File is loading to server"), _react.default.createElement("p", {
|
||||||
|
className: "blue"
|
||||||
|
}, "0%")), status === publishStates.LOADING && _react.default.createElement("div", null, _react.default.createElement("div", {
|
||||||
|
className: "row align-content-center"
|
||||||
|
}, _react.default.createElement("p", null, "File is loading to server"), _react.default.createElement("p", {
|
||||||
|
className: "blue"
|
||||||
|
}, message))), status === publishStates.PUBLISHING && _react.default.createElement("div", {
|
||||||
|
className: "row align-content-center"
|
||||||
|
}, _react.default.createElement("p", null, "Upload complete. Your file is now being published on the blockchain..."), _react.default.createElement(_ProgressBar.default, {
|
||||||
|
size: 12
|
||||||
|
}), _react.default.createElement("p", null, "Curious what magic is happening here? ", _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
target: "blank",
|
||||||
|
href: "https://lbry.io/faq/what-is-lbry"
|
||||||
|
}, "Learn more."))), status === publishStates.SUCCESS && _react.default.createElement("div", {
|
||||||
|
className: "row align-content-center"
|
||||||
|
}, _react.default.createElement("p", null, "Your publish is complete! You are being redirected to it now."), _react.default.createElement("p", null, "If you are not automatically redirected, ", _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
target: "_blank",
|
||||||
|
href: message
|
||||||
|
}, "click here."))), status === publishStates.FAILED && _react.default.createElement("div", {
|
||||||
|
className: "row align-content-center"
|
||||||
|
}, _react.default.createElement("p", null, "Something went wrong..."), _react.default.createElement("p", null, _react.default.createElement("strong", null, message)), _react.default.createElement("p", null, "For help, post the above error text in the #speech channel on the ", _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
href: "https://chat.lbry.io",
|
||||||
|
target: "_blank"
|
||||||
|
}, "lbry discord")), _react.default.createElement("button", {
|
||||||
|
className: "button--secondary",
|
||||||
|
onClick: clearFile
|
||||||
|
}, "Reset")));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(PublishStatus, _React$Component);
|
||||||
|
|
||||||
|
return PublishStatus;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = PublishStatus;
|
||||||
|
exports.default = _default;
|
29
client/build/containers/PublishThumbnailInput/index.js
Normal file
29
client/build/containers/PublishThumbnailInput/index.js
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _publish = require("../../actions/publish");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var file = _ref.publish.file;
|
||||||
|
return {
|
||||||
|
file: file
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var mapDispatchToProps = {
|
||||||
|
onNewThumbnail: _publish.onNewThumbnail
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
208
client/build/containers/PublishThumbnailInput/view.js
Normal file
208
client/build/containers/PublishThumbnailInput/view.js
Normal file
|
@ -0,0 +1,208 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function dataURItoBlob(dataURI) {
|
||||||
|
// convert base64/URLEncoded data component to raw binary data held in a string
|
||||||
|
var byteString = atob(dataURI.split(',')[1]); // separate out the mime component
|
||||||
|
|
||||||
|
var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; // write the bytes of the string to a typed array
|
||||||
|
|
||||||
|
var ia = new Uint8Array(byteString.length);
|
||||||
|
|
||||||
|
for (var i = 0; i < byteString.length; i++) {
|
||||||
|
ia[i] = byteString.charCodeAt(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Blob([ia], {
|
||||||
|
type: mimeString
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var PublishThumbnailInput =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function PublishThumbnailInput(props) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, PublishThumbnailInput);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(PublishThumbnailInput).call(this, props));
|
||||||
|
_this.state = {
|
||||||
|
videoSource: null,
|
||||||
|
error: null,
|
||||||
|
sliderMinRange: 1,
|
||||||
|
sliderMaxRange: null,
|
||||||
|
sliderValue: null
|
||||||
|
};
|
||||||
|
_this.handleVideoLoadedData = _this.handleVideoLoadedData.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.handleSliderChange = _this.handleSliderChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
_this.createThumbnail = _this.createThumbnail.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(PublishThumbnailInput, [{
|
||||||
|
key: "componentDidMount",
|
||||||
|
value: function componentDidMount() {
|
||||||
|
var file = this.props.file;
|
||||||
|
this.setVideoSource(file);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "componentWillReceiveProps",
|
||||||
|
value: function componentWillReceiveProps(nextProps) {
|
||||||
|
// if file changes
|
||||||
|
if (nextProps.file && nextProps.file !== this.props.file) {
|
||||||
|
var file = nextProps.file;
|
||||||
|
this.setVideoSource(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "setVideoSource",
|
||||||
|
value: function setVideoSource(file) {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
var previewReader = new FileReader();
|
||||||
|
previewReader.readAsDataURL(file);
|
||||||
|
|
||||||
|
previewReader.onloadend = function () {
|
||||||
|
var dataUri = previewReader.result;
|
||||||
|
var blob = dataURItoBlob(dataUri);
|
||||||
|
var videoSource = URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
_this2.setState({
|
||||||
|
videoSource: videoSource
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleVideoLoadedData",
|
||||||
|
value: function handleVideoLoadedData(event) {
|
||||||
|
var duration = event.target.duration;
|
||||||
|
var totalMinutes = Math.floor(duration / 60);
|
||||||
|
var totalSeconds = Math.floor(duration % 60); // set the slider
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
sliderMaxRange: duration * 100,
|
||||||
|
sliderValue: duration * 100 / 2,
|
||||||
|
totalMinutes: totalMinutes,
|
||||||
|
totalSeconds: totalSeconds
|
||||||
|
}); // update the current time of the video
|
||||||
|
|
||||||
|
var video = document.getElementById('video-thumb-player');
|
||||||
|
video.currentTime = duration / 2;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleSliderChange",
|
||||||
|
value: function handleSliderChange(event) {
|
||||||
|
var value = parseInt(event.target.value); // update the slider value
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
sliderValue: value
|
||||||
|
}); // update the current time of the video
|
||||||
|
|
||||||
|
var video = document.getElementById('video-thumb-player');
|
||||||
|
video.currentTime = value / 100;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "createThumbnail",
|
||||||
|
value: function createThumbnail() {
|
||||||
|
// take a snapshot
|
||||||
|
var video = document.getElementById('video-thumb-player');
|
||||||
|
var canvas = document.createElement('canvas');
|
||||||
|
canvas.width = video.videoWidth;
|
||||||
|
canvas.height = video.videoHeight;
|
||||||
|
canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);
|
||||||
|
var dataUrl = canvas.toDataURL();
|
||||||
|
var blob = dataURItoBlob(dataUrl);
|
||||||
|
var snapshot = new File([blob], "thumbnail.png", {
|
||||||
|
type: 'image/png'
|
||||||
|
}); // set the thumbnail in redux store
|
||||||
|
|
||||||
|
if (snapshot) {
|
||||||
|
this.props.onNewThumbnail(snapshot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var _this$state = this.state,
|
||||||
|
error = _this$state.error,
|
||||||
|
videoSource = _this$state.videoSource,
|
||||||
|
sliderMinRange = _this$state.sliderMinRange,
|
||||||
|
sliderMaxRange = _this$state.sliderMaxRange,
|
||||||
|
sliderValue = _this$state.sliderValue,
|
||||||
|
totalMinutes = _this$state.totalMinutes,
|
||||||
|
totalSeconds = _this$state.totalSeconds;
|
||||||
|
return _react.default.createElement("div", null, _react.default.createElement("label", {
|
||||||
|
className: "label"
|
||||||
|
}, "Thumbnail:"), _react.default.createElement("video", {
|
||||||
|
id: "video-thumb-player",
|
||||||
|
preload: "metadata",
|
||||||
|
muted: true,
|
||||||
|
style: {
|
||||||
|
display: 'none'
|
||||||
|
},
|
||||||
|
playsInline: true,
|
||||||
|
onLoadedData: this.handleVideoLoadedData,
|
||||||
|
src: videoSource,
|
||||||
|
onSeeked: this.createThumbnail
|
||||||
|
}), sliderValue ? _react.default.createElement("div", null, _react.default.createElement("div", {
|
||||||
|
className: "flex-container--row flex-container--space-between-center",
|
||||||
|
style: {
|
||||||
|
width: '100%'
|
||||||
|
}
|
||||||
|
}, _react.default.createElement("span", {
|
||||||
|
className: "info-message"
|
||||||
|
}, "0'00\""), _react.default.createElement("span", {
|
||||||
|
className: "info-message"
|
||||||
|
}, totalMinutes, "'", totalSeconds, "\"")), _react.default.createElement("div", null, _react.default.createElement("input", {
|
||||||
|
type: "range",
|
||||||
|
min: sliderMinRange,
|
||||||
|
max: sliderMaxRange,
|
||||||
|
value: sliderValue,
|
||||||
|
className: "slider",
|
||||||
|
onChange: this.handleSliderChange
|
||||||
|
}))) : _react.default.createElement("p", {
|
||||||
|
className: "info-message"
|
||||||
|
}, "loading... "), error ? _react.default.createElement("p", {
|
||||||
|
className: "info-message--failure"
|
||||||
|
}, error) : _react.default.createElement("p", {
|
||||||
|
className: "info-message"
|
||||||
|
}, "Use slider to set thumbnail"));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(PublishThumbnailInput, _React$Component);
|
||||||
|
|
||||||
|
return PublishThumbnailInput;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
var _default = PublishThumbnailInput;
|
||||||
|
exports.default = _default;
|
33
client/build/containers/PublishTitleInput/index.js
Normal file
33
client/build/containers/PublishTitleInput/index.js
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _publish = require("../../actions/publish");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var publish = _ref.publish;
|
||||||
|
return {
|
||||||
|
title: publish.metadata.title
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
||||||
|
return {
|
||||||
|
onMetadataChange: function onMetadataChange(name, value) {
|
||||||
|
dispatch((0, _publish.updateMetadata)(name, value));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
71
client/build/containers/PublishTitleInput/view.js
Normal file
71
client/build/containers/PublishTitleInput/view.js
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
var PublishTitleInput =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function PublishTitleInput(props) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, PublishTitleInput);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(PublishTitleInput).call(this, props));
|
||||||
|
_this.handleInput = _this.handleInput.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(PublishTitleInput, [{
|
||||||
|
key: "handleInput",
|
||||||
|
value: function handleInput(e) {
|
||||||
|
var name = e.target.name;
|
||||||
|
var value = e.target.value;
|
||||||
|
this.props.onMetadataChange(name, value);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
return _react.default.createElement("input", {
|
||||||
|
type: "text",
|
||||||
|
id: "publish-title",
|
||||||
|
className: "input-text text--large input-text--full-width",
|
||||||
|
name: "title",
|
||||||
|
placeholder: "Give your post a title...",
|
||||||
|
onChange: this.handleInput,
|
||||||
|
value: this.props.title
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(PublishTitleInput, _React$Component);
|
||||||
|
|
||||||
|
return PublishTitleInput;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
var _default = PublishTitleInput;
|
||||||
|
exports.default = _default;
|
25
client/build/containers/PublishTool/index.js
Normal file
25
client/build/containers/PublishTool/index.js
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var publish = _ref.publish;
|
||||||
|
return {
|
||||||
|
disabled: publish.disabled,
|
||||||
|
file: publish.file,
|
||||||
|
status: publish.status.status
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
73
client/build/containers/PublishTool/view.js
Normal file
73
client/build/containers/PublishTool/view.js
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _Dropzone = _interopRequireDefault(require("@containers/Dropzone"));
|
||||||
|
|
||||||
|
var _PublishDetails = _interopRequireDefault(require("@containers/PublishDetails"));
|
||||||
|
|
||||||
|
var _PublishStatus = _interopRequireDefault(require("@containers/PublishStatus"));
|
||||||
|
|
||||||
|
var _PublishDisabledMessage = _interopRequireDefault(require("@containers/PublishDisabledMessage"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var PublishTool =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function PublishTool() {
|
||||||
|
_classCallCheck(this, PublishTool);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(PublishTool).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(PublishTool, [{
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
if (this.props.disabled) {
|
||||||
|
return _react.default.createElement(_PublishDisabledMessage.default, null);
|
||||||
|
} else {
|
||||||
|
if (this.props.file) {
|
||||||
|
if (this.props.status) {
|
||||||
|
return _react.default.createElement(_PublishStatus.default, null);
|
||||||
|
} else {
|
||||||
|
return _react.default.createElement(_PublishDetails.default, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _react.default.createElement(_Dropzone.default, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(PublishTool, _React$Component);
|
||||||
|
|
||||||
|
return PublishTool;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = PublishTool;
|
||||||
|
exports.default = _default;
|
38
client/build/containers/PublishUrlInput/index.js
Normal file
38
client/build/containers/PublishUrlInput/index.js
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _publish = require("../../actions/publish");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var channel = _ref.channel,
|
||||||
|
publish = _ref.publish;
|
||||||
|
return {
|
||||||
|
loggedInChannelName: channel.loggedInChannel.name,
|
||||||
|
loggedInChannelShortId: channel.loggedInChannel.shortId,
|
||||||
|
fileName: publish.file.name,
|
||||||
|
publishInChannel: publish.publishInChannel,
|
||||||
|
selectedChannel: publish.selectedChannel,
|
||||||
|
claim: publish.claim,
|
||||||
|
urlError: publish.error.url
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var mapDispatchToProps = {
|
||||||
|
validateClaim: _publish.validateClaim,
|
||||||
|
updateClaim: _publish.updateClaim,
|
||||||
|
updateError: _publish.updateError
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
149
client/build/containers/PublishUrlInput/view.js
Normal file
149
client/build/containers/PublishUrlInput/view.js
Normal file
|
@ -0,0 +1,149 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _PublishUrlMiddleDisplay = _interopRequireDefault(require("@components/PublishUrlMiddleDisplay"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
var PublishUrlInput =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function PublishUrlInput(props) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, PublishUrlInput);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(PublishUrlInput).call(this, props));
|
||||||
|
_this.handleInput = _this.handleInput.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(PublishUrlInput, [{
|
||||||
|
key: "cleanseInput",
|
||||||
|
value: function cleanseInput(input) {
|
||||||
|
input = input.replace(/\s+/g, '-');
|
||||||
|
input = input.replace(/[^A-Za-z0-9-]/g, '');
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "componentDidMount",
|
||||||
|
value: function componentDidMount() {
|
||||||
|
var _this$props = this.props,
|
||||||
|
claim = _this$props.claim,
|
||||||
|
fileName = _this$props.fileName;
|
||||||
|
|
||||||
|
if (!claim) {
|
||||||
|
this.setInitialClaimName(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "componentWillReceiveProps",
|
||||||
|
value: function componentWillReceiveProps(_ref) {
|
||||||
|
var claim = _ref.claim,
|
||||||
|
fileName = _ref.fileName;
|
||||||
|
|
||||||
|
// if a new file was chosen, update the claim name
|
||||||
|
if (fileName !== this.props.fileName) {
|
||||||
|
return this.setInitialClaimName(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "setInitialClaimName",
|
||||||
|
value: function setInitialClaimName(fileName) {
|
||||||
|
var fileNameWithoutEnding = fileName.substring(0, fileName.lastIndexOf('.'));
|
||||||
|
var cleanFileName = this.cleanseInput(fileNameWithoutEnding);
|
||||||
|
this.updateAndValidateClaimInput(cleanFileName);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "handleInput",
|
||||||
|
value: function handleInput(event) {
|
||||||
|
var value = event.target.value;
|
||||||
|
value = this.cleanseInput(value);
|
||||||
|
this.updateAndValidateClaimInput(value);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "updateAndValidateClaimInput",
|
||||||
|
value: function updateAndValidateClaimInput(value) {
|
||||||
|
if (value) {
|
||||||
|
this.props.validateClaim(value);
|
||||||
|
} else {
|
||||||
|
this.props.updateError('url', 'Choose a custom url');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.props.updateClaim(value);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var _this$props2 = this.props,
|
||||||
|
claim = _this$props2.claim,
|
||||||
|
loggedInChannelName = _this$props2.loggedInChannelName,
|
||||||
|
loggedInChannelShortId = _this$props2.loggedInChannelShortId,
|
||||||
|
publishInChannel = _this$props2.publishInChannel,
|
||||||
|
selectedChannel = _this$props2.selectedChannel,
|
||||||
|
urlError = _this$props2.urlError;
|
||||||
|
return _react.default.createElement("div", {
|
||||||
|
className: "column column--10 column--sml-10"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "input-text--primary span--relative"
|
||||||
|
}, _react.default.createElement("span", {
|
||||||
|
className: "url-text--secondary"
|
||||||
|
}, "spee.ch / "), _react.default.createElement(_PublishUrlMiddleDisplay.default, {
|
||||||
|
publishInChannel: publishInChannel,
|
||||||
|
selectedChannel: selectedChannel,
|
||||||
|
loggedInChannelName: loggedInChannelName,
|
||||||
|
loggedInChannelShortId: loggedInChannelShortId
|
||||||
|
}), _react.default.createElement("input", {
|
||||||
|
type: "text",
|
||||||
|
id: "claim-name-input",
|
||||||
|
className: "input-text",
|
||||||
|
name: "claim",
|
||||||
|
placeholder: "your-url-here",
|
||||||
|
onChange: this.handleInput,
|
||||||
|
value: claim
|
||||||
|
}), claim && !urlError && _react.default.createElement("span", {
|
||||||
|
id: "input-success-claim-name",
|
||||||
|
className: "info-message--success span--absolute"
|
||||||
|
}, "\u2713"), urlError && _react.default.createElement("span", {
|
||||||
|
id: "input-success-channel-name",
|
||||||
|
className: "info-message--failure span--absolute"
|
||||||
|
}, "\u2716")), _react.default.createElement("div", null, urlError ? _react.default.createElement("p", {
|
||||||
|
id: "input-error-claim-name",
|
||||||
|
className: "info-message--failure"
|
||||||
|
}, urlError) : _react.default.createElement("p", {
|
||||||
|
className: "info-message"
|
||||||
|
}, "Choose a custom url")));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(PublishUrlInput, _React$Component);
|
||||||
|
|
||||||
|
return PublishUrlInput;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
var _default = PublishUrlInput;
|
||||||
|
exports.default = _default;
|
38
client/build/containers/ShowAssetDetails/index.js
Normal file
38
client/build/containers/ShowAssetDetails/index.js
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var show = _ref.show;
|
||||||
|
// select request info
|
||||||
|
var requestId = show.request.id; // select asset info
|
||||||
|
|
||||||
|
var asset;
|
||||||
|
var request = show.requestList[requestId] || null;
|
||||||
|
var assetList = show.assetList;
|
||||||
|
|
||||||
|
if (request && assetList) {
|
||||||
|
var assetKey = request.key; // note: just store this in the request
|
||||||
|
|
||||||
|
asset = assetList[assetKey] || null;
|
||||||
|
}
|
||||||
|
|
||||||
|
; // return props
|
||||||
|
|
||||||
|
return {
|
||||||
|
asset: asset
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
90
client/build/containers/ShowAssetDetails/view.js
Normal file
90
client/build/containers/ShowAssetDetails/view.js
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _SEO = _interopRequireDefault(require("@components/SEO"));
|
||||||
|
|
||||||
|
var _NavBar = _interopRequireDefault(require("../NavBar"));
|
||||||
|
|
||||||
|
var _ErrorPage = _interopRequireDefault(require("../../pages/ErrorPage"));
|
||||||
|
|
||||||
|
var _AssetTitle = _interopRequireDefault(require("../AssetTitle"));
|
||||||
|
|
||||||
|
var _AssetDisplay = _interopRequireDefault(require("../AssetDisplay"));
|
||||||
|
|
||||||
|
var _AssetInfo = _interopRequireDefault(require("../AssetInfo"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var ShowAssetDetails =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function ShowAssetDetails() {
|
||||||
|
_classCallCheck(this, ShowAssetDetails);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(ShowAssetDetails).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(ShowAssetDetails, [{
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var asset = this.props.asset;
|
||||||
|
|
||||||
|
if (asset) {
|
||||||
|
var name = asset.claimData.name;
|
||||||
|
return _react.default.createElement("div", null, _react.default.createElement(_SEO.default, {
|
||||||
|
pageTitle: "".concat(name, " - details"),
|
||||||
|
asset: asset
|
||||||
|
}), _react.default.createElement(_NavBar.default, null), _react.default.createElement("div", {
|
||||||
|
className: "row row--tall row--padded"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--10"
|
||||||
|
}, _react.default.createElement(_AssetTitle.default, null)), _react.default.createElement("div", {
|
||||||
|
className: "column column--5 column--sml-10 align-content-top"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "row row--padded show-details-container"
|
||||||
|
}, _react.default.createElement(_AssetDisplay.default, null))), _react.default.createElement("div", {
|
||||||
|
className: "column column--5 column--sml-10 align-content-top"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "row row--padded"
|
||||||
|
}, _react.default.createElement(_AssetInfo.default, null)))));
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
return _react.default.createElement(_ErrorPage.default, {
|
||||||
|
error: 'loading asset data...'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(ShowAssetDetails, _React$Component);
|
||||||
|
|
||||||
|
return ShowAssetDetails;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = ShowAssetDetails;
|
||||||
|
exports.default = _default;
|
38
client/build/containers/ShowAssetLite/index.js
Normal file
38
client/build/containers/ShowAssetLite/index.js
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var show = _ref.show;
|
||||||
|
// select request info
|
||||||
|
var requestId = show.request.id; // select asset info
|
||||||
|
|
||||||
|
var asset;
|
||||||
|
var request = show.requestList[requestId] || null;
|
||||||
|
var assetList = show.assetList;
|
||||||
|
|
||||||
|
if (request && assetList) {
|
||||||
|
var assetKey = request.key; // note: just store this in the request
|
||||||
|
|
||||||
|
asset = assetList[assetKey] || null;
|
||||||
|
}
|
||||||
|
|
||||||
|
; // return props
|
||||||
|
|
||||||
|
return {
|
||||||
|
asset: asset
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
79
client/build/containers/ShowAssetLite/view.js
Normal file
79
client/build/containers/ShowAssetLite/view.js
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _reactRouterDom = require("react-router-dom");
|
||||||
|
|
||||||
|
var _SEO = _interopRequireDefault(require("@components/SEO"));
|
||||||
|
|
||||||
|
var _AssetDisplay = _interopRequireDefault(require("../AssetDisplay"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var ShowLite =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function ShowLite() {
|
||||||
|
_classCallCheck(this, ShowLite);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(ShowLite).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(ShowLite, [{
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var asset = this.props.asset;
|
||||||
|
|
||||||
|
if (asset) {
|
||||||
|
var _asset$claimData = asset.claimData,
|
||||||
|
name = _asset$claimData.name,
|
||||||
|
claimId = _asset$claimData.claimId;
|
||||||
|
return _react.default.createElement("div", {
|
||||||
|
className: "row row--tall flex-container--column flex-container--center-center show-lite-container"
|
||||||
|
}, _react.default.createElement(_SEO.default, {
|
||||||
|
pageTitle: name,
|
||||||
|
asset: asset
|
||||||
|
}), _react.default.createElement(_AssetDisplay.default, null), _react.default.createElement(_reactRouterDom.Link, {
|
||||||
|
id: "asset-boilerpate",
|
||||||
|
className: "link--primary fine-print",
|
||||||
|
to: "/".concat(claimId, "/").concat(name)
|
||||||
|
}, "hosted via Spee.ch"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return _react.default.createElement("div", {
|
||||||
|
className: "row row--tall row--padded flex-container--column flex-container--center-center"
|
||||||
|
}, _react.default.createElement("p", null, "loading asset data..."));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(ShowLite, _React$Component);
|
||||||
|
|
||||||
|
return ShowLite;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = ShowLite;
|
||||||
|
exports.default = _default;
|
35
client/build/containers/ShowChannel/index.js
Normal file
35
client/build/containers/ShowChannel/index.js
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var show = _ref.show;
|
||||||
|
// select request info
|
||||||
|
var requestId = show.request.id; // select request
|
||||||
|
|
||||||
|
var previousRequest = show.requestList[requestId] || null; // select channel
|
||||||
|
|
||||||
|
var channel;
|
||||||
|
|
||||||
|
if (previousRequest) {
|
||||||
|
var channelKey = previousRequest.key;
|
||||||
|
channel = show.channelList[channelKey] || null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
channel: channel
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
86
client/build/containers/ShowChannel/view.js
Normal file
86
client/build/containers/ShowChannel/view.js
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _SEO = _interopRequireDefault(require("@components/SEO"));
|
||||||
|
|
||||||
|
var _ErrorPage = _interopRequireDefault(require("@pages/ErrorPage"));
|
||||||
|
|
||||||
|
var _NavBar = _interopRequireDefault(require("../NavBar"));
|
||||||
|
|
||||||
|
var _ChannelClaimsDisplay = _interopRequireDefault(require("../ChannelClaimsDisplay"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var ShowChannel =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function ShowChannel() {
|
||||||
|
_classCallCheck(this, ShowChannel);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(ShowChannel).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(ShowChannel, [{
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var channel = this.props.channel;
|
||||||
|
|
||||||
|
if (channel) {
|
||||||
|
var name = channel.name,
|
||||||
|
longId = channel.longId,
|
||||||
|
shortId = channel.shortId;
|
||||||
|
return _react.default.createElement("div", null, _react.default.createElement(_SEO.default, {
|
||||||
|
pageTitle: name,
|
||||||
|
channel: channel
|
||||||
|
}), _react.default.createElement(_NavBar.default, null), _react.default.createElement("div", {
|
||||||
|
className: "row row--tall row--padded"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--10"
|
||||||
|
}, _react.default.createElement("h2", null, "channel name: ", name), _react.default.createElement("p", {
|
||||||
|
className: 'fine-print'
|
||||||
|
}, "full channel id: ", longId), _react.default.createElement("p", {
|
||||||
|
className: 'fine-print'
|
||||||
|
}, "short channel id: ", shortId)), _react.default.createElement("div", {
|
||||||
|
className: "column column--10"
|
||||||
|
}, _react.default.createElement(_ChannelClaimsDisplay.default, null))));
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
return _react.default.createElement(_ErrorPage.default, {
|
||||||
|
error: 'loading channel data...'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(ShowChannel, _React$Component);
|
||||||
|
|
||||||
|
return ShowChannel;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = ShowChannel;
|
||||||
|
exports.default = _default;
|
103
client/build/pages/AboutPage/index.js
Normal file
103
client/build/pages/AboutPage/index.js
Normal file
|
@ -0,0 +1,103 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _SEO = _interopRequireDefault(require("@components/SEO"));
|
||||||
|
|
||||||
|
var _NavBar = _interopRequireDefault(require("@containers/NavBar"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var AboutPage =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function AboutPage() {
|
||||||
|
_classCallCheck(this, AboutPage);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(AboutPage).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(AboutPage, [{
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
return _react.default.createElement("div", null, _react.default.createElement(_SEO.default, {
|
||||||
|
pageTitle: 'About',
|
||||||
|
pageUri: 'about'
|
||||||
|
}), _react.default.createElement(_NavBar.default, null), _react.default.createElement("div", {
|
||||||
|
className: "row row--padded"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--5 column--med-10 align-content-top"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--8 column--med-10"
|
||||||
|
}, _react.default.createElement("p", {
|
||||||
|
className: "pull-quote"
|
||||||
|
}, "Spee.ch is an open-source project. Please contribute to the existing site, or fork it and make your own."), _react.default.createElement("p", null, _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
target: "_blank",
|
||||||
|
href: "https://twitter.com/spee_ch"
|
||||||
|
}, "TWITTER")), _react.default.createElement("p", null, _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
target: "_blank",
|
||||||
|
href: "https://github.com/lbryio/spee.ch"
|
||||||
|
}, "GITHUB")), _react.default.createElement("p", null, _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
target: "_blank",
|
||||||
|
href: "https://discord.gg/YjYbwhS"
|
||||||
|
}, "DISCORD CHANNEL")), _react.default.createElement("p", null, _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
target: "_blank",
|
||||||
|
href: "https://github.com/lbryio/spee.ch/blob/master/README.md"
|
||||||
|
}, "DOCUMENTATION")))), _react.default.createElement("div", {
|
||||||
|
className: "column column--5 column--med-10 align-content-top"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--8 column--med-10"
|
||||||
|
}, _react.default.createElement("p", null, "Spee.ch is a media-hosting site that reads from and publishes content to the ", _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
href: "https://lbry.io"
|
||||||
|
}, "LBRY"), " blockchain."), _react.default.createElement("p", null, "Spee.ch is a hosting service, but with the added benefit that it stores your content on a decentralized network of computers -- the ", _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
href: "https://lbry.io/get"
|
||||||
|
}, "LBRY"), " network. This means that your images are stored in multiple locations without a single point of failure."), _react.default.createElement("h3", null, "Contribute"), _react.default.createElement("p", null, "If you have an idea for your own spee.ch-like site on top of LBRY, fork our ", _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
href: "https://github.com/lbryio/spee.ch"
|
||||||
|
}, "github repo"), " and go to town!"), _react.default.createElement("p", null, "If you want to improve spee.ch, join our ", _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
href: "https://chat.lbry.io"
|
||||||
|
}, "discord channel"), " or solve one of our ", _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
href: "https://github.com/lbryio/spee.ch/issues"
|
||||||
|
}, "github issues"), ".")))));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(AboutPage, _React$Component);
|
||||||
|
|
||||||
|
return AboutPage;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = AboutPage;
|
||||||
|
exports.default = _default;
|
63
client/build/pages/ErrorPage/index.js
Normal file
63
client/build/pages/ErrorPage/index.js
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
||||||
|
|
||||||
|
var _NavBar = _interopRequireDefault(require("@containers/NavBar"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var ErrorPage =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function ErrorPage() {
|
||||||
|
_classCallCheck(this, ErrorPage);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(ErrorPage).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(ErrorPage, [{
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var error = this.props.error;
|
||||||
|
return _react.default.createElement("div", null, _react.default.createElement(_NavBar.default, null), _react.default.createElement("div", {
|
||||||
|
className: "row row--padded"
|
||||||
|
}, _react.default.createElement("p", null, error)));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(ErrorPage, _React$Component);
|
||||||
|
|
||||||
|
return ErrorPage;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
ErrorPage.propTypes = {
|
||||||
|
error: _propTypes.default.string.isRequired
|
||||||
|
};
|
||||||
|
var _default = ErrorPage;
|
||||||
|
exports.default = _default;
|
26
client/build/pages/FourOhFourPage/index.js
Normal file
26
client/build/pages/FourOhFourPage/index.js
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var _ref$site = _ref.site,
|
||||||
|
host = _ref$site.host,
|
||||||
|
title = _ref$site.title;
|
||||||
|
return {
|
||||||
|
host: host,
|
||||||
|
title: title
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
65
client/build/pages/FourOhFourPage/view.js
Normal file
65
client/build/pages/FourOhFourPage/view.js
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _reactHelmet = _interopRequireDefault(require("react-helmet"));
|
||||||
|
|
||||||
|
var _index = _interopRequireDefault(require("@containers/NavBar/index"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var FourOhForPage =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function FourOhForPage() {
|
||||||
|
_classCallCheck(this, FourOhForPage);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(FourOhForPage).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(FourOhForPage, [{
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var _this$props = this.props,
|
||||||
|
title = _this$props.title,
|
||||||
|
host = _this$props.host;
|
||||||
|
return _react.default.createElement("div", null, _react.default.createElement(_reactHelmet.default, null, _react.default.createElement("title", null, title, " - 404"), _react.default.createElement("link", {
|
||||||
|
rel: "canonical",
|
||||||
|
href: "".concat(host, "/404")
|
||||||
|
})), _react.default.createElement(_index.default, null), _react.default.createElement("div", {
|
||||||
|
className: "row row--padded"
|
||||||
|
}, _react.default.createElement("h2", null, "404"), _react.default.createElement("p", null, "That page does not exist")));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(FourOhForPage, _React$Component);
|
||||||
|
|
||||||
|
return FourOhForPage;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = FourOhForPage;
|
||||||
|
exports.default = _default;
|
63
client/build/pages/HomePage/index.js
Normal file
63
client/build/pages/HomePage/index.js
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _SEO = _interopRequireDefault(require("@components/SEO"));
|
||||||
|
|
||||||
|
var _NavBar = _interopRequireDefault(require("@containers/NavBar"));
|
||||||
|
|
||||||
|
var _PublishTool = _interopRequireDefault(require("@containers/PublishTool"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var HomePage =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function HomePage() {
|
||||||
|
_classCallCheck(this, HomePage);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(HomePage).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(HomePage, [{
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
return _react.default.createElement("div", {
|
||||||
|
className: 'row row--tall flex-container--column'
|
||||||
|
}, _react.default.createElement(_SEO.default, null), _react.default.createElement(_NavBar.default, null), _react.default.createElement("div", {
|
||||||
|
className: 'row row--tall row--padded flex-container--column'
|
||||||
|
}, _react.default.createElement(_PublishTool.default, null)));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(HomePage, _React$Component);
|
||||||
|
|
||||||
|
return HomePage;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = HomePage;
|
||||||
|
exports.default = _default;
|
23
client/build/pages/LoginPage/index.js
Normal file
23
client/build/pages/LoginPage/index.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var channel = _ref.channel;
|
||||||
|
return {
|
||||||
|
loggedInChannelName: channel.loggedInChannel.name
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
98
client/build/pages/LoginPage/view.js
Normal file
98
client/build/pages/LoginPage/view.js
Normal file
|
@ -0,0 +1,98 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _reactRouterDom = require("react-router-dom");
|
||||||
|
|
||||||
|
var _SEO = _interopRequireDefault(require("@components/SEO"));
|
||||||
|
|
||||||
|
var _NavBar = _interopRequireDefault(require("@containers/NavBar"));
|
||||||
|
|
||||||
|
var _ChannelLoginForm = _interopRequireDefault(require("@containers/ChannelLoginForm"));
|
||||||
|
|
||||||
|
var _ChannelCreateForm = _interopRequireDefault(require("@containers/ChannelCreateForm"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var LoginPage =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function LoginPage() {
|
||||||
|
_classCallCheck(this, LoginPage);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(LoginPage).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(LoginPage, [{
|
||||||
|
key: "componentWillReceiveProps",
|
||||||
|
value: function componentWillReceiveProps(newProps) {
|
||||||
|
// re-route the user to the homepage if the user is logged in
|
||||||
|
if (newProps.loggedInChannelName !== this.props.loggedInChannelName) {
|
||||||
|
this.props.history.push("/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
return _react.default.createElement("div", null, _react.default.createElement(_SEO.default, {
|
||||||
|
pageTitle: 'Login',
|
||||||
|
pageUri: 'login'
|
||||||
|
}), _react.default.createElement(_NavBar.default, null), _react.default.createElement("div", {
|
||||||
|
className: "row row--padded"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--5 column--med-10 align-content-top"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--8 column--med-10"
|
||||||
|
}, _react.default.createElement("p", null, "Channels allow you to publish and group content under an identity. You can create a channel for yourself, or share one with like-minded friends. You can create 1 channel, or 100, so whether you're ", _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
target: "_blank",
|
||||||
|
href: "/@catalonia2017:43dcf47163caa21d8404d9fe9b30f78ef3e146a8"
|
||||||
|
}, "documenting important events"), ", or making a public repository for ", _react.default.createElement("a", {
|
||||||
|
className: "link--primary",
|
||||||
|
target: "_blank",
|
||||||
|
href: "/@catGifs"
|
||||||
|
}, "cat gifs"), " (password: '1234'), try creating a channel for it!"))), _react.default.createElement("div", {
|
||||||
|
className: "column column--5 column--med-10 align-content-top"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--8 column--med-10"
|
||||||
|
}, _react.default.createElement("h3", {
|
||||||
|
className: "h3--no-bottom"
|
||||||
|
}, "Log in to an existing channel:"), _react.default.createElement(_ChannelLoginForm.default, null), _react.default.createElement("h3", {
|
||||||
|
className: "h3--no-bottom"
|
||||||
|
}, "Create a brand new channel:"), _react.default.createElement(_ChannelCreateForm.default, null)))));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(LoginPage, _React$Component);
|
||||||
|
|
||||||
|
return LoginPage;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
var _default = (0, _reactRouterDom.withRouter)(LoginPage);
|
||||||
|
|
||||||
|
exports.default = _default;
|
99
client/build/pages/MultisitePage/index.js
Normal file
99
client/build/pages/MultisitePage/index.js
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _SEO = _interopRequireDefault(require("@components/SEO"));
|
||||||
|
|
||||||
|
var _NavBar = _interopRequireDefault(require("@containers/NavBar"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var MultisitePage =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function MultisitePage() {
|
||||||
|
_classCallCheck(this, MultisitePage);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(MultisitePage).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(MultisitePage, [{
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
return _react.default.createElement("div", null, _react.default.createElement(_SEO.default, {
|
||||||
|
pageTitle: 'Multisite',
|
||||||
|
pageUri: 'multisite'
|
||||||
|
}), _react.default.createElement(_NavBar.default, null), _react.default.createElement("div", {
|
||||||
|
className: "row row--padded flex-container--row flex-container--center-center"
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: "column column--8 column--med-10"
|
||||||
|
}, _react.default.createElement("p", {
|
||||||
|
className: "pull-quote"
|
||||||
|
}, "Introducing Spee.ch Multisite"), _react.default.createElement("p", null, "Hi there! My name is ", _react.default.createElement("a", {
|
||||||
|
href: 'https://github.com/billbitt',
|
||||||
|
target: '_blank'
|
||||||
|
}, "Bill"), ", and I\u2019d like to speak with you about Spee.ch. No, not \u2018speech,\u2019 \u2018", _react.default.createElement("i", null, _react.default.createElement("a", {
|
||||||
|
href: 'https://spee.ch',
|
||||||
|
target: '_blank'
|
||||||
|
}, "Spee.ch.")), "\u2019 You know what, just read on..."), _react.default.createElement("h2", null, "A Little Background"), _react.default.createElement("p", null, "Wow, time flies! A little over a year ago Spee.ch was nothing more than a glimmer in the eye of LBRY CEO Jeremy Kaufman. At that time, the ", _react.default.createElement("a", {
|
||||||
|
href: 'https://lbry.io/faq/what-is-lbry',
|
||||||
|
target: '_blank'
|
||||||
|
}, "LBRY protocol"), " was still so early in its development, that there were no web-based applications for interacting with the LBRY blockchain. But then, something beautiful happened. On March 29th, 2017, Jeremy sat down with Jack, and together they ", _react.default.createElement("a", {
|
||||||
|
href: 'https://www.youtube.com/watch?v=C9LCapt_OYw',
|
||||||
|
target: '_blank'
|
||||||
|
}, "live coded a single-page PHP site"), " that could publish images to the LBRY network. And just like that, Spee.ch was born!"), _react.default.createElement("p", null, "Being that LBRY is an open source project, Jeremy ended the session by inviting community members who were interested in the project to take the reigns and see where Spee.ch could go. I was one of the devs that did just that, and it wasn\u2019t long before I was on a weekly call dedicated to this project with contributors from around the world."), _react.default.createElement("p", null, "At this point in time, the vision for Spee.ch was pretty simple: create a web-based hosting service that used the LBRY network as a database for free image and video sharing. In other words, an \u2018imgur on the blockchain.\u2019"), _react.default.createElement("h2", null, "Growth"), _react.default.createElement("p", null, "You might be wondering, \u201CSo, what has the Spee.ch team been doing since then?\u201D. Well, that is a great question. I\u2019m glad you asked."), _react.default.createElement("p", null, "As it turned out, the initial single-serving site was only the beginning. We wanted to add more features, improve user experience, and continue to rapidly innovate on new ideas to explore what web-based image-hosting on the blockchain could look like. And now -- a couple of re-designs, ", _react.default.createElement("a", {
|
||||||
|
href: 'https://github.com/lbryio/spee.ch',
|
||||||
|
target: '_blank'
|
||||||
|
}, "1,428 commits"), ", and ", _react.default.createElement("a", {
|
||||||
|
href: 'https://github.com/lbryio/spee.ch/graphs/contributors',
|
||||||
|
target: '_blank'
|
||||||
|
}, "18 contributors"), " later (as of the time of this writing) -- we\u2019ve been through a lot of changes. We changed the URL scheme, switched out the PHP for Javascript (sorry Jeremy!), added more HTML pages, removed those HTML pages, added Handlebars, removed most of Handlebars, added React, and... you get the picture."), _react.default.createElement("p", null, "It\u2019s been a lot of work, and through all of these changes, we have been guided by our original vision: develop a free web app that allows users to share images and video using a blockchain."), _react.default.createElement("p", null, "However, we ask ourselves constantly: what else can we be doing? What can we be doing differently? What features can we be doing better? And it is those kinds of questions that lead us to this post."), _react.default.createElement("h2", null, "A New Initiative"), _react.default.createElement("p", null, "As Spee.ch developed, we were lucky to find an amazing community spring up around the project that contributed bug reports, bug fixes, feature requests, pull requests, etc., but ultimately we are limited by the hours we have in the day, and while some requests get prioritized, others get shelved. "), _react.default.createElement("p", null, "So we started wondering: What if instead of having the community help us build our platform, we started helping them build theirs? We started mulling this over, and the more we thought about it the more we liked it. And thus, Spee.ch Multisite was born."), _react.default.createElement("h2", null, "Spee.ch Multisite"), _react.default.createElement("p", null, "The vision for Spee.ch Multisite is to maintain a foundational codebase that will support a greater variety of content-sharing web apps built on LBRY, allowing these apps to publish and retrieve content from the network via the blockchain."), _react.default.createElement("h3", null, "Run Your Own Spee.ch!"), _react.default.createElement("p", null, "Ok, here\u2019s the tl:dr: the purpose of the Spee.ch Multisite initiative is to enable you to run your own version of Spee.ch."), _react.default.createElement("p", null, "Spee.ch Multisite will provide a helpful set of basic code to get you going, but we purposefully want to give you control and provide a sandbox in which you can develop the look, content, and features for your site. The shared code base will be developed to support you in that quest. "), _react.default.createElement("p", null, "So if you don\u2019t want your site called or looking anything like Spee.ch, we encourage that! Don\u2019t hesitate to make it your own!"), _react.default.createElement("h3", null, "For the Community by the Community"), _react.default.createElement("p", null, "Initially, sites built on Spee.ch Multisite will look a lot like Spee.ch, but you will be able to add custom pages, update the look of components, and limit the content on your spee.ch site as you see fit."), _react.default.createElement("p", null, "Over time, it is our hope that the project will grow to incorporate many more components and features developed by us and the community to support a wide variety of functionalities beyond what the current spee.ch site is capable of."), _react.default.createElement("h3", null, "A Common Codebase"), _react.default.createElement("p", null, "If you have been following the project, you may have already noticed that the original github repository has grown into two: ", _react.default.createElement("a", {
|
||||||
|
href: 'https://github.com/lbryio/www.spee.ch',
|
||||||
|
target: '_blank'
|
||||||
|
}, "www.spee.ch"), " and ", _react.default.createElement("a", {
|
||||||
|
href: 'https://github.com/lbryio/spee.ch',
|
||||||
|
target: '_blank'
|
||||||
|
}, "spee.ch"), ". I will save the specifics for a future tech-focused blog post in the coming weeks, but the reason for these changes is to modularise the code so that is it easier for anyone who wants to run their own version of Spee.ch to do so, and to be able to customize their Spee.ch to their liking."), _react.default.createElement("h3", null, "What About the Flagship Spee.ch Site?"), _react.default.createElement("p", null, "Don\u2019t worry! If you like using ", _react.default.createElement("a", {
|
||||||
|
href: 'https://spee.ch',
|
||||||
|
target: '_blank'
|
||||||
|
}, "Spee.ch"), " and have no intention of running your own site, we will still be here running it for you! We are dedicated to pushing it forward and using it as patient zero for all additions to the Spee.ch Multisite codebase."), _react.default.createElement("h2", null, "Join Us"), _react.default.createElement("p", null, "Friday, May 18, we will be hosting a live demo showcasing the alpha version of Spee.ch Multisite. It\u2019s still quite young, but that\u2019s the point: we want to realize this vision together."), _react.default.createElement("p", null, _react.default.createElement("b", null, _react.default.createElement("a", {
|
||||||
|
href: 'https://speech.rsvpify.com/',
|
||||||
|
target: '_blank'
|
||||||
|
}, "CLICK HERE TO RSVP!"))), _react.default.createElement("p", null, "At this first demonstration, we will walk through preparing a server environment, installing LBRY and Spee.ch, and how to make local changes to your Spee.ch instance. Details below:"), _react.default.createElement("ul", null, _react.default.createElement("li", null, "When: Friday, May 18, 2018"), _react.default.createElement("li", null, "Time: 5:00 p.m. PST"), _react.default.createElement("li", null, "Where: Google Hangouts"), _react.default.createElement("li", null, "Link: ", _react.default.createElement("a", {
|
||||||
|
href: 'https://meet.google.com/aex-ghqg-kcs',
|
||||||
|
target: '_blank'
|
||||||
|
}, "meet.google.com/aex-ghqg-kcs")), _react.default.createElement("li", null, "System Requirements: If you have a server, please make sure you have MySql, Node and NPM installed. If you need help installing the above, or if you need a server to run your own instance on, please join the Hangout 30 minutes ahead of time and we will help get you set up =]"), _react.default.createElement("li", null, "Questions: hello@lbry.io")))));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(MultisitePage, _React$Component);
|
||||||
|
|
||||||
|
return MultisitePage;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = MultisitePage;
|
||||||
|
exports.default = _default;
|
30
client/build/pages/ShowPage/index.js
Normal file
30
client/build/pages/ShowPage/index.js
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
|
var _show = require("../../actions/show");
|
||||||
|
|
||||||
|
var _view = _interopRequireDefault(require("./view"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var mapStateToProps = function mapStateToProps(_ref) {
|
||||||
|
var show = _ref.show;
|
||||||
|
return {
|
||||||
|
error: show.request.error,
|
||||||
|
requestType: show.request.type
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var mapDispatchToProps = {
|
||||||
|
onHandleShowPageUri: _show.onHandleShowPageUri
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view.default);
|
||||||
|
|
||||||
|
exports.default = _default;
|
97
client/build/pages/ShowPage/view.js
Normal file
97
client/build/pages/ShowPage/view.js
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _ErrorPage = _interopRequireDefault(require("@pages/ErrorPage"));
|
||||||
|
|
||||||
|
var _ShowAssetLite = _interopRequireDefault(require("@containers/ShowAssetLite"));
|
||||||
|
|
||||||
|
var _ShowAssetDetails = _interopRequireDefault(require("@containers/ShowAssetDetails"));
|
||||||
|
|
||||||
|
var _ShowChannel = _interopRequireDefault(require("@containers/ShowChannel"));
|
||||||
|
|
||||||
|
var _show_request_types = require("../../constants/show_request_types");
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var ShowPage =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function ShowPage() {
|
||||||
|
_classCallCheck(this, ShowPage);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(ShowPage).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(ShowPage, [{
|
||||||
|
key: "componentDidMount",
|
||||||
|
value: function componentDidMount() {
|
||||||
|
this.props.onHandleShowPageUri(this.props.match.params);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "componentWillReceiveProps",
|
||||||
|
value: function componentWillReceiveProps(nextProps) {
|
||||||
|
if (nextProps.match.params !== this.props.match.params) {
|
||||||
|
this.props.onHandleShowPageUri(nextProps.match.params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
var _this$props = this.props,
|
||||||
|
error = _this$props.error,
|
||||||
|
requestType = _this$props.requestType;
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
return _react.default.createElement(_ErrorPage.default, {
|
||||||
|
error: error
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (requestType) {
|
||||||
|
case _show_request_types.CHANNEL:
|
||||||
|
return _react.default.createElement(_ShowChannel.default, null);
|
||||||
|
|
||||||
|
case _show_request_types.ASSET_LITE:
|
||||||
|
return _react.default.createElement(_ShowAssetLite.default, null);
|
||||||
|
|
||||||
|
case _show_request_types.ASSET_DETAILS:
|
||||||
|
return _react.default.createElement(_ShowAssetDetails.default, null);
|
||||||
|
|
||||||
|
default:
|
||||||
|
return _react.default.createElement("p", null, "loading...");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(ShowPage, _React$Component);
|
||||||
|
|
||||||
|
return ShowPage;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
;
|
||||||
|
var _default = ShowPage;
|
||||||
|
exports.default = _default;
|
33
client/build/reducers/channel.js
Normal file
33
client/build/reducers/channel.js
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = _default;
|
||||||
|
|
||||||
|
var actions = _interopRequireWildcard(require("../constants/channel_action_types"));
|
||||||
|
|
||||||
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||||
|
|
||||||
|
var initialState = {
|
||||||
|
loggedInChannel: {
|
||||||
|
name: null,
|
||||||
|
shortId: null,
|
||||||
|
longId: null
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function _default() {
|
||||||
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
||||||
|
var action = arguments.length > 1 ? arguments[1] : undefined;
|
||||||
|
|
||||||
|
switch (action.type) {
|
||||||
|
case actions.CHANNEL_UPDATE:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
loggedInChannel: action.data
|
||||||
|
});
|
||||||
|
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
49
client/build/reducers/channelCreate.js
Normal file
49
client/build/reducers/channelCreate.js
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = _default;
|
||||||
|
|
||||||
|
var actions = _interopRequireWildcard(require("../constants/channel_create_action_types"));
|
||||||
|
|
||||||
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||||
|
|
||||||
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||||
|
|
||||||
|
var initialState = {
|
||||||
|
name: {
|
||||||
|
value: '',
|
||||||
|
error: ''
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
value: '',
|
||||||
|
error: ''
|
||||||
|
},
|
||||||
|
status: null
|
||||||
|
};
|
||||||
|
|
||||||
|
function _default() {
|
||||||
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
||||||
|
var action = arguments.length > 1 ? arguments[1] : undefined;
|
||||||
|
|
||||||
|
switch (action.type) {
|
||||||
|
case actions.CHANNEL_CREATE_UPDATE_NAME:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
name: Object.assign({}, state.name, _defineProperty({}, action.data.name, action.data.value))
|
||||||
|
});
|
||||||
|
|
||||||
|
case actions.CHANNEL_CREATE_UPDATE_PASSWORD:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
password: Object.assign({}, state.password, _defineProperty({}, action.data.name, action.data.value))
|
||||||
|
});
|
||||||
|
|
||||||
|
case actions.CHANNEL_CREATE_UPDATE_STATUS:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
status: action.data
|
||||||
|
});
|
||||||
|
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
33
client/build/reducers/index.js
Normal file
33
client/build/reducers/index.js
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _redux = require("redux");
|
||||||
|
|
||||||
|
var _publish = _interopRequireDefault(require("./publish"));
|
||||||
|
|
||||||
|
var _channel = _interopRequireDefault(require("./channel"));
|
||||||
|
|
||||||
|
var _show = _interopRequireDefault(require("./show"));
|
||||||
|
|
||||||
|
var _site = _interopRequireDefault(require("./site"));
|
||||||
|
|
||||||
|
var _channelCreate = _interopRequireDefault(require("./channelCreate"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var customizedReducers = function customizedReducers(siteConfig) {
|
||||||
|
return (0, _redux.combineReducers)({
|
||||||
|
channel: _channel.default,
|
||||||
|
channelCreate: _channelCreate.default,
|
||||||
|
publish: (0, _publish.default)(siteConfig),
|
||||||
|
show: _show.default,
|
||||||
|
site: (0, _site.default)(siteConfig)
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = customizedReducers;
|
||||||
|
exports.default = _default;
|
121
client/build/reducers/publish.js
Normal file
121
client/build/reducers/publish.js
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var actions = _interopRequireWildcard(require("../constants/publish_action_types"));
|
||||||
|
|
||||||
|
var _publish_channel_select_states = require("../constants/publish_channel_select_states");
|
||||||
|
|
||||||
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||||
|
|
||||||
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||||
|
|
||||||
|
var customizedPublishReducer = function customizedPublishReducer(siteConfig) {
|
||||||
|
// parse inputs
|
||||||
|
var disabledConfig = false;
|
||||||
|
var disabledMessageConfig = 'none';
|
||||||
|
var thumbnailChannel = '';
|
||||||
|
var thumbnailChannelId = '';
|
||||||
|
|
||||||
|
if (siteConfig) {
|
||||||
|
if (siteConfig.publishing) {
|
||||||
|
disabledConfig = siteConfig.publishing.disabled;
|
||||||
|
disabledMessageConfig = siteConfig.publishing.disabledMessage;
|
||||||
|
thumbnailChannel = siteConfig.publishing.thumbnailChannel;
|
||||||
|
thumbnailChannelId = siteConfig.publishing.thumbnailChannelId;
|
||||||
|
}
|
||||||
|
} // create initial state
|
||||||
|
|
||||||
|
|
||||||
|
var initialState = {
|
||||||
|
disabled: disabledConfig,
|
||||||
|
disabledMessage: disabledMessageConfig,
|
||||||
|
publishInChannel: false,
|
||||||
|
selectedChannel: _publish_channel_select_states.LOGIN,
|
||||||
|
showMetadataInputs: false,
|
||||||
|
status: {
|
||||||
|
status: null,
|
||||||
|
message: null
|
||||||
|
},
|
||||||
|
error: {
|
||||||
|
file: null,
|
||||||
|
url: null,
|
||||||
|
channel: null
|
||||||
|
},
|
||||||
|
file: null,
|
||||||
|
claim: '',
|
||||||
|
metadata: {
|
||||||
|
title: '',
|
||||||
|
description: '',
|
||||||
|
license: '',
|
||||||
|
nsfw: false
|
||||||
|
},
|
||||||
|
thumbnail: null,
|
||||||
|
thumbnailChannel: thumbnailChannel,
|
||||||
|
thumbnailChannelId: thumbnailChannelId
|
||||||
|
};
|
||||||
|
return function () {
|
||||||
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
||||||
|
var action = arguments.length > 1 ? arguments[1] : undefined;
|
||||||
|
|
||||||
|
switch (action.type) {
|
||||||
|
case actions.FILE_SELECTED:
|
||||||
|
return Object.assign({}, initialState, {
|
||||||
|
// note: clears to initial state
|
||||||
|
file: action.data
|
||||||
|
});
|
||||||
|
|
||||||
|
case actions.FILE_CLEAR:
|
||||||
|
return initialState;
|
||||||
|
|
||||||
|
case actions.METADATA_UPDATE:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
metadata: Object.assign({}, state.metadata, _defineProperty({}, action.data.name, action.data.value))
|
||||||
|
});
|
||||||
|
|
||||||
|
case actions.CLAIM_UPDATE:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
claim: action.data
|
||||||
|
});
|
||||||
|
|
||||||
|
case actions.SET_PUBLISH_IN_CHANNEL:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
publishInChannel: action.channel
|
||||||
|
});
|
||||||
|
|
||||||
|
case actions.PUBLISH_STATUS_UPDATE:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
status: action.data
|
||||||
|
});
|
||||||
|
|
||||||
|
case actions.ERROR_UPDATE:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
error: Object.assign({}, state.error, _defineProperty({}, action.data.name, action.data.value))
|
||||||
|
});
|
||||||
|
|
||||||
|
case actions.SELECTED_CHANNEL_UPDATE:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
selectedChannel: action.data
|
||||||
|
});
|
||||||
|
|
||||||
|
case actions.TOGGLE_METADATA_INPUTS:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
showMetadataInputs: action.data
|
||||||
|
});
|
||||||
|
|
||||||
|
case actions.THUMBNAIL_NEW:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
thumbnail: action.data
|
||||||
|
});
|
||||||
|
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = customizedPublishReducer;
|
||||||
|
exports.default = _default;
|
110
client/build/reducers/show.js
Normal file
110
client/build/reducers/show.js
Normal file
|
@ -0,0 +1,110 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = _default;
|
||||||
|
|
||||||
|
var actions = _interopRequireWildcard(require("../constants/show_action_types"));
|
||||||
|
|
||||||
|
var _asset_display_states = require("../constants/asset_display_states");
|
||||||
|
|
||||||
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||||
|
|
||||||
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||||
|
|
||||||
|
var initialState = {
|
||||||
|
request: {
|
||||||
|
error: null,
|
||||||
|
type: null,
|
||||||
|
id: null
|
||||||
|
},
|
||||||
|
requestList: {},
|
||||||
|
channelList: {},
|
||||||
|
assetList: {},
|
||||||
|
displayAsset: {
|
||||||
|
error: null,
|
||||||
|
status: _asset_display_states.LOCAL_CHECK
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function _default() {
|
||||||
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
||||||
|
var action = arguments.length > 1 ? arguments[1] : undefined;
|
||||||
|
|
||||||
|
switch (action.type) {
|
||||||
|
// handle request
|
||||||
|
case actions.REQUEST_ERROR:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
request: Object.assign({}, state.request, {
|
||||||
|
error: action.data
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
case actions.REQUEST_UPDATE:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
request: Object.assign({}, state.request, {
|
||||||
|
type: action.data.requestType,
|
||||||
|
id: action.data.requestId
|
||||||
|
})
|
||||||
|
});
|
||||||
|
// store requests
|
||||||
|
|
||||||
|
case actions.REQUEST_LIST_ADD:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
requestList: Object.assign({}, state.requestList, _defineProperty({}, action.data.id, {
|
||||||
|
error: action.data.error,
|
||||||
|
key: action.data.key
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
// asset data
|
||||||
|
|
||||||
|
case actions.ASSET_ADD:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
assetList: Object.assign({}, state.assetList, _defineProperty({}, action.data.id, {
|
||||||
|
error: action.data.error,
|
||||||
|
name: action.data.name,
|
||||||
|
claimId: action.data.claimId,
|
||||||
|
shortId: action.data.shortId,
|
||||||
|
claimData: action.data.claimData
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
// channel data
|
||||||
|
|
||||||
|
case actions.CHANNEL_ADD:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
channelList: Object.assign({}, state.channelList, _defineProperty({}, action.data.id, {
|
||||||
|
name: action.data.name,
|
||||||
|
longId: action.data.longId,
|
||||||
|
shortId: action.data.shortId,
|
||||||
|
claimsData: action.data.claimsData
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
|
||||||
|
case actions.CHANNEL_CLAIMS_UPDATE_SUCCESS:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
channelList: Object.assign({}, state.channelList, _defineProperty({}, action.data.channelListId, Object.assign({}, state.channelList[action.data.channelListId], {
|
||||||
|
claimsData: action.data.claimsData
|
||||||
|
})))
|
||||||
|
});
|
||||||
|
// display an asset
|
||||||
|
|
||||||
|
case actions.FILE_AVAILABILITY_UPDATE:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
displayAsset: Object.assign({}, state.displayAsset, {
|
||||||
|
status: action.data
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
case actions.DISPLAY_ASSET_ERROR:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
displayAsset: Object.assign({}, state.displayAsset, {
|
||||||
|
error: action.data,
|
||||||
|
status: _asset_display_states.ERROR
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
54
client/build/reducers/site.js
Normal file
54
client/build/reducers/site.js
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var customizedSiteReducer = function customizedSiteReducer(siteConfig) {
|
||||||
|
var initialState = {};
|
||||||
|
|
||||||
|
if (siteConfig) {
|
||||||
|
var googleAnalyticsId = siteConfig.analytics.googleId,
|
||||||
|
_siteConfig$assetDefa = siteConfig.assetDefaults,
|
||||||
|
defaultThumbnail = _siteConfig$assetDefa.thumbnail,
|
||||||
|
defaultDescription = _siteConfig$assetDefa.description,
|
||||||
|
_siteConfig$details = siteConfig.details,
|
||||||
|
description = _siteConfig$details.description,
|
||||||
|
host = _siteConfig$details.host,
|
||||||
|
title = _siteConfig$details.title,
|
||||||
|
twitter = _siteConfig$details.twitter;
|
||||||
|
initialState = {
|
||||||
|
description: description,
|
||||||
|
googleAnalyticsId: googleAnalyticsId,
|
||||||
|
host: host,
|
||||||
|
title: title,
|
||||||
|
twitter: twitter,
|
||||||
|
defaultDescription: defaultDescription,
|
||||||
|
defaultThumbnail: defaultThumbnail
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
initialState = {
|
||||||
|
description: 'default description',
|
||||||
|
googleAnalyticsId: 'default google id',
|
||||||
|
host: 'default host',
|
||||||
|
title: 'default title',
|
||||||
|
twitter: 'default twitter',
|
||||||
|
defaultDescription: 'default description',
|
||||||
|
defaultThumbnail: 'default thumbnail'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return function () {
|
||||||
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
||||||
|
var action = arguments.length > 1 ? arguments[1] : undefined;
|
||||||
|
|
||||||
|
switch (action.type) {
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = customizedSiteReducer;
|
||||||
|
exports.default = _default;
|
82
client/build/sagas/checkForLoggedInChannel.js
Normal file
82
client/build/sagas/checkForLoggedInChannel.js
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.watchChannelLoginCheck = watchChannelLoginCheck;
|
||||||
|
|
||||||
|
var _effects = require("redux-saga/effects");
|
||||||
|
|
||||||
|
var _channel_action_types = require("../constants/channel_action_types");
|
||||||
|
|
||||||
|
var _authApi = require("../api/authApi.js");
|
||||||
|
|
||||||
|
var _publish = require("../actions/publish");
|
||||||
|
|
||||||
|
var _channel = require("../actions/channel");
|
||||||
|
|
||||||
|
var _marked =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(checkForLoggedInChannelSaga),
|
||||||
|
_marked2 =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(watchChannelLoginCheck);
|
||||||
|
|
||||||
|
function checkForLoggedInChannelSaga() {
|
||||||
|
var response, _response, _response$data, channelName, shortChannelId, channelClaimId;
|
||||||
|
|
||||||
|
return regeneratorRuntime.wrap(function checkForLoggedInChannelSaga$(_context) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context.prev = _context.next) {
|
||||||
|
case 0:
|
||||||
|
_context.prev = 0;
|
||||||
|
_context.next = 3;
|
||||||
|
return (0, _effects.call)(_authApi.checkForLoggedInChannelApi);
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
response = _context.sent;
|
||||||
|
_context.next = 9;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 6:
|
||||||
|
_context.prev = 6;
|
||||||
|
_context.t0 = _context["catch"](0);
|
||||||
|
return _context.abrupt("return", console.log(_context.t0));
|
||||||
|
|
||||||
|
case 9:
|
||||||
|
if (!response.data) {
|
||||||
|
_context.next = 15;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
_response = response, _response$data = _response.data, channelName = _response$data.channelName, shortChannelId = _response$data.shortChannelId, channelClaimId = _response$data.channelClaimId;
|
||||||
|
_context.next = 13;
|
||||||
|
return (0, _effects.put)((0, _publish.updateSelectedChannel)(channelName));
|
||||||
|
|
||||||
|
case 13:
|
||||||
|
_context.next = 15;
|
||||||
|
return (0, _effects.put)((0, _channel.updateLoggedInChannel)(channelName, shortChannelId, channelClaimId));
|
||||||
|
|
||||||
|
case 15:
|
||||||
|
case "end":
|
||||||
|
return _context.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked, this, [[0, 6]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function watchChannelLoginCheck() {
|
||||||
|
return regeneratorRuntime.wrap(function watchChannelLoginCheck$(_context2) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context2.prev = _context2.next) {
|
||||||
|
case 0:
|
||||||
|
_context2.next = 2;
|
||||||
|
return (0, _effects.takeLatest)(_channel_action_types.CHANNEL_LOGIN_CHECK, checkForLoggedInChannelSaga);
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
case "end":
|
||||||
|
return _context2.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked2, this);
|
||||||
|
}
|
134
client/build/sagas/createChannel.js
Normal file
134
client/build/sagas/createChannel.js
Normal file
|
@ -0,0 +1,134 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.watchChannelCreate = watchChannelCreate;
|
||||||
|
|
||||||
|
var _effects = require("redux-saga/effects");
|
||||||
|
|
||||||
|
var _channel_create_action_types = require("../constants/channel_create_action_types");
|
||||||
|
|
||||||
|
var _channelCreate = require("../selectors/channelCreate");
|
||||||
|
|
||||||
|
var _validate = require("../utils/validate");
|
||||||
|
|
||||||
|
var _channelCreate2 = require("../actions/channelCreate");
|
||||||
|
|
||||||
|
var _channelApi = require("../api/channelApi");
|
||||||
|
|
||||||
|
var _channel = require("../actions/channel");
|
||||||
|
|
||||||
|
var _publish = require("../actions/publish");
|
||||||
|
|
||||||
|
var _marked =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(createChannel),
|
||||||
|
_marked2 =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(watchChannelCreate);
|
||||||
|
|
||||||
|
function createChannel() {
|
||||||
|
var _ref, name, password, channelName, shortChannelId, channelClaimId, _ref2;
|
||||||
|
|
||||||
|
return regeneratorRuntime.wrap(function createChannel$(_context) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context.prev = _context.next) {
|
||||||
|
case 0:
|
||||||
|
_context.next = 2;
|
||||||
|
return (0, _effects.select)(_channelCreate.selectChannelCreateState);
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
_ref = _context.sent;
|
||||||
|
name = _ref.name;
|
||||||
|
password = _ref.password;
|
||||||
|
_context.prev = 5;
|
||||||
|
(0, _validate.validateCreateChannelNameInput)(name);
|
||||||
|
_context.next = 14;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 9:
|
||||||
|
_context.prev = 9;
|
||||||
|
_context.t0 = _context["catch"](5);
|
||||||
|
_context.next = 13;
|
||||||
|
return (0, _effects.put)((0, _channelCreate2.updateChannelCreateName)('error', _context.t0.message));
|
||||||
|
|
||||||
|
case 13:
|
||||||
|
return _context.abrupt("return", _context.sent);
|
||||||
|
|
||||||
|
case 14:
|
||||||
|
_context.prev = 14;
|
||||||
|
(0, _validate.validateCreateChannelPasswordInput)(password);
|
||||||
|
_context.next = 23;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 18:
|
||||||
|
_context.prev = 18;
|
||||||
|
_context.t1 = _context["catch"](14);
|
||||||
|
_context.next = 22;
|
||||||
|
return (0, _effects.put)((0, _channelCreate2.updateChannelCreatePassword)('error', _context.t1.message));
|
||||||
|
|
||||||
|
case 22:
|
||||||
|
return _context.abrupt("return", _context.sent);
|
||||||
|
|
||||||
|
case 23:
|
||||||
|
_context.next = 25;
|
||||||
|
return (0, _effects.put)((0, _channelCreate2.updateChannelCreateStatus)('We are publishing your new channel. Sit tight...'));
|
||||||
|
|
||||||
|
case 25:
|
||||||
|
_context.prev = 25;
|
||||||
|
_context.next = 28;
|
||||||
|
return (0, _effects.call)(_channelApi.makeCreateChannelRequest, name.value, password.value);
|
||||||
|
|
||||||
|
case 28:
|
||||||
|
_ref2 = _context.sent;
|
||||||
|
channelName = _ref2.channelName;
|
||||||
|
shortChannelId = _ref2.shortChannelId;
|
||||||
|
channelClaimId = _ref2.channelClaimId;
|
||||||
|
_context.next = 39;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 34:
|
||||||
|
_context.prev = 34;
|
||||||
|
_context.t2 = _context["catch"](25);
|
||||||
|
_context.next = 38;
|
||||||
|
return (0, _effects.put)((0, _channelCreate2.updateChannelCreateStatus)(_context.t2.message));
|
||||||
|
|
||||||
|
case 38:
|
||||||
|
return _context.abrupt("return", _context.sent);
|
||||||
|
|
||||||
|
case 39:
|
||||||
|
_context.next = 41;
|
||||||
|
return (0, _effects.put)((0, _channelCreate2.updateChannelCreateStatus)(null));
|
||||||
|
|
||||||
|
case 41:
|
||||||
|
_context.next = 43;
|
||||||
|
return (0, _effects.put)((0, _channel.updateLoggedInChannel)(channelName, shortChannelId, channelClaimId));
|
||||||
|
|
||||||
|
case 43:
|
||||||
|
_context.next = 45;
|
||||||
|
return (0, _effects.put)((0, _publish.updateSelectedChannel)(channelName));
|
||||||
|
|
||||||
|
case 45:
|
||||||
|
case "end":
|
||||||
|
return _context.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked, this, [[5, 9], [14, 18], [25, 34]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function watchChannelCreate() {
|
||||||
|
return regeneratorRuntime.wrap(function watchChannelCreate$(_context2) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context2.prev = _context2.next) {
|
||||||
|
case 0:
|
||||||
|
_context2.next = 2;
|
||||||
|
return (0, _effects.takeLatest)(_channel_create_action_types.CHANNEL_CREATE, createChannel);
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
case "end":
|
||||||
|
return _context2.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked2, this);
|
||||||
|
}
|
133
client/build/sagas/file.js
Normal file
133
client/build/sagas/file.js
Normal file
|
@ -0,0 +1,133 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.watchFileIsRequested = watchFileIsRequested;
|
||||||
|
|
||||||
|
var _effects = require("redux-saga/effects");
|
||||||
|
|
||||||
|
var actions = _interopRequireWildcard(require("../constants/show_action_types"));
|
||||||
|
|
||||||
|
var _show = require("../actions/show");
|
||||||
|
|
||||||
|
var _asset_display_states = require("../constants/asset_display_states");
|
||||||
|
|
||||||
|
var _fileApi = require("../api/fileApi");
|
||||||
|
|
||||||
|
var _site = require("../selectors/site");
|
||||||
|
|
||||||
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||||
|
|
||||||
|
var _marked =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(retrieveFile),
|
||||||
|
_marked2 =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(watchFileIsRequested);
|
||||||
|
|
||||||
|
function retrieveFile(action) {
|
||||||
|
var name, claimId, host, isAvailable, _ref;
|
||||||
|
|
||||||
|
return regeneratorRuntime.wrap(function retrieveFile$(_context) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context.prev = _context.next) {
|
||||||
|
case 0:
|
||||||
|
name = action.data.name;
|
||||||
|
claimId = action.data.claimId;
|
||||||
|
_context.next = 4;
|
||||||
|
return (0, _effects.select)(_site.selectSiteHost);
|
||||||
|
|
||||||
|
case 4:
|
||||||
|
host = _context.sent;
|
||||||
|
_context.prev = 5;
|
||||||
|
_context.next = 8;
|
||||||
|
return (0, _effects.call)(_fileApi.checkFileAvailability, claimId, host, name);
|
||||||
|
|
||||||
|
case 8:
|
||||||
|
_ref = _context.sent;
|
||||||
|
isAvailable = _ref.data;
|
||||||
|
_context.next = 17;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 12:
|
||||||
|
_context.prev = 12;
|
||||||
|
_context.t0 = _context["catch"](5);
|
||||||
|
_context.next = 16;
|
||||||
|
return (0, _effects.put)((0, _show.updateDisplayAssetError)(_context.t0.message));
|
||||||
|
|
||||||
|
case 16:
|
||||||
|
return _context.abrupt("return", _context.sent);
|
||||||
|
|
||||||
|
case 17:
|
||||||
|
;
|
||||||
|
|
||||||
|
if (!isAvailable) {
|
||||||
|
_context.next = 24;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
_context.next = 21;
|
||||||
|
return (0, _effects.put)((0, _show.updateDisplayAssetError)(null));
|
||||||
|
|
||||||
|
case 21:
|
||||||
|
_context.next = 23;
|
||||||
|
return (0, _effects.put)((0, _show.updateFileAvailability)(_asset_display_states.AVAILABLE));
|
||||||
|
|
||||||
|
case 23:
|
||||||
|
return _context.abrupt("return", _context.sent);
|
||||||
|
|
||||||
|
case 24:
|
||||||
|
_context.next = 26;
|
||||||
|
return (0, _effects.put)((0, _show.updateFileAvailability)(_asset_display_states.UNAVAILABLE));
|
||||||
|
|
||||||
|
case 26:
|
||||||
|
_context.prev = 26;
|
||||||
|
_context.next = 29;
|
||||||
|
return (0, _effects.call)(_fileApi.triggerClaimGet, claimId, host, name);
|
||||||
|
|
||||||
|
case 29:
|
||||||
|
_context.next = 36;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 31:
|
||||||
|
_context.prev = 31;
|
||||||
|
_context.t1 = _context["catch"](26);
|
||||||
|
_context.next = 35;
|
||||||
|
return (0, _effects.put)((0, _show.updateDisplayAssetError)(_context.t1.message));
|
||||||
|
|
||||||
|
case 35:
|
||||||
|
return _context.abrupt("return", _context.sent);
|
||||||
|
|
||||||
|
case 36:
|
||||||
|
;
|
||||||
|
_context.next = 39;
|
||||||
|
return (0, _effects.put)((0, _show.updateFileAvailability)(_asset_display_states.AVAILABLE));
|
||||||
|
|
||||||
|
case 39:
|
||||||
|
case "end":
|
||||||
|
return _context.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked, this, [[5, 12], [26, 31]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function watchFileIsRequested() {
|
||||||
|
return regeneratorRuntime.wrap(function watchFileIsRequested$(_context2) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context2.prev = _context2.next) {
|
||||||
|
case 0:
|
||||||
|
_context2.next = 2;
|
||||||
|
return (0, _effects.takeLatest)(actions.FILE_REQUESTED, retrieveFile);
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
case "end":
|
||||||
|
return _context2.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked2, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
16
client/build/sagas/index.js
Normal file
16
client/build/sagas/index.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _rootSaga = require("./rootSaga");
|
||||||
|
|
||||||
|
var _show_uri = require("./show_uri");
|
||||||
|
|
||||||
|
var _default = {
|
||||||
|
rootSaga: _rootSaga.rootSaga,
|
||||||
|
handleShowPageUri: _show_uri.handleShowPageUri
|
||||||
|
};
|
||||||
|
exports.default = _default;
|
67
client/build/sagas/logoutChannel.js
Normal file
67
client/build/sagas/logoutChannel.js
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.watchChannelLogout = watchChannelLogout;
|
||||||
|
|
||||||
|
var _effects = require("redux-saga/effects");
|
||||||
|
|
||||||
|
var _channel_action_types = require("../constants/channel_action_types");
|
||||||
|
|
||||||
|
var _authApi = require("../api/authApi.js");
|
||||||
|
|
||||||
|
var _channel = require("../actions/channel");
|
||||||
|
|
||||||
|
var _marked =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(logoutChannelSaga),
|
||||||
|
_marked2 =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(watchChannelLogout);
|
||||||
|
|
||||||
|
function logoutChannelSaga() {
|
||||||
|
return regeneratorRuntime.wrap(function logoutChannelSaga$(_context) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context.prev = _context.next) {
|
||||||
|
case 0:
|
||||||
|
_context.prev = 0;
|
||||||
|
_context.next = 3;
|
||||||
|
return (0, _effects.call)(_authApi.channelLogoutApi);
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
_context.next = 8;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 5:
|
||||||
|
_context.prev = 5;
|
||||||
|
_context.t0 = _context["catch"](0);
|
||||||
|
return _context.abrupt("return", console.log(_context.t0));
|
||||||
|
|
||||||
|
case 8:
|
||||||
|
_context.next = 10;
|
||||||
|
return (0, _effects.put)((0, _channel.updateLoggedInChannel)(null, null, null));
|
||||||
|
|
||||||
|
case 10:
|
||||||
|
case "end":
|
||||||
|
return _context.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked, this, [[0, 5]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function watchChannelLogout() {
|
||||||
|
return regeneratorRuntime.wrap(function watchChannelLogout$(_context2) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context2.prev = _context2.next) {
|
||||||
|
case 0:
|
||||||
|
_context2.next = 2;
|
||||||
|
return (0, _effects.takeLatest)(_channel_action_types.CHANNEL_LOGOUT, logoutChannelSaga);
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
case "end":
|
||||||
|
return _context2.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked2, this);
|
||||||
|
}
|
213
client/build/sagas/publish.js
Normal file
213
client/build/sagas/publish.js
Normal file
|
@ -0,0 +1,213 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.watchPublishStart = watchPublishStart;
|
||||||
|
|
||||||
|
var _effects = require("redux-saga/effects");
|
||||||
|
|
||||||
|
var actions = _interopRequireWildcard(require("../constants/publish_action_types"));
|
||||||
|
|
||||||
|
var publishStates = _interopRequireWildcard(require("../constants/publish_claim_states"));
|
||||||
|
|
||||||
|
var _publish = require("../actions/publish");
|
||||||
|
|
||||||
|
var _publish2 = require("../selectors/publish");
|
||||||
|
|
||||||
|
var _channel = require("../selectors/channel");
|
||||||
|
|
||||||
|
var _site = require("../selectors/site");
|
||||||
|
|
||||||
|
var _validate = require("../utils/validate");
|
||||||
|
|
||||||
|
var _publish3 = require("../utils/publish");
|
||||||
|
|
||||||
|
var _publish4 = require("../channels/publish");
|
||||||
|
|
||||||
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||||
|
|
||||||
|
var _marked =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(publishFile),
|
||||||
|
_marked2 =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(watchPublishStart);
|
||||||
|
|
||||||
|
function publishFile(action) {
|
||||||
|
var history, _ref, publishInChannel, selectedChannel, file, claim, metadata, thumbnailChannel, thumbnailChannelId, thumbnail, publishToolErrors, _ref2, loggedInChannel, _ref3, host, publishMetadata, publishFormData, publishChannel, _ref4, loadStart, progress, load, success, publishError;
|
||||||
|
|
||||||
|
return regeneratorRuntime.wrap(function publishFile$(_context) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context.prev = _context.next) {
|
||||||
|
case 0:
|
||||||
|
history = action.data.history;
|
||||||
|
_context.next = 3;
|
||||||
|
return (0, _effects.select)(_publish2.selectPublishState);
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
_ref = _context.sent;
|
||||||
|
publishInChannel = _ref.publishInChannel;
|
||||||
|
selectedChannel = _ref.selectedChannel;
|
||||||
|
file = _ref.file;
|
||||||
|
claim = _ref.claim;
|
||||||
|
metadata = _ref.metadata;
|
||||||
|
thumbnailChannel = _ref.thumbnailChannel;
|
||||||
|
thumbnailChannelId = _ref.thumbnailChannelId;
|
||||||
|
thumbnail = _ref.thumbnail;
|
||||||
|
publishToolErrors = _ref.error;
|
||||||
|
_context.next = 15;
|
||||||
|
return (0, _effects.select)(_channel.selectChannelState);
|
||||||
|
|
||||||
|
case 15:
|
||||||
|
_ref2 = _context.sent;
|
||||||
|
loggedInChannel = _ref2.loggedInChannel;
|
||||||
|
_context.next = 19;
|
||||||
|
return (0, _effects.select)(_site.selectSiteState);
|
||||||
|
|
||||||
|
case 19:
|
||||||
|
_ref3 = _context.sent;
|
||||||
|
host = _ref3.host;
|
||||||
|
_context.prev = 21;
|
||||||
|
(0, _validate.validateChannelSelection)(publishInChannel, selectedChannel, loggedInChannel);
|
||||||
|
_context.next = 30;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 25:
|
||||||
|
_context.prev = 25;
|
||||||
|
_context.t0 = _context["catch"](21);
|
||||||
|
_context.next = 29;
|
||||||
|
return (0, _effects.put)((0, _publish.updateError)('channel', _context.t0.message));
|
||||||
|
|
||||||
|
case 29:
|
||||||
|
return _context.abrupt("return", _context.sent);
|
||||||
|
|
||||||
|
case 30:
|
||||||
|
; // validate publish parameters
|
||||||
|
|
||||||
|
_context.prev = 31;
|
||||||
|
(0, _validate.validateNoPublishErrors)(publishToolErrors);
|
||||||
|
_context.next = 38;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 35:
|
||||||
|
_context.prev = 35;
|
||||||
|
_context.t1 = _context["catch"](31);
|
||||||
|
return _context.abrupt("return", console.log('publish error:', _context.t1.message));
|
||||||
|
|
||||||
|
case 38:
|
||||||
|
// create metadata
|
||||||
|
publishMetadata = (0, _publish3.createPublishMetadata)(claim, file, metadata, publishInChannel, selectedChannel);
|
||||||
|
|
||||||
|
if (thumbnail) {
|
||||||
|
// add thumbnail to publish metadata
|
||||||
|
publishMetadata['thumbnail'] = (0, _publish3.createThumbnailUrl)(thumbnailChannel, thumbnailChannelId, claim, host);
|
||||||
|
} // create form data for main publish
|
||||||
|
|
||||||
|
|
||||||
|
publishFormData = (0, _publish3.createPublishFormData)(file, thumbnail, publishMetadata); // make the publish request
|
||||||
|
|
||||||
|
_context.next = 43;
|
||||||
|
return (0, _effects.call)(_publish4.makePublishRequestChannel, publishFormData);
|
||||||
|
|
||||||
|
case 43:
|
||||||
|
publishChannel = _context.sent;
|
||||||
|
|
||||||
|
case 44:
|
||||||
|
if (!true) {
|
||||||
|
_context.next = 72;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
_context.next = 47;
|
||||||
|
return (0, _effects.take)(publishChannel);
|
||||||
|
|
||||||
|
case 47:
|
||||||
|
_ref4 = _context.sent;
|
||||||
|
loadStart = _ref4.loadStart;
|
||||||
|
progress = _ref4.progress;
|
||||||
|
load = _ref4.load;
|
||||||
|
success = _ref4.success;
|
||||||
|
publishError = _ref4.error;
|
||||||
|
|
||||||
|
if (!publishError) {
|
||||||
|
_context.next = 57;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
_context.next = 56;
|
||||||
|
return (0, _effects.put)((0, _publish.updatePublishStatus)(publishStates.FAILED, publishError.message));
|
||||||
|
|
||||||
|
case 56:
|
||||||
|
return _context.abrupt("return", _context.sent);
|
||||||
|
|
||||||
|
case 57:
|
||||||
|
if (!success) {
|
||||||
|
_context.next = 61;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
_context.next = 60;
|
||||||
|
return (0, _effects.put)((0, _publish.clearFile)());
|
||||||
|
|
||||||
|
case 60:
|
||||||
|
return _context.abrupt("return", history.push("/".concat(success.data.claimId, "/").concat(success.data.name)));
|
||||||
|
|
||||||
|
case 61:
|
||||||
|
if (!loadStart) {
|
||||||
|
_context.next = 64;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
_context.next = 64;
|
||||||
|
return (0, _effects.put)((0, _publish.updatePublishStatus)(publishStates.LOAD_START, null));
|
||||||
|
|
||||||
|
case 64:
|
||||||
|
if (!progress) {
|
||||||
|
_context.next = 67;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
_context.next = 67;
|
||||||
|
return (0, _effects.put)((0, _publish.updatePublishStatus)(publishStates.LOADING, "".concat(progress, "%")));
|
||||||
|
|
||||||
|
case 67:
|
||||||
|
if (!load) {
|
||||||
|
_context.next = 70;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
_context.next = 70;
|
||||||
|
return (0, _effects.put)((0, _publish.updatePublishStatus)(publishStates.PUBLISHING, null));
|
||||||
|
|
||||||
|
case 70:
|
||||||
|
_context.next = 44;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 72:
|
||||||
|
case "end":
|
||||||
|
return _context.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked, this, [[21, 25], [31, 35]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function watchPublishStart() {
|
||||||
|
return regeneratorRuntime.wrap(function watchPublishStart$(_context2) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context2.prev = _context2.next) {
|
||||||
|
case 0:
|
||||||
|
_context2.next = 2;
|
||||||
|
return (0, _effects.takeLatest)(actions.PUBLISH_START, publishFile);
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
case "end":
|
||||||
|
return _context2.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked2, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
48
client/build/sagas/rootSaga.js
Normal file
48
client/build/sagas/rootSaga.js
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.rootSaga = rootSaga;
|
||||||
|
|
||||||
|
var _effects = require("redux-saga/effects");
|
||||||
|
|
||||||
|
var _show_uri = require("./show_uri");
|
||||||
|
|
||||||
|
var _show_asset = require("./show_asset");
|
||||||
|
|
||||||
|
var _show_channel = require("./show_channel");
|
||||||
|
|
||||||
|
var _file = require("./file");
|
||||||
|
|
||||||
|
var _publish = require("./publish");
|
||||||
|
|
||||||
|
var _updateClaimAvailability = require("./updateClaimAvailability");
|
||||||
|
|
||||||
|
var _updateChannelAvailability = require("./updateChannelAvailability");
|
||||||
|
|
||||||
|
var _createChannel = require("./createChannel");
|
||||||
|
|
||||||
|
var _checkForLoggedInChannel = require("./checkForLoggedInChannel");
|
||||||
|
|
||||||
|
var _logoutChannel = require("./logoutChannel");
|
||||||
|
|
||||||
|
var _marked =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(rootSaga);
|
||||||
|
|
||||||
|
function rootSaga() {
|
||||||
|
return regeneratorRuntime.wrap(function rootSaga$(_context) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context.prev = _context.next) {
|
||||||
|
case 0:
|
||||||
|
_context.next = 2;
|
||||||
|
return (0, _effects.all)([(0, _show_uri.watchHandleShowPageUri)(), (0, _show_asset.watchNewAssetRequest)(), (0, _show_channel.watchNewChannelRequest)(), (0, _show_channel.watchUpdateChannelClaims)(), (0, _file.watchFileIsRequested)(), (0, _publish.watchPublishStart)(), (0, _updateClaimAvailability.watchUpdateClaimAvailability)(), (0, _updateChannelAvailability.watchUpdateChannelAvailability)(), (0, _createChannel.watchChannelCreate)(), (0, _checkForLoggedInChannel.watchChannelLoginCheck)(), (0, _logoutChannel.watchChannelLogout)()]);
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
case "end":
|
||||||
|
return _context.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked, this);
|
||||||
|
}
|
168
client/build/sagas/show_asset.js
Normal file
168
client/build/sagas/show_asset.js
Normal file
|
@ -0,0 +1,168 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.newAssetRequest = newAssetRequest;
|
||||||
|
exports.watchNewAssetRequest = watchNewAssetRequest;
|
||||||
|
|
||||||
|
var _effects = require("redux-saga/effects");
|
||||||
|
|
||||||
|
var actions = _interopRequireWildcard(require("../constants/show_action_types"));
|
||||||
|
|
||||||
|
var _show = require("../actions/show");
|
||||||
|
|
||||||
|
var _assetApi = require("../api/assetApi");
|
||||||
|
|
||||||
|
var _show2 = require("../selectors/show");
|
||||||
|
|
||||||
|
var _site = require("../selectors/site");
|
||||||
|
|
||||||
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||||
|
|
||||||
|
var _marked =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(newAssetRequest),
|
||||||
|
_marked2 =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(watchNewAssetRequest);
|
||||||
|
|
||||||
|
function newAssetRequest(action) {
|
||||||
|
var _action$data, requestType, requestId, name, modifier, state, host, longId, _ref, assetKey, shortId, _ref2, claimData, _ref3;
|
||||||
|
|
||||||
|
return regeneratorRuntime.wrap(function newAssetRequest$(_context) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context.prev = _context.next) {
|
||||||
|
case 0:
|
||||||
|
_action$data = action.data, requestType = _action$data.requestType, requestId = _action$data.requestId, name = _action$data.name, modifier = _action$data.modifier; // put an action to update the request in redux
|
||||||
|
|
||||||
|
_context.next = 3;
|
||||||
|
return (0, _effects.put)((0, _show.onRequestUpdate)(requestType, requestId));
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
_context.next = 5;
|
||||||
|
return (0, _effects.select)(_show2.selectShowState);
|
||||||
|
|
||||||
|
case 5:
|
||||||
|
state = _context.sent;
|
||||||
|
_context.next = 8;
|
||||||
|
return (0, _effects.select)(_site.selectSiteHost);
|
||||||
|
|
||||||
|
case 8:
|
||||||
|
host = _context.sent;
|
||||||
|
|
||||||
|
if (!state.requestList[requestId]) {
|
||||||
|
_context.next = 11;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _context.abrupt("return", null);
|
||||||
|
|
||||||
|
case 11:
|
||||||
|
_context.prev = 11;
|
||||||
|
_context.next = 14;
|
||||||
|
return (0, _effects.call)(_assetApi.getLongClaimId, host, name, modifier);
|
||||||
|
|
||||||
|
case 14:
|
||||||
|
_ref = _context.sent;
|
||||||
|
longId = _ref.data;
|
||||||
|
_context.next = 23;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 18:
|
||||||
|
_context.prev = 18;
|
||||||
|
_context.t0 = _context["catch"](11);
|
||||||
|
_context.next = 22;
|
||||||
|
return (0, _effects.put)((0, _show.onRequestError)(_context.t0.message));
|
||||||
|
|
||||||
|
case 22:
|
||||||
|
return _context.abrupt("return", _context.sent);
|
||||||
|
|
||||||
|
case 23:
|
||||||
|
assetKey = "a#".concat(name, "#").concat(longId);
|
||||||
|
_context.next = 26;
|
||||||
|
return (0, _effects.put)((0, _show.addRequestToRequestList)(requestId, null, assetKey));
|
||||||
|
|
||||||
|
case 26:
|
||||||
|
if (!state.assetList[assetKey]) {
|
||||||
|
_context.next = 28;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _context.abrupt("return", null);
|
||||||
|
|
||||||
|
case 28:
|
||||||
|
_context.prev = 28;
|
||||||
|
_context.next = 31;
|
||||||
|
return (0, _effects.call)(_assetApi.getShortId, host, name, longId);
|
||||||
|
|
||||||
|
case 31:
|
||||||
|
_ref2 = _context.sent;
|
||||||
|
shortId = _ref2.data;
|
||||||
|
_context.next = 40;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 35:
|
||||||
|
_context.prev = 35;
|
||||||
|
_context.t1 = _context["catch"](28);
|
||||||
|
_context.next = 39;
|
||||||
|
return (0, _effects.put)((0, _show.onRequestError)(_context.t1.message));
|
||||||
|
|
||||||
|
case 39:
|
||||||
|
return _context.abrupt("return", _context.sent);
|
||||||
|
|
||||||
|
case 40:
|
||||||
|
_context.prev = 40;
|
||||||
|
_context.next = 43;
|
||||||
|
return (0, _effects.call)(_assetApi.getClaimData, host, name, longId);
|
||||||
|
|
||||||
|
case 43:
|
||||||
|
_ref3 = _context.sent;
|
||||||
|
claimData = _ref3.data;
|
||||||
|
_context.next = 52;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 47:
|
||||||
|
_context.prev = 47;
|
||||||
|
_context.t2 = _context["catch"](40);
|
||||||
|
_context.next = 51;
|
||||||
|
return (0, _effects.put)((0, _show.onRequestError)(_context.t2.message));
|
||||||
|
|
||||||
|
case 51:
|
||||||
|
return _context.abrupt("return", _context.sent);
|
||||||
|
|
||||||
|
case 52:
|
||||||
|
_context.next = 54;
|
||||||
|
return (0, _effects.put)((0, _show.addAssetToAssetList)(assetKey, null, name, longId, shortId, claimData));
|
||||||
|
|
||||||
|
case 54:
|
||||||
|
_context.next = 56;
|
||||||
|
return (0, _effects.put)((0, _show.onRequestError)(null));
|
||||||
|
|
||||||
|
case 56:
|
||||||
|
case "end":
|
||||||
|
return _context.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked, this, [[11, 18], [28, 35], [40, 47]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function watchNewAssetRequest() {
|
||||||
|
return regeneratorRuntime.wrap(function watchNewAssetRequest$(_context2) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context2.prev = _context2.next) {
|
||||||
|
case 0:
|
||||||
|
_context2.next = 2;
|
||||||
|
return (0, _effects.takeLatest)(actions.ASSET_REQUEST_NEW, newAssetRequest);
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
case "end":
|
||||||
|
return _context2.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked2, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
216
client/build/sagas/show_channel.js
Normal file
216
client/build/sagas/show_channel.js
Normal file
|
@ -0,0 +1,216 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.newChannelRequest = newChannelRequest;
|
||||||
|
exports.watchNewChannelRequest = watchNewChannelRequest;
|
||||||
|
exports.watchUpdateChannelClaims = watchUpdateChannelClaims;
|
||||||
|
|
||||||
|
var _effects = require("redux-saga/effects");
|
||||||
|
|
||||||
|
var actions = _interopRequireWildcard(require("../constants/show_action_types"));
|
||||||
|
|
||||||
|
var _show = require("../actions/show");
|
||||||
|
|
||||||
|
var _channelApi = require("../api/channelApi");
|
||||||
|
|
||||||
|
var _show2 = require("../selectors/show");
|
||||||
|
|
||||||
|
var _site = require("../selectors/site");
|
||||||
|
|
||||||
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||||
|
|
||||||
|
var _marked =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(newChannelRequest),
|
||||||
|
_marked2 =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(watchNewChannelRequest),
|
||||||
|
_marked3 =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(getNewClaimsAndUpdateChannel),
|
||||||
|
_marked4 =
|
||||||
|
/*#__PURE__*/
|
||||||
|
regeneratorRuntime.mark(watchUpdateChannelClaims);
|
||||||
|
|
||||||
|
function newChannelRequest(action) {
|
||||||
|
var _action$data, requestType, requestId, channelName, channelId, state, host, longId, shortId, _ref, _ref$data, channelKey, claimsData, _ref2;
|
||||||
|
|
||||||
|
return regeneratorRuntime.wrap(function newChannelRequest$(_context) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context.prev = _context.next) {
|
||||||
|
case 0:
|
||||||
|
_action$data = action.data, requestType = _action$data.requestType, requestId = _action$data.requestId, channelName = _action$data.channelName, channelId = _action$data.channelId; // put an action to update the request in redux
|
||||||
|
|
||||||
|
_context.next = 3;
|
||||||
|
return (0, _effects.put)((0, _show.onRequestUpdate)(requestType, requestId));
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
_context.next = 5;
|
||||||
|
return (0, _effects.select)(_show2.selectShowState);
|
||||||
|
|
||||||
|
case 5:
|
||||||
|
state = _context.sent;
|
||||||
|
_context.next = 8;
|
||||||
|
return (0, _effects.select)(_site.selectSiteHost);
|
||||||
|
|
||||||
|
case 8:
|
||||||
|
host = _context.sent;
|
||||||
|
|
||||||
|
if (!state.requestList[requestId]) {
|
||||||
|
_context.next = 11;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _context.abrupt("return", null);
|
||||||
|
|
||||||
|
case 11:
|
||||||
|
_context.prev = 11;
|
||||||
|
_context.next = 14;
|
||||||
|
return (0, _effects.call)(_channelApi.getChannelData, host, channelName, channelId);
|
||||||
|
|
||||||
|
case 14:
|
||||||
|
_ref = _context.sent;
|
||||||
|
_ref$data = _ref.data;
|
||||||
|
longId = _ref$data.longChannelClaimId;
|
||||||
|
shortId = _ref$data.shortChannelClaimId;
|
||||||
|
_context.next = 25;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 20:
|
||||||
|
_context.prev = 20;
|
||||||
|
_context.t0 = _context["catch"](11);
|
||||||
|
_context.next = 24;
|
||||||
|
return (0, _effects.put)((0, _show.onRequestError)(_context.t0.message));
|
||||||
|
|
||||||
|
case 24:
|
||||||
|
return _context.abrupt("return", _context.sent);
|
||||||
|
|
||||||
|
case 25:
|
||||||
|
// store the request in the channel requests list
|
||||||
|
channelKey = "c#".concat(channelName, "#").concat(longId);
|
||||||
|
_context.next = 28;
|
||||||
|
return (0, _effects.put)((0, _show.addRequestToRequestList)(requestId, null, channelKey));
|
||||||
|
|
||||||
|
case 28:
|
||||||
|
if (!state.channelList[channelKey]) {
|
||||||
|
_context.next = 30;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _context.abrupt("return", null);
|
||||||
|
|
||||||
|
case 30:
|
||||||
|
_context.prev = 30;
|
||||||
|
_context.next = 33;
|
||||||
|
return (0, _effects.call)(_channelApi.getChannelClaims, host, channelName, longId, 1);
|
||||||
|
|
||||||
|
case 33:
|
||||||
|
_ref2 = _context.sent;
|
||||||
|
claimsData = _ref2.data;
|
||||||
|
_context.next = 42;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 37:
|
||||||
|
_context.prev = 37;
|
||||||
|
_context.t1 = _context["catch"](30);
|
||||||
|
_context.next = 41;
|
||||||
|
return (0, _effects.put)((0, _show.onRequestError)(_context.t1.message));
|
||||||
|
|
||||||
|
case 41:
|
||||||
|
return _context.abrupt("return", _context.sent);
|
||||||
|
|
||||||
|
case 42:
|
||||||
|
_context.next = 44;
|
||||||
|
return (0, _effects.put)((0, _show.addNewChannelToChannelList)(channelKey, channelName, shortId, longId, claimsData));
|
||||||
|
|
||||||
|
case 44:
|
||||||
|
_context.next = 46;
|
||||||
|
return (0, _effects.put)((0, _show.onRequestError)(null));
|
||||||
|
|
||||||
|
case 46:
|
||||||
|
case "end":
|
||||||
|
return _context.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked, this, [[11, 20], [30, 37]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function watchNewChannelRequest() {
|
||||||
|
return regeneratorRuntime.wrap(function watchNewChannelRequest$(_context2) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context2.prev = _context2.next) {
|
||||||
|
case 0:
|
||||||
|
_context2.next = 2;
|
||||||
|
return (0, _effects.takeLatest)(actions.CHANNEL_REQUEST_NEW, newChannelRequest);
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
case "end":
|
||||||
|
return _context2.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked2, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
function getNewClaimsAndUpdateChannel(action) {
|
||||||
|
var _action$data2, channelKey, name, longId, page, host, claimsData, _ref3;
|
||||||
|
|
||||||
|
return regeneratorRuntime.wrap(function getNewClaimsAndUpdateChannel$(_context3) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context3.prev = _context3.next) {
|
||||||
|
case 0:
|
||||||
|
_action$data2 = action.data, channelKey = _action$data2.channelKey, name = _action$data2.name, longId = _action$data2.longId, page = _action$data2.page;
|
||||||
|
_context3.next = 3;
|
||||||
|
return (0, _effects.select)(_site.selectSiteHost);
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
host = _context3.sent;
|
||||||
|
_context3.prev = 4;
|
||||||
|
_context3.next = 7;
|
||||||
|
return (0, _effects.call)(_channelApi.getChannelClaims, host, name, longId, page);
|
||||||
|
|
||||||
|
case 7:
|
||||||
|
_ref3 = _context3.sent;
|
||||||
|
claimsData = _ref3.data;
|
||||||
|
_context3.next = 16;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 11:
|
||||||
|
_context3.prev = 11;
|
||||||
|
_context3.t0 = _context3["catch"](4);
|
||||||
|
_context3.next = 15;
|
||||||
|
return (0, _effects.put)((0, _show.onRequestError)(_context3.t0.message));
|
||||||
|
|
||||||
|
case 15:
|
||||||
|
return _context3.abrupt("return", _context3.sent);
|
||||||
|
|
||||||
|
case 16:
|
||||||
|
_context3.next = 18;
|
||||||
|
return (0, _effects.put)((0, _show.updateChannelClaims)(channelKey, claimsData));
|
||||||
|
|
||||||
|
case 18:
|
||||||
|
case "end":
|
||||||
|
return _context3.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked3, this, [[4, 11]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function watchUpdateChannelClaims() {
|
||||||
|
return regeneratorRuntime.wrap(function watchUpdateChannelClaims$(_context4) {
|
||||||
|
while (1) {
|
||||||
|
switch (_context4.prev = _context4.next) {
|
||||||
|
case 0:
|
||||||
|
_context4.next = 2;
|
||||||
|
return (0, _effects.takeLatest)(actions.CHANNEL_CLAIMS_UPDATE_ASYNC, getNewClaimsAndUpdateChannel);
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
case "end":
|
||||||
|
return _context4.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, _marked4, this);
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue