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
data/build/dist.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/dist.js
CHANGED
|
@@ -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 */
|
data/build/index.js
CHANGED
|
@@ -132,6 +132,8 @@
|
|
|
132
132
|
this.onAddCallbacks = [];
|
|
133
133
|
this.onDeleteCallbacks = [];
|
|
134
134
|
this.onManuscriptChangeCallbacks = [];
|
|
135
|
+
this.onProgressStartedCallbacks = [];
|
|
136
|
+
this.onProgressCallbacks = [];
|
|
135
137
|
this.manifestFilesKey = this.projectRoot + "/manifest_files";
|
|
136
138
|
this.manifestCodeKey = this.projectRoot + "/manifest_code";
|
|
137
139
|
this.manifestImagesKey = this.projectRoot + "/manifest_images";
|
|
@@ -384,6 +386,20 @@
|
|
|
384
386
|
|
|
385
387
|
this.onManuscriptChangeCallbacks.push(cb);
|
|
386
388
|
}
|
|
389
|
+
}, {
|
|
390
|
+
key: "onProgress",
|
|
391
|
+
value: function onProgress() {
|
|
392
|
+
var cb = arguments.length <= 0 || arguments[0] === undefined ? noop : arguments[0];
|
|
393
|
+
|
|
394
|
+
this.onProgressCallbacks.push(cb);
|
|
395
|
+
}
|
|
396
|
+
}, {
|
|
397
|
+
key: "onProgressStarted",
|
|
398
|
+
value: function onProgressStarted() {
|
|
399
|
+
var cb = arguments.length <= 0 || arguments[0] === undefined ? noop : arguments[0];
|
|
400
|
+
|
|
401
|
+
this.onProgressStartedCallbacks.push(cb);
|
|
402
|
+
}
|
|
387
403
|
}]);
|
|
388
404
|
|
|
389
405
|
return ExampleFileAccessor;
|
|
@@ -2159,6 +2175,20 @@
|
|
|
2159
2175
|
|
|
2160
2176
|
(_fileAccessorDelegate14 = this.fileAccessorDelegate).onAdd.apply(_fileAccessorDelegate14, arguments);
|
|
2161
2177
|
}
|
|
2178
|
+
}, {
|
|
2179
|
+
key: "onProgress",
|
|
2180
|
+
value: function onProgress() {
|
|
2181
|
+
var _fileAccessorDelegate15;
|
|
2182
|
+
|
|
2183
|
+
(_fileAccessorDelegate15 = this.fileAccessorDelegate).onProgress.apply(_fileAccessorDelegate15, arguments);
|
|
2184
|
+
}
|
|
2185
|
+
}, {
|
|
2186
|
+
key: "onProgressStarted",
|
|
2187
|
+
value: function onProgressStarted() {
|
|
2188
|
+
var _fileAccessorDelegate16;
|
|
2189
|
+
|
|
2190
|
+
(_fileAccessorDelegate16 = this.fileAccessorDelegate).onProgressStarted.apply(_fileAccessorDelegate16, arguments);
|
|
2191
|
+
}
|
|
2162
2192
|
}, {
|
|
2163
2193
|
key: "supportsImageUploads",
|
|
2164
2194
|
value: function supportsImageUploads() {
|
data/build/web.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/web.js
CHANGED
|
@@ -3087,10 +3087,26 @@
|
|
|
3087
3087
|
_inherits(Main, _React$Component);
|
|
3088
3088
|
|
|
3089
3089
|
function Main(props) {
|
|
3090
|
+
var _this = this;
|
|
3091
|
+
|
|
3090
3092
|
_classCallCheck(this, Main);
|
|
3091
3093
|
|
|
3092
3094
|
_get(Object.getPrototypeOf(Main.prototype), "constructor", this).call(this, props);
|
|
3093
3095
|
|
|
3096
|
+
this.onProgress = function (progressType) {
|
|
3097
|
+
_this.setState({ progressType: progressType, inProgress: false });
|
|
3098
|
+
|
|
3099
|
+
clearInterval(_this.progressUpdateInterval);
|
|
3100
|
+
|
|
3101
|
+
_this.progressUpdateInterval = setTimeout(function () {
|
|
3102
|
+
_this.setState({ progressType: null });
|
|
3103
|
+
}, 1000);
|
|
3104
|
+
};
|
|
3105
|
+
|
|
3106
|
+
this.onProgressStarted = function () {
|
|
3107
|
+
_this.setState({ inProgress: true });
|
|
3108
|
+
};
|
|
3109
|
+
|
|
3094
3110
|
// Setup some initial state
|
|
3095
3111
|
this.state = {
|
|
3096
3112
|
currentFile: null,
|
|
@@ -3116,6 +3132,8 @@
|
|
|
3116
3132
|
_file_accessor2["default"].onDelete(this.onManuscriptChange);
|
|
3117
3133
|
_file_accessor2["default"].onManuscriptChange(this.onManuscriptChange);
|
|
3118
3134
|
_file_accessor2["default"].onAdd(this.onFileAdded);
|
|
3135
|
+
_file_accessor2["default"].onProgress(this.onProgress);
|
|
3136
|
+
_file_accessor2["default"].onProgressStarted(this.onProgressStarted);
|
|
3119
3137
|
}
|
|
3120
3138
|
|
|
3121
3139
|
_createClass(Main, [{
|
|
@@ -3174,14 +3192,14 @@
|
|
|
3174
3192
|
}, {
|
|
3175
3193
|
key: "toggleLiveMode",
|
|
3176
3194
|
value: function toggleLiveMode() {
|
|
3177
|
-
var
|
|
3195
|
+
var _this2 = this;
|
|
3178
3196
|
|
|
3179
3197
|
// Clear the preview state here as well, so we don't accidentally open a preview
|
|
3180
3198
|
this.setState({ inLiveMode: !this.state.inLiveMode, previewState: "closed" }, function () {
|
|
3181
3199
|
window.dispatchEvent(new Event("resize"));
|
|
3182
3200
|
|
|
3183
3201
|
// If we transition into live mode, then kick off an initial preview;
|
|
3184
|
-
if (
|
|
3202
|
+
if (_this2.state.inLiveMode) _this2.onGeneratePreview();
|
|
3185
3203
|
});
|
|
3186
3204
|
}
|
|
3187
3205
|
}, {
|
|
@@ -3203,6 +3221,8 @@
|
|
|
3203
3221
|
"section",
|
|
3204
3222
|
{ className: "markuapad" },
|
|
3205
3223
|
_react2["default"].createElement(_toolbar2["default"], {
|
|
3224
|
+
inProgress: this.state.inProgress,
|
|
3225
|
+
progressType: this.state.progressType,
|
|
3206
3226
|
bookTitle: this.props.bookTitle,
|
|
3207
3227
|
onGeneratePreview: this.onGeneratePreview,
|
|
3208
3228
|
toggleLiveMode: this.toggleLiveMode,
|
|
@@ -23909,6 +23929,20 @@
|
|
|
23909
23929
|
|
|
23910
23930
|
(_fileAccessorDelegate14 = this.fileAccessorDelegate).onAdd.apply(_fileAccessorDelegate14, arguments);
|
|
23911
23931
|
}
|
|
23932
|
+
}, {
|
|
23933
|
+
key: "onProgress",
|
|
23934
|
+
value: function onProgress() {
|
|
23935
|
+
var _fileAccessorDelegate15;
|
|
23936
|
+
|
|
23937
|
+
(_fileAccessorDelegate15 = this.fileAccessorDelegate).onProgress.apply(_fileAccessorDelegate15, arguments);
|
|
23938
|
+
}
|
|
23939
|
+
}, {
|
|
23940
|
+
key: "onProgressStarted",
|
|
23941
|
+
value: function onProgressStarted() {
|
|
23942
|
+
var _fileAccessorDelegate16;
|
|
23943
|
+
|
|
23944
|
+
(_fileAccessorDelegate16 = this.fileAccessorDelegate).onProgressStarted.apply(_fileAccessorDelegate16, arguments);
|
|
23945
|
+
}
|
|
23912
23946
|
}, {
|
|
23913
23947
|
key: "supportsImageUploads",
|
|
23914
23948
|
value: function supportsImageUploads() {
|
|
@@ -55800,91 +55834,106 @@
|
|
|
55800
55834
|
/* 241 */
|
|
55801
55835
|
/***/ function(module, exports, __webpack_require__) {
|
|
55802
55836
|
|
|
55803
|
-
|
|
55837
|
+
'use strict';
|
|
55804
55838
|
|
|
55805
|
-
Object.defineProperty(exports,
|
|
55839
|
+
Object.defineProperty(exports, '__esModule', {
|
|
55806
55840
|
value: true
|
|
55807
55841
|
});
|
|
55808
55842
|
|
|
55809
|
-
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 (
|
|
55843
|
+
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; }; })();
|
|
55810
55844
|
|
|
55811
|
-
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 (
|
|
55845
|
+
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); } } };
|
|
55812
55846
|
|
|
55813
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
55847
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
55814
55848
|
|
|
55815
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(
|
|
55849
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
|
55816
55850
|
|
|
55817
|
-
function _inherits(subClass, superClass) { if (typeof superClass !==
|
|
55851
|
+
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; }
|
|
55818
55852
|
|
|
55819
55853
|
var _react = __webpack_require__(72);
|
|
55820
55854
|
|
|
55821
55855
|
var _react2 = _interopRequireDefault(_react);
|
|
55822
55856
|
|
|
55857
|
+
var PROGRESS_TYPE_MAP = {
|
|
55858
|
+
'manuscript_update': 'Manuscript Updated.',
|
|
55859
|
+
'file_save': 'Saved.',
|
|
55860
|
+
'image_create': 'Image Created.',
|
|
55861
|
+
'file_delete': 'File Deleted'
|
|
55862
|
+
};
|
|
55863
|
+
|
|
55823
55864
|
var Toolbar = (function (_React$Component) {
|
|
55824
55865
|
_inherits(Toolbar, _React$Component);
|
|
55825
55866
|
|
|
55826
55867
|
function Toolbar() {
|
|
55827
55868
|
_classCallCheck(this, Toolbar);
|
|
55828
55869
|
|
|
55829
|
-
_get(Object.getPrototypeOf(Toolbar.prototype),
|
|
55870
|
+
_get(Object.getPrototypeOf(Toolbar.prototype), 'constructor', this).apply(this, arguments);
|
|
55830
55871
|
}
|
|
55831
55872
|
|
|
55832
55873
|
_createClass(Toolbar, [{
|
|
55833
|
-
key:
|
|
55874
|
+
key: 'render',
|
|
55834
55875
|
value: function render() {
|
|
55835
|
-
|
|
55836
|
-
|
|
55837
|
-
|
|
55838
|
-
|
|
55839
|
-
|
|
55840
|
-
|
|
55841
|
-
|
|
55842
|
-
|
|
55876
|
+
return _react2['default'].createElement(
|
|
55877
|
+
'nav',
|
|
55878
|
+
{ className: 'toolbar' },
|
|
55879
|
+
_react2['default'].createElement(
|
|
55880
|
+
'h3',
|
|
55881
|
+
{ className: 'book-title' },
|
|
55882
|
+
this.props.bookTitle
|
|
55883
|
+
),
|
|
55884
|
+
_react2['default'].createElement(
|
|
55885
|
+
'ul',
|
|
55886
|
+
{ className: 'actions' },
|
|
55887
|
+
_react2['default'].createElement(
|
|
55888
|
+
'li',
|
|
55889
|
+
null,
|
|
55890
|
+
_react2['default'].createElement(
|
|
55891
|
+
'a',
|
|
55892
|
+
{ className: 'progressMessage ' + (this.props.inProgress ? 'active' : '') },
|
|
55893
|
+
this.props.inProgress ? _react2['default'].createElement('i', { className: 'fa fa-refresh fa-spin' }) : null,
|
|
55894
|
+
' ',
|
|
55895
|
+
PROGRESS_TYPE_MAP[this.props.progressType] || 'Working...'
|
|
55896
|
+
)
|
|
55843
55897
|
),
|
|
55844
|
-
_react2[
|
|
55845
|
-
|
|
55846
|
-
{
|
|
55847
|
-
_react2[
|
|
55848
|
-
|
|
55849
|
-
|
|
55850
|
-
_react2[
|
|
55851
|
-
|
|
55852
|
-
{ className: this.props.inLiveMode ? "active" : "", onClick: this.props.toggleLiveMode },
|
|
55853
|
-
_react2["default"].createElement("i", { className: "fa fa-columns" }),
|
|
55854
|
-
" Live Mode"
|
|
55855
|
-
)
|
|
55856
|
-
),
|
|
55857
|
-
_react2["default"].createElement(
|
|
55858
|
-
"li",
|
|
55859
|
-
null,
|
|
55860
|
-
_react2["default"].createElement(
|
|
55861
|
-
"a",
|
|
55862
|
-
{ className: this.props.inLiveMode ? "disabled" : "", onClick: this.props.onGeneratePreview },
|
|
55863
|
-
_react2["default"].createElement("i", { className: "fa fa-play" }),
|
|
55864
|
-
" Preview"
|
|
55865
|
-
)
|
|
55898
|
+
this.props.enablePreview ? [_react2['default'].createElement(
|
|
55899
|
+
'li',
|
|
55900
|
+
{ key: 'toggleLive' },
|
|
55901
|
+
_react2['default'].createElement(
|
|
55902
|
+
'a',
|
|
55903
|
+
{ className: this.props.inLiveMode ? 'active' : '', onClick: this.props.toggleLiveMode },
|
|
55904
|
+
_react2['default'].createElement('i', { className: 'fa fa-columns' }),
|
|
55905
|
+
' Live Mode'
|
|
55866
55906
|
)
|
|
55867
|
-
)
|
|
55868
|
-
|
|
55869
|
-
|
|
55870
|
-
|
|
55871
|
-
|
|
55907
|
+
), _react2['default'].createElement(
|
|
55908
|
+
'li',
|
|
55909
|
+
{ key: 'preview' },
|
|
55910
|
+
_react2['default'].createElement(
|
|
55911
|
+
'a',
|
|
55912
|
+
{ className: this.props.inLiveMode ? 'disabled' : '', onClick: this.props.onGeneratePreview },
|
|
55913
|
+
_react2['default'].createElement('i', { className: 'fa fa-play' }),
|
|
55914
|
+
' Preview'
|
|
55915
|
+
)
|
|
55916
|
+
)] : null
|
|
55917
|
+
)
|
|
55918
|
+
);
|
|
55872
55919
|
}
|
|
55873
55920
|
}]);
|
|
55874
55921
|
|
|
55875
55922
|
return Toolbar;
|
|
55876
|
-
})(_react2[
|
|
55923
|
+
})(_react2['default'].Component);
|
|
55877
55924
|
|
|
55878
55925
|
Toolbar.propTypes = {
|
|
55879
|
-
enablePreview: _react2[
|
|
55880
|
-
|
|
55881
|
-
|
|
55882
|
-
|
|
55883
|
-
|
|
55926
|
+
enablePreview: _react2['default'].PropTypes.bool.isRequired,
|
|
55927
|
+
inProgress: _react2['default'].PropTypes.bool.isRequired,
|
|
55928
|
+
progressType: _react2['default'].PropTypes.string,
|
|
55929
|
+
inLiveMode: _react2['default'].PropTypes.bool.isRequired,
|
|
55930
|
+
toggleLiveMode: _react2['default'].PropTypes.func.isRequired,
|
|
55931
|
+
onGeneratePreview: _react2['default'].PropTypes.func.isRequired,
|
|
55932
|
+
bookTitle: _react2['default'].PropTypes.string.isRequired
|
|
55884
55933
|
};
|
|
55885
55934
|
|
|
55886
|
-
exports[
|
|
55887
|
-
module.exports = exports[
|
|
55935
|
+
exports['default'] = Toolbar;
|
|
55936
|
+
module.exports = exports['default'];
|
|
55888
55937
|
|
|
55889
55938
|
/***/ },
|
|
55890
55939
|
/* 242 */
|