markuapad 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.babelrc +1 -1
- data/Gemfile.lock +20 -0
- data/app/assets/javascripts/markuapad.js +103 -54
- data/app/assets/stylesheets/markuapad.css +10 -0
- data/build/app.css +10 -0
- data/build/app.js +103 -54
- data/build/dist.css +10 -0
- data/build/dist.js +103 -54
- data/build/index.js +30 -0
- data/build/web.css +10 -0
- data/build/web.js +103 -54
- data/lib/markuapad/version.rb +1 -1
- data/markuapad-0.2.1.gem +0 -0
- data/src/file_accessor.js +8 -0
- data/src/index.js +10 -0
- data/src/jsx/main.jsx +18 -0
- data/src/jsx/toolbar.jsx +29 -15
- data/src/styles/_toolbar.scss +11 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6697ca43810042dc3eb2742a3bd2f19136b9a489
|
|
4
|
+
data.tar.gz: 328a28ef45b5327ee170b89aef15e39ab6ec2ada
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5d134c0369e896f3023b04e3754397320f036aec939be075f458c14bdba8f9e5395ef7f2386fb68f7ac330d24127b0f6e18707441002009887926ec9b77f89b0
|
|
7
|
+
data.tar.gz: d58756073d59110de330508bf0a05bb93bc2406a2c6409a39bd9508ade0c63ab0b9330f0951be74f73d5a6cadaf02004c91c7bfc1f24dba98f7561bde7678ff3
|
data/.babelrc
CHANGED
data/Gemfile.lock
ADDED
|
@@ -3094,10 +3094,26 @@
|
|
|
3094
3094
|
_inherits(Main, _React$Component);
|
|
3095
3095
|
|
|
3096
3096
|
function Main(props) {
|
|
3097
|
+
var _this = this;
|
|
3098
|
+
|
|
3097
3099
|
_classCallCheck(this, Main);
|
|
3098
3100
|
|
|
3099
3101
|
_get(Object.getPrototypeOf(Main.prototype), "constructor", this).call(this, props);
|
|
3100
3102
|
|
|
3103
|
+
this.onProgress = function (progressType) {
|
|
3104
|
+
_this.setState({ progressType: progressType, inProgress: false });
|
|
3105
|
+
|
|
3106
|
+
clearInterval(_this.progressUpdateInterval);
|
|
3107
|
+
|
|
3108
|
+
_this.progressUpdateInterval = setTimeout(function () {
|
|
3109
|
+
_this.setState({ progressType: null });
|
|
3110
|
+
}, 1000);
|
|
3111
|
+
};
|
|
3112
|
+
|
|
3113
|
+
this.onProgressStarted = function () {
|
|
3114
|
+
_this.setState({ inProgress: true });
|
|
3115
|
+
};
|
|
3116
|
+
|
|
3101
3117
|
// Setup some initial state
|
|
3102
3118
|
this.state = {
|
|
3103
3119
|
currentFile: null,
|
|
@@ -3123,6 +3139,8 @@
|
|
|
3123
3139
|
_file_accessor2["default"].onDelete(this.onManuscriptChange);
|
|
3124
3140
|
_file_accessor2["default"].onManuscriptChange(this.onManuscriptChange);
|
|
3125
3141
|
_file_accessor2["default"].onAdd(this.onFileAdded);
|
|
3142
|
+
_file_accessor2["default"].onProgress(this.onProgress);
|
|
3143
|
+
_file_accessor2["default"].onProgressStarted(this.onProgressStarted);
|
|
3126
3144
|
}
|
|
3127
3145
|
|
|
3128
3146
|
_createClass(Main, [{
|
|
@@ -3181,14 +3199,14 @@
|
|
|
3181
3199
|
}, {
|
|
3182
3200
|
key: "toggleLiveMode",
|
|
3183
3201
|
value: function toggleLiveMode() {
|
|
3184
|
-
var
|
|
3202
|
+
var _this2 = this;
|
|
3185
3203
|
|
|
3186
3204
|
// Clear the preview state here as well, so we don't accidentally open a preview
|
|
3187
3205
|
this.setState({ inLiveMode: !this.state.inLiveMode, previewState: "closed" }, function () {
|
|
3188
3206
|
window.dispatchEvent(new Event("resize"));
|
|
3189
3207
|
|
|
3190
3208
|
// If we transition into live mode, then kick off an initial preview;
|
|
3191
|
-
if (
|
|
3209
|
+
if (_this2.state.inLiveMode) _this2.onGeneratePreview();
|
|
3192
3210
|
});
|
|
3193
3211
|
}
|
|
3194
3212
|
}, {
|
|
@@ -3210,6 +3228,8 @@
|
|
|
3210
3228
|
"section",
|
|
3211
3229
|
{ className: "markuapad" },
|
|
3212
3230
|
_react2["default"].createElement(_toolbar2["default"], {
|
|
3231
|
+
inProgress: this.state.inProgress,
|
|
3232
|
+
progressType: this.state.progressType,
|
|
3213
3233
|
bookTitle: this.props.bookTitle,
|
|
3214
3234
|
onGeneratePreview: this.onGeneratePreview,
|
|
3215
3235
|
toggleLiveMode: this.toggleLiveMode,
|
|
@@ -23916,6 +23936,20 @@
|
|
|
23916
23936
|
|
|
23917
23937
|
(_fileAccessorDelegate14 = this.fileAccessorDelegate).onAdd.apply(_fileAccessorDelegate14, arguments);
|
|
23918
23938
|
}
|
|
23939
|
+
}, {
|
|
23940
|
+
key: "onProgress",
|
|
23941
|
+
value: function onProgress() {
|
|
23942
|
+
var _fileAccessorDelegate15;
|
|
23943
|
+
|
|
23944
|
+
(_fileAccessorDelegate15 = this.fileAccessorDelegate).onProgress.apply(_fileAccessorDelegate15, arguments);
|
|
23945
|
+
}
|
|
23946
|
+
}, {
|
|
23947
|
+
key: "onProgressStarted",
|
|
23948
|
+
value: function onProgressStarted() {
|
|
23949
|
+
var _fileAccessorDelegate16;
|
|
23950
|
+
|
|
23951
|
+
(_fileAccessorDelegate16 = this.fileAccessorDelegate).onProgressStarted.apply(_fileAccessorDelegate16, arguments);
|
|
23952
|
+
}
|
|
23919
23953
|
}, {
|
|
23920
23954
|
key: "supportsImageUploads",
|
|
23921
23955
|
value: function supportsImageUploads() {
|
|
@@ -55807,91 +55841,106 @@
|
|
|
55807
55841
|
/* 241 */
|
|
55808
55842
|
/***/ function(module, exports, __webpack_require__) {
|
|
55809
55843
|
|
|
55810
|
-
|
|
55844
|
+
'use strict';
|
|
55811
55845
|
|
|
55812
|
-
Object.defineProperty(exports,
|
|
55846
|
+
Object.defineProperty(exports, '__esModule', {
|
|
55813
55847
|
value: true
|
|
55814
55848
|
});
|
|
55815
55849
|
|
|
55816
|
-
var _createClass = (function () { 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 (
|
|
55850
|
+
var _createClass = (function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
|
55817
55851
|
|
|
55818
|
-
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if (
|
|
55852
|
+
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
|
|
55819
55853
|
|
|
55820
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
55854
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
55821
55855
|
|
|
55822
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(
|
|
55856
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
|
55823
55857
|
|
|
55824
|
-
function _inherits(subClass, superClass) { if (typeof superClass !==
|
|
55858
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
|
|
55825
55859
|
|
|
55826
55860
|
var _react = __webpack_require__(72);
|
|
55827
55861
|
|
|
55828
55862
|
var _react2 = _interopRequireDefault(_react);
|
|
55829
55863
|
|
|
55864
|
+
var PROGRESS_TYPE_MAP = {
|
|
55865
|
+
'manuscript_update': 'Manuscript Updated.',
|
|
55866
|
+
'file_save': 'Saved.',
|
|
55867
|
+
'image_create': 'Image Created.',
|
|
55868
|
+
'file_delete': 'File Deleted'
|
|
55869
|
+
};
|
|
55870
|
+
|
|
55830
55871
|
var Toolbar = (function (_React$Component) {
|
|
55831
55872
|
_inherits(Toolbar, _React$Component);
|
|
55832
55873
|
|
|
55833
55874
|
function Toolbar() {
|
|
55834
55875
|
_classCallCheck(this, Toolbar);
|
|
55835
55876
|
|
|
55836
|
-
_get(Object.getPrototypeOf(Toolbar.prototype),
|
|
55877
|
+
_get(Object.getPrototypeOf(Toolbar.prototype), 'constructor', this).apply(this, arguments);
|
|
55837
55878
|
}
|
|
55838
55879
|
|
|
55839
55880
|
_createClass(Toolbar, [{
|
|
55840
|
-
key:
|
|
55881
|
+
key: 'render',
|
|
55841
55882
|
value: function render() {
|
|
55842
|
-
|
|
55843
|
-
|
|
55844
|
-
|
|
55845
|
-
|
|
55846
|
-
|
|
55847
|
-
|
|
55848
|
-
|
|
55849
|
-
|
|
55883
|
+
return _react2['default'].createElement(
|
|
55884
|
+
'nav',
|
|
55885
|
+
{ className: 'toolbar' },
|
|
55886
|
+
_react2['default'].createElement(
|
|
55887
|
+
'h3',
|
|
55888
|
+
{ className: 'book-title' },
|
|
55889
|
+
this.props.bookTitle
|
|
55890
|
+
),
|
|
55891
|
+
_react2['default'].createElement(
|
|
55892
|
+
'ul',
|
|
55893
|
+
{ className: 'actions' },
|
|
55894
|
+
_react2['default'].createElement(
|
|
55895
|
+
'li',
|
|
55896
|
+
null,
|
|
55897
|
+
_react2['default'].createElement(
|
|
55898
|
+
'a',
|
|
55899
|
+
{ className: 'progressMessage ' + (this.props.inProgress ? 'active' : '') },
|
|
55900
|
+
this.props.inProgress ? _react2['default'].createElement('i', { className: 'fa fa-refresh fa-spin' }) : null,
|
|
55901
|
+
' ',
|
|
55902
|
+
PROGRESS_TYPE_MAP[this.props.progressType] || 'Working...'
|
|
55903
|
+
)
|
|
55850
55904
|
),
|
|
55851
|
-
_react2[
|
|
55852
|
-
|
|
55853
|
-
{
|
|
55854
|
-
_react2[
|
|
55855
|
-
|
|
55856
|
-
|
|
55857
|
-
_react2[
|
|
55858
|
-
|
|
55859
|
-
{ className: this.props.inLiveMode ? "active" : "", onClick: this.props.toggleLiveMode },
|
|
55860
|
-
_react2["default"].createElement("i", { className: "fa fa-columns" }),
|
|
55861
|
-
" Live Mode"
|
|
55862
|
-
)
|
|
55863
|
-
),
|
|
55864
|
-
_react2["default"].createElement(
|
|
55865
|
-
"li",
|
|
55866
|
-
null,
|
|
55867
|
-
_react2["default"].createElement(
|
|
55868
|
-
"a",
|
|
55869
|
-
{ className: this.props.inLiveMode ? "disabled" : "", onClick: this.props.onGeneratePreview },
|
|
55870
|
-
_react2["default"].createElement("i", { className: "fa fa-play" }),
|
|
55871
|
-
" Preview"
|
|
55872
|
-
)
|
|
55905
|
+
this.props.enablePreview ? [_react2['default'].createElement(
|
|
55906
|
+
'li',
|
|
55907
|
+
{ key: 'toggleLive' },
|
|
55908
|
+
_react2['default'].createElement(
|
|
55909
|
+
'a',
|
|
55910
|
+
{ className: this.props.inLiveMode ? 'active' : '', onClick: this.props.toggleLiveMode },
|
|
55911
|
+
_react2['default'].createElement('i', { className: 'fa fa-columns' }),
|
|
55912
|
+
' Live Mode'
|
|
55873
55913
|
)
|
|
55874
|
-
)
|
|
55875
|
-
|
|
55876
|
-
|
|
55877
|
-
|
|
55878
|
-
|
|
55914
|
+
), _react2['default'].createElement(
|
|
55915
|
+
'li',
|
|
55916
|
+
{ key: 'preview' },
|
|
55917
|
+
_react2['default'].createElement(
|
|
55918
|
+
'a',
|
|
55919
|
+
{ className: this.props.inLiveMode ? 'disabled' : '', onClick: this.props.onGeneratePreview },
|
|
55920
|
+
_react2['default'].createElement('i', { className: 'fa fa-play' }),
|
|
55921
|
+
' Preview'
|
|
55922
|
+
)
|
|
55923
|
+
)] : null
|
|
55924
|
+
)
|
|
55925
|
+
);
|
|
55879
55926
|
}
|
|
55880
55927
|
}]);
|
|
55881
55928
|
|
|
55882
55929
|
return Toolbar;
|
|
55883
|
-
})(_react2[
|
|
55930
|
+
})(_react2['default'].Component);
|
|
55884
55931
|
|
|
55885
55932
|
Toolbar.propTypes = {
|
|
55886
|
-
enablePreview: _react2[
|
|
55887
|
-
|
|
55888
|
-
|
|
55889
|
-
|
|
55890
|
-
|
|
55933
|
+
enablePreview: _react2['default'].PropTypes.bool.isRequired,
|
|
55934
|
+
inProgress: _react2['default'].PropTypes.bool.isRequired,
|
|
55935
|
+
progressType: _react2['default'].PropTypes.string,
|
|
55936
|
+
inLiveMode: _react2['default'].PropTypes.bool.isRequired,
|
|
55937
|
+
toggleLiveMode: _react2['default'].PropTypes.func.isRequired,
|
|
55938
|
+
onGeneratePreview: _react2['default'].PropTypes.func.isRequired,
|
|
55939
|
+
bookTitle: _react2['default'].PropTypes.string.isRequired
|
|
55891
55940
|
};
|
|
55892
55941
|
|
|
55893
|
-
exports[
|
|
55894
|
-
module.exports = exports[
|
|
55942
|
+
exports['default'] = Toolbar;
|
|
55943
|
+
module.exports = exports['default'];
|
|
55895
55944
|
|
|
55896
55945
|
/***/ },
|
|
55897
55946
|
/* 242 */
|
|
@@ -285,6 +285,16 @@ html {
|
|
|
285
285
|
color: white; }
|
|
286
286
|
.markuapad .toolbar .menus .dropdown > a.disabled, .markuapad .toolbar .actions li > a.disabled {
|
|
287
287
|
color: #aaa; }
|
|
288
|
+
.markuapad .toolbar .menus .dropdown > a.progressMessage, .markuapad .toolbar .actions li > a.progressMessage {
|
|
289
|
+
-webkit-transition: opacity 1s ease-in-out;
|
|
290
|
+
-moz-transition: opacity 1s ease-in-out;
|
|
291
|
+
transition: opacity 1s ease-in-out;
|
|
292
|
+
opacity: 0;
|
|
293
|
+
border: none; }
|
|
294
|
+
.markuapad .toolbar .menus .dropdown > a.progressMessage.active, .markuapad .toolbar .actions li > a.progressMessage.active {
|
|
295
|
+
opacity: .7;
|
|
296
|
+
background: initial;
|
|
297
|
+
color: #555; }
|
|
288
298
|
|
|
289
299
|
.markuapad .toolbar {
|
|
290
300
|
display: -webkit-box;
|
data/build/app.css
CHANGED
|
@@ -285,6 +285,16 @@ html {
|
|
|
285
285
|
color: white; }
|
|
286
286
|
.markuapad .toolbar .menus .dropdown > a.disabled, .markuapad .toolbar .actions li > a.disabled {
|
|
287
287
|
color: #aaa; }
|
|
288
|
+
.markuapad .toolbar .menus .dropdown > a.progressMessage, .markuapad .toolbar .actions li > a.progressMessage {
|
|
289
|
+
-webkit-transition: opacity 1s ease-in-out;
|
|
290
|
+
-moz-transition: opacity 1s ease-in-out;
|
|
291
|
+
transition: opacity 1s ease-in-out;
|
|
292
|
+
opacity: 0;
|
|
293
|
+
border: none; }
|
|
294
|
+
.markuapad .toolbar .menus .dropdown > a.progressMessage.active, .markuapad .toolbar .actions li > a.progressMessage.active {
|
|
295
|
+
opacity: .7;
|
|
296
|
+
background: initial;
|
|
297
|
+
color: #555; }
|
|
288
298
|
|
|
289
299
|
.markuapad .toolbar {
|
|
290
300
|
display: -webkit-box;
|
data/build/app.js
CHANGED
|
@@ -3079,10 +3079,26 @@
|
|
|
3079
3079
|
_inherits(Main, _React$Component);
|
|
3080
3080
|
|
|
3081
3081
|
function Main(props) {
|
|
3082
|
+
var _this = this;
|
|
3083
|
+
|
|
3082
3084
|
_classCallCheck(this, Main);
|
|
3083
3085
|
|
|
3084
3086
|
_get(Object.getPrototypeOf(Main.prototype), "constructor", this).call(this, props);
|
|
3085
3087
|
|
|
3088
|
+
this.onProgress = function (progressType) {
|
|
3089
|
+
_this.setState({ progressType: progressType, inProgress: false });
|
|
3090
|
+
|
|
3091
|
+
clearInterval(_this.progressUpdateInterval);
|
|
3092
|
+
|
|
3093
|
+
_this.progressUpdateInterval = setTimeout(function () {
|
|
3094
|
+
_this.setState({ progressType: null });
|
|
3095
|
+
}, 1000);
|
|
3096
|
+
};
|
|
3097
|
+
|
|
3098
|
+
this.onProgressStarted = function () {
|
|
3099
|
+
_this.setState({ inProgress: true });
|
|
3100
|
+
};
|
|
3101
|
+
|
|
3086
3102
|
// Setup some initial state
|
|
3087
3103
|
this.state = {
|
|
3088
3104
|
currentFile: null,
|
|
@@ -3108,6 +3124,8 @@
|
|
|
3108
3124
|
_file_accessor2["default"].onDelete(this.onManuscriptChange);
|
|
3109
3125
|
_file_accessor2["default"].onManuscriptChange(this.onManuscriptChange);
|
|
3110
3126
|
_file_accessor2["default"].onAdd(this.onFileAdded);
|
|
3127
|
+
_file_accessor2["default"].onProgress(this.onProgress);
|
|
3128
|
+
_file_accessor2["default"].onProgressStarted(this.onProgressStarted);
|
|
3111
3129
|
}
|
|
3112
3130
|
|
|
3113
3131
|
_createClass(Main, [{
|
|
@@ -3166,14 +3184,14 @@
|
|
|
3166
3184
|
}, {
|
|
3167
3185
|
key: "toggleLiveMode",
|
|
3168
3186
|
value: function toggleLiveMode() {
|
|
3169
|
-
var
|
|
3187
|
+
var _this2 = this;
|
|
3170
3188
|
|
|
3171
3189
|
// Clear the preview state here as well, so we don't accidentally open a preview
|
|
3172
3190
|
this.setState({ inLiveMode: !this.state.inLiveMode, previewState: "closed" }, function () {
|
|
3173
3191
|
window.dispatchEvent(new Event("resize"));
|
|
3174
3192
|
|
|
3175
3193
|
// If we transition into live mode, then kick off an initial preview;
|
|
3176
|
-
if (
|
|
3194
|
+
if (_this2.state.inLiveMode) _this2.onGeneratePreview();
|
|
3177
3195
|
});
|
|
3178
3196
|
}
|
|
3179
3197
|
}, {
|
|
@@ -3195,6 +3213,8 @@
|
|
|
3195
3213
|
"section",
|
|
3196
3214
|
{ className: "markuapad" },
|
|
3197
3215
|
_react2["default"].createElement(_toolbar2["default"], {
|
|
3216
|
+
inProgress: this.state.inProgress,
|
|
3217
|
+
progressType: this.state.progressType,
|
|
3198
3218
|
bookTitle: this.props.bookTitle,
|
|
3199
3219
|
onGeneratePreview: this.onGeneratePreview,
|
|
3200
3220
|
toggleLiveMode: this.toggleLiveMode,
|
|
@@ -23901,6 +23921,20 @@
|
|
|
23901
23921
|
|
|
23902
23922
|
(_fileAccessorDelegate14 = this.fileAccessorDelegate).onAdd.apply(_fileAccessorDelegate14, arguments);
|
|
23903
23923
|
}
|
|
23924
|
+
}, {
|
|
23925
|
+
key: "onProgress",
|
|
23926
|
+
value: function onProgress() {
|
|
23927
|
+
var _fileAccessorDelegate15;
|
|
23928
|
+
|
|
23929
|
+
(_fileAccessorDelegate15 = this.fileAccessorDelegate).onProgress.apply(_fileAccessorDelegate15, arguments);
|
|
23930
|
+
}
|
|
23931
|
+
}, {
|
|
23932
|
+
key: "onProgressStarted",
|
|
23933
|
+
value: function onProgressStarted() {
|
|
23934
|
+
var _fileAccessorDelegate16;
|
|
23935
|
+
|
|
23936
|
+
(_fileAccessorDelegate16 = this.fileAccessorDelegate).onProgressStarted.apply(_fileAccessorDelegate16, arguments);
|
|
23937
|
+
}
|
|
23904
23938
|
}, {
|
|
23905
23939
|
key: "supportsImageUploads",
|
|
23906
23940
|
value: function supportsImageUploads() {
|
|
@@ -55792,91 +55826,106 @@
|
|
|
55792
55826
|
/* 241 */
|
|
55793
55827
|
/***/ function(module, exports, __webpack_require__) {
|
|
55794
55828
|
|
|
55795
|
-
|
|
55829
|
+
'use strict';
|
|
55796
55830
|
|
|
55797
|
-
Object.defineProperty(exports,
|
|
55831
|
+
Object.defineProperty(exports, '__esModule', {
|
|
55798
55832
|
value: true
|
|
55799
55833
|
});
|
|
55800
55834
|
|
|
55801
|
-
var _createClass = (function () { 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 (
|
|
55835
|
+
var _createClass = (function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
|
55802
55836
|
|
|
55803
|
-
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if (
|
|
55837
|
+
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
|
|
55804
55838
|
|
|
55805
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
55839
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
55806
55840
|
|
|
55807
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(
|
|
55841
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
|
55808
55842
|
|
|
55809
|
-
function _inherits(subClass, superClass) { if (typeof superClass !==
|
|
55843
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
|
|
55810
55844
|
|
|
55811
55845
|
var _react = __webpack_require__(72);
|
|
55812
55846
|
|
|
55813
55847
|
var _react2 = _interopRequireDefault(_react);
|
|
55814
55848
|
|
|
55849
|
+
var PROGRESS_TYPE_MAP = {
|
|
55850
|
+
'manuscript_update': 'Manuscript Updated.',
|
|
55851
|
+
'file_save': 'Saved.',
|
|
55852
|
+
'image_create': 'Image Created.',
|
|
55853
|
+
'file_delete': 'File Deleted'
|
|
55854
|
+
};
|
|
55855
|
+
|
|
55815
55856
|
var Toolbar = (function (_React$Component) {
|
|
55816
55857
|
_inherits(Toolbar, _React$Component);
|
|
55817
55858
|
|
|
55818
55859
|
function Toolbar() {
|
|
55819
55860
|
_classCallCheck(this, Toolbar);
|
|
55820
55861
|
|
|
55821
|
-
_get(Object.getPrototypeOf(Toolbar.prototype),
|
|
55862
|
+
_get(Object.getPrototypeOf(Toolbar.prototype), 'constructor', this).apply(this, arguments);
|
|
55822
55863
|
}
|
|
55823
55864
|
|
|
55824
55865
|
_createClass(Toolbar, [{
|
|
55825
|
-
key:
|
|
55866
|
+
key: 'render',
|
|
55826
55867
|
value: function render() {
|
|
55827
|
-
|
|
55828
|
-
|
|
55829
|
-
|
|
55830
|
-
|
|
55831
|
-
|
|
55832
|
-
|
|
55833
|
-
|
|
55834
|
-
|
|
55868
|
+
return _react2['default'].createElement(
|
|
55869
|
+
'nav',
|
|
55870
|
+
{ className: 'toolbar' },
|
|
55871
|
+
_react2['default'].createElement(
|
|
55872
|
+
'h3',
|
|
55873
|
+
{ className: 'book-title' },
|
|
55874
|
+
this.props.bookTitle
|
|
55875
|
+
),
|
|
55876
|
+
_react2['default'].createElement(
|
|
55877
|
+
'ul',
|
|
55878
|
+
{ className: 'actions' },
|
|
55879
|
+
_react2['default'].createElement(
|
|
55880
|
+
'li',
|
|
55881
|
+
null,
|
|
55882
|
+
_react2['default'].createElement(
|
|
55883
|
+
'a',
|
|
55884
|
+
{ className: 'progressMessage ' + (this.props.inProgress ? 'active' : '') },
|
|
55885
|
+
this.props.inProgress ? _react2['default'].createElement('i', { className: 'fa fa-refresh fa-spin' }) : null,
|
|
55886
|
+
' ',
|
|
55887
|
+
PROGRESS_TYPE_MAP[this.props.progressType] || 'Working...'
|
|
55888
|
+
)
|
|
55835
55889
|
),
|
|
55836
|
-
_react2[
|
|
55837
|
-
|
|
55838
|
-
{
|
|
55839
|
-
_react2[
|
|
55840
|
-
|
|
55841
|
-
|
|
55842
|
-
_react2[
|
|
55843
|
-
|
|
55844
|
-
{ className: this.props.inLiveMode ? "active" : "", onClick: this.props.toggleLiveMode },
|
|
55845
|
-
_react2["default"].createElement("i", { className: "fa fa-columns" }),
|
|
55846
|
-
" Live Mode"
|
|
55847
|
-
)
|
|
55848
|
-
),
|
|
55849
|
-
_react2["default"].createElement(
|
|
55850
|
-
"li",
|
|
55851
|
-
null,
|
|
55852
|
-
_react2["default"].createElement(
|
|
55853
|
-
"a",
|
|
55854
|
-
{ className: this.props.inLiveMode ? "disabled" : "", onClick: this.props.onGeneratePreview },
|
|
55855
|
-
_react2["default"].createElement("i", { className: "fa fa-play" }),
|
|
55856
|
-
" Preview"
|
|
55857
|
-
)
|
|
55890
|
+
this.props.enablePreview ? [_react2['default'].createElement(
|
|
55891
|
+
'li',
|
|
55892
|
+
{ key: 'toggleLive' },
|
|
55893
|
+
_react2['default'].createElement(
|
|
55894
|
+
'a',
|
|
55895
|
+
{ className: this.props.inLiveMode ? 'active' : '', onClick: this.props.toggleLiveMode },
|
|
55896
|
+
_react2['default'].createElement('i', { className: 'fa fa-columns' }),
|
|
55897
|
+
' Live Mode'
|
|
55858
55898
|
)
|
|
55859
|
-
)
|
|
55860
|
-
|
|
55861
|
-
|
|
55862
|
-
|
|
55863
|
-
|
|
55899
|
+
), _react2['default'].createElement(
|
|
55900
|
+
'li',
|
|
55901
|
+
{ key: 'preview' },
|
|
55902
|
+
_react2['default'].createElement(
|
|
55903
|
+
'a',
|
|
55904
|
+
{ className: this.props.inLiveMode ? 'disabled' : '', onClick: this.props.onGeneratePreview },
|
|
55905
|
+
_react2['default'].createElement('i', { className: 'fa fa-play' }),
|
|
55906
|
+
' Preview'
|
|
55907
|
+
)
|
|
55908
|
+
)] : null
|
|
55909
|
+
)
|
|
55910
|
+
);
|
|
55864
55911
|
}
|
|
55865
55912
|
}]);
|
|
55866
55913
|
|
|
55867
55914
|
return Toolbar;
|
|
55868
|
-
})(_react2[
|
|
55915
|
+
})(_react2['default'].Component);
|
|
55869
55916
|
|
|
55870
55917
|
Toolbar.propTypes = {
|
|
55871
|
-
enablePreview: _react2[
|
|
55872
|
-
|
|
55873
|
-
|
|
55874
|
-
|
|
55875
|
-
|
|
55918
|
+
enablePreview: _react2['default'].PropTypes.bool.isRequired,
|
|
55919
|
+
inProgress: _react2['default'].PropTypes.bool.isRequired,
|
|
55920
|
+
progressType: _react2['default'].PropTypes.string,
|
|
55921
|
+
inLiveMode: _react2['default'].PropTypes.bool.isRequired,
|
|
55922
|
+
toggleLiveMode: _react2['default'].PropTypes.func.isRequired,
|
|
55923
|
+
onGeneratePreview: _react2['default'].PropTypes.func.isRequired,
|
|
55924
|
+
bookTitle: _react2['default'].PropTypes.string.isRequired
|
|
55876
55925
|
};
|
|
55877
55926
|
|
|
55878
|
-
exports[
|
|
55879
|
-
module.exports = exports[
|
|
55927
|
+
exports['default'] = Toolbar;
|
|
55928
|
+
module.exports = exports['default'];
|
|
55880
55929
|
|
|
55881
55930
|
/***/ },
|
|
55882
55931
|
/* 242 */
|