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/lib/markuapad/version.rb
CHANGED
data/markuapad-0.2.1.gem
ADDED
|
Binary file
|
data/src/file_accessor.js
CHANGED
|
@@ -69,6 +69,14 @@ class FileAccessor {
|
|
|
69
69
|
this.fileAccessorDelegate.onAdd(...arguments);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
onProgress() {
|
|
73
|
+
this.fileAccessorDelegate.onProgress(...arguments);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
onProgressStarted() {
|
|
77
|
+
this.fileAccessorDelegate.onProgressStarted(...arguments);
|
|
78
|
+
}
|
|
79
|
+
|
|
72
80
|
supportsImageUploads() {
|
|
73
81
|
return this.fileAccessorDelegate.supportsImageUploads;
|
|
74
82
|
}
|
data/src/index.js
CHANGED
|
@@ -43,6 +43,8 @@ class ExampleFileAccessor {
|
|
|
43
43
|
this.onAddCallbacks = [];
|
|
44
44
|
this.onDeleteCallbacks = [];
|
|
45
45
|
this.onManuscriptChangeCallbacks = [];
|
|
46
|
+
this.onProgressStartedCallbacks = [];
|
|
47
|
+
this.onProgressCallbacks = [];
|
|
46
48
|
this.manifestFilesKey = `${this.projectRoot}/manifest_files`;
|
|
47
49
|
this.manifestCodeKey = `${this.projectRoot}/manifest_code`;
|
|
48
50
|
this.manifestImagesKey = `${this.projectRoot}/manifest_images`;
|
|
@@ -175,6 +177,14 @@ class ExampleFileAccessor {
|
|
|
175
177
|
onManuscriptChange(cb = noop) {
|
|
176
178
|
this.onManuscriptChangeCallbacks.push(cb);
|
|
177
179
|
}
|
|
180
|
+
|
|
181
|
+
onProgress(cb = noop) {
|
|
182
|
+
this.onProgressCallbacks.push(cb);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
onProgressStarted(cb = noop) {
|
|
186
|
+
this.onProgressStartedCallbacks.push(cb);
|
|
187
|
+
}
|
|
178
188
|
}
|
|
179
189
|
|
|
180
190
|
window.ExampleFileAccessor = ExampleFileAccessor;
|
data/src/jsx/main.jsx
CHANGED
|
@@ -40,6 +40,8 @@ class Main extends React.Component {
|
|
|
40
40
|
FileAccessor.onDelete(this.onManuscriptChange);
|
|
41
41
|
FileAccessor.onManuscriptChange(this.onManuscriptChange);
|
|
42
42
|
FileAccessor.onAdd(this.onFileAdded);
|
|
43
|
+
FileAccessor.onProgress(this.onProgress);
|
|
44
|
+
FileAccessor.onProgressStarted(this.onProgressStarted);
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
// Lifecycle methods
|
|
@@ -60,6 +62,20 @@ class Main extends React.Component {
|
|
|
60
62
|
this.onGeneratePreview();
|
|
61
63
|
}
|
|
62
64
|
|
|
65
|
+
onProgress = (progressType) => {
|
|
66
|
+
this.setState({ progressType: progressType, inProgress: false })
|
|
67
|
+
|
|
68
|
+
clearInterval(this.progressUpdateInterval)
|
|
69
|
+
|
|
70
|
+
this.progressUpdateInterval = setTimeout(() => {
|
|
71
|
+
this.setState({ progressType: null })
|
|
72
|
+
}, 1000)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
onProgressStarted = () => {
|
|
76
|
+
this.setState({ inProgress: true })
|
|
77
|
+
}
|
|
78
|
+
|
|
63
79
|
onPreviewImage(file) {
|
|
64
80
|
this.setState({ imageFile: file });
|
|
65
81
|
}
|
|
@@ -113,6 +129,8 @@ class Main extends React.Component {
|
|
|
113
129
|
return (
|
|
114
130
|
<section className="markuapad">
|
|
115
131
|
<Toolbar
|
|
132
|
+
inProgress={this.state.inProgress}
|
|
133
|
+
progressType={this.state.progressType}
|
|
116
134
|
bookTitle={this.props.bookTitle}
|
|
117
135
|
onGeneratePreview={this.onGeneratePreview}
|
|
118
136
|
toggleLiveMode={this.toggleLiveMode}
|
data/src/jsx/toolbar.jsx
CHANGED
|
@@ -1,27 +1,41 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
+
let PROGRESS_TYPE_MAP = {
|
|
4
|
+
'manuscript_update': 'Manuscript Updated.',
|
|
5
|
+
'file_save': 'Saved.',
|
|
6
|
+
'image_create': 'Image Created.',
|
|
7
|
+
'file_delete': 'File Deleted'
|
|
8
|
+
}
|
|
9
|
+
|
|
3
10
|
class Toolbar extends React.Component {
|
|
4
11
|
render() {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
return (
|
|
13
|
+
<nav className="toolbar">
|
|
14
|
+
<h3 className="book-title">{ this.props.bookTitle}</h3>
|
|
15
|
+
<ul className="actions">
|
|
16
|
+
<li>
|
|
17
|
+
<a className={`progressMessage ${this.props.inProgress ? 'active' : ''}`}>
|
|
18
|
+
{ this.props.inProgress ? <i className="fa fa-refresh fa-spin"></i> : null } { PROGRESS_TYPE_MAP[this.props.progressType] || 'Working...' }
|
|
19
|
+
</a>
|
|
20
|
+
</li>
|
|
21
|
+
{
|
|
22
|
+
this.props.enablePreview ?
|
|
23
|
+
[
|
|
24
|
+
<li key="toggleLive"><a className={this.props.inLiveMode ? 'active' : '' } onClick={this.props.toggleLiveMode}><i className="fa fa-columns"></i> Live Mode</a></li>,
|
|
25
|
+
<li key="preview"><a className={this.props.inLiveMode ? 'disabled' : '' } onClick={this.props.onGeneratePreview}><i className="fa fa-play"></i> Preview</a></li>
|
|
26
|
+
]
|
|
27
|
+
: null
|
|
28
|
+
}
|
|
29
|
+
</ul>
|
|
30
|
+
</nav>
|
|
31
|
+
);
|
|
20
32
|
}
|
|
21
33
|
}
|
|
22
34
|
|
|
23
35
|
Toolbar.propTypes = {
|
|
24
36
|
enablePreview: React.PropTypes.bool.isRequired,
|
|
37
|
+
inProgress: React.PropTypes.bool.isRequired,
|
|
38
|
+
progressType: React.PropTypes.string,
|
|
25
39
|
inLiveMode: React.PropTypes.bool.isRequired,
|
|
26
40
|
toggleLiveMode: React.PropTypes.func.isRequired,
|
|
27
41
|
onGeneratePreview: React.PropTypes.func.isRequired,
|
data/src/styles/_toolbar.scss
CHANGED
|
@@ -25,6 +25,17 @@
|
|
|
25
25
|
color: #aaa;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
> a.progressMessage {
|
|
30
|
+
@include transition(opacity 1s ease-in-out);
|
|
31
|
+
opacity: 0;
|
|
32
|
+
border: none;
|
|
33
|
+
&.active {
|
|
34
|
+
opacity: .7;
|
|
35
|
+
background: initial;
|
|
36
|
+
color: #555;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
28
39
|
}
|
|
29
40
|
|
|
30
41
|
.markuapad .toolbar {
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: markuapad
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Braden Simpson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-08-
|
|
11
|
+
date: 2015-08-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -50,6 +50,7 @@ files:
|
|
|
50
50
|
- ".jshintrc"
|
|
51
51
|
- CODE_OF_CONDUCT.md
|
|
52
52
|
- Gemfile
|
|
53
|
+
- Gemfile.lock
|
|
53
54
|
- LICENSE
|
|
54
55
|
- README.md
|
|
55
56
|
- Rakefile
|
|
@@ -74,6 +75,7 @@ files:
|
|
|
74
75
|
- markuapad-0.1.8.gem
|
|
75
76
|
- markuapad-0.1.9.gem
|
|
76
77
|
- markuapad-0.2.0.gem
|
|
78
|
+
- markuapad-0.2.1.gem
|
|
77
79
|
- markuapad.gemspec
|
|
78
80
|
- package.json
|
|
79
81
|
- prepare_gem.sh
|